- This topic has 1 reply, 2 voices, and was last updated 3 years, 10 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Using SOFA › Mapping points on collision mesh to points on visual mesh
Tagged: 64_bits, Linux_other, Plugin_other, SOFA_other
Hello everyone,
I am trying to implement a scene using python3 and the following setup:
In my scene I have an object which consists of different meshes. I have one mesh for collisions and a different one for the visual model. During the simulation, the object interacts with a tool. Based on the collision points between object and tool, I want to change the color of the respective points on the visual mesh. I already implemented the coloring part, but I am struggling to map the detected collision points (on the collision mesh) to the respective points on the visual mesh.
If I understand correctly, I cannot map these points directly, but have to take a detour over the deformation model (as shown in the figure here). And to go from collisionModel to deformationModel I need to call applyJT
and from deformationModel to visualModel I need to call applyJ
. Is this correct? How would I do that using python? My current guess is that I need to write a custom python3 binding, but maybe anyone has another idea or solved this in the past?
Greetings
Julia
SOFA version: v20.12_beta
SOFA plugin: SofaPython3
Operating system: Manjaro linux
Hey @tschuelia
First of all, thank you for your question (and all the software info, version etc!) and sorry for our latency.
Second, did you notice the SOFA V20.12 release including the official integration of the SofaPython3?
To recover the collision information, you can go for a ContactListener. The IDs of the point you will recover are indeed the one from the collision model. Using the map of indices from one model to another one available in the mapping you should be able to recover the IDs in the visual model (collision model –> mechanical –> visual model)
Best
Hugo
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.