Hello!
I am trying to automatically generate some dummies on a complex object surface. I want to implement a functionality similar to the plugin "create dummies on mesh surface" using code, but I am unsure if this can be achieved through the API. The object I am working with is a massive space station model, and I want to generate numerous dummies uniformly on its surface according to my specifications. These dummies will be used for subsequent robotic arm crawling operations. I need to ensure not only that the generated dummies are on the mesh surface but also that their z-axis is perpendicular to the corresponding surface (the "create dummies on mesh surface" feature can achieve this, but I am unsure if it can be implemented using the API).
Therefore, I would like to know if it is possible to realize this idea using the CoppeliaSim API.
Create dummies on mesh programmatically
Re: Create dummies on mesh programmatically
The way the Create dummies on mesh add-on works is by creating a proximity sensor pointing towards the mesh (from the camera viewpoint).
You can see implementation of function
You can see implementation of function
rayCast()
here and copy it and adapt it to your needs.Re: Create dummies on mesh programmatically
Hello,
you can easily achieve this by using a ray-type proximity sensor of very large size, and placing it appropriately. Then simply use sim.checkProximitySensor upon it in order to retrieve the possible intersection with your object(s) and the normal vector. Make sure your proximity sensor is explicitly handled.
Cheers
you can easily achieve this by using a ray-type proximity sensor of very large size, and placing it appropriately. Then simply use sim.checkProximitySensor upon it in order to retrieve the possible intersection with your object(s) and the normal vector. Make sure your proximity sensor is explicitly handled.
Cheers