Home › Forum › SOFA › Using SOFA › What is the strategy of sub dividing tetrahedron in sofa
- This topic has 5 replies, 2 voices, and was last updated 7 years, 9 months ago by Hugo.
-
AuthorPosts
-
26 December 2016 at 08:58 #8252CocoBlocked
Hello everyone,
I want to know the strategy of sub dividing tetrahedron in sofa.But I’m not clear understand the code in the TetrahedronSetTopologyAlgorithems.inl.Can anyone gives me some details?
Best,Coco
6 January 2017 at 18:23 #8288HugoKeymasterHi Coco,
The only implementation described in TetrahedronSetTopologyAlgorithms is a subdivision based on the plane crossing a tetrahedron.
This is pretty limited. You can actually handle your own subdivision of tetrahedron by writing a Component (like TopologicalChangeProcessor) based on the functions available in the TetrahedronSetTopologyModifier.
There you will be able to implement your own subdivision.Did you already make some progress since December?
Best,
Hugo
9 January 2017 at 04:00 #8292CocoBlockedHi Hugo,
I get that the implementation is a subdivision based on the plane crossing a tetrahedron. I just feel confused about the implementation how it constructs subdivided tetrahedrons. Just like here
//construct subdivided tetrahedrons Tetra subTetra[2]; edgeDirec=this->m_geometryAlgorithms->computeEdgeDirection(intersectedEdgeID[0])*-1; Real dot=edgeDirec*planeNormal; //inspect the tetrahedron is already subdivided if((pointsID[0]>=m_intialNbPoints) && (pointsID[1]>=m_intialNbPoints)) { if((pointsID[0]-m_intialNbPoints)%2==0) { if(dot>0) { subTetra[0][0]=intersectedEdge[0]; subTetra[0][1]=pointsID[0]+1; subTetra[0][2]=pointsID[1]+1; subTetra[0][3]=intersectedPointID[0]+1; subTetra[1][0]=intersectedEdge[1]; subTetra[1][1]=pointsID[0]; subTetra[1][2]=pointsID[1]; subTetra[1][3]=intersectedPointID[0]; } else { subTetra[0][0]=intersectedEdge[0]; subTetra[0][1]=pointsID[0]; subTetra[0][2]=pointsID[1]; subTetra[0][3]=intersectedPointID[0]; subTetra[1][0]=intersectedEdge[1]; subTetra[1][1]=pointsID[0]+1; subTetra[1][2]=pointsID[1]+1; subTetra[1][3]=intersectedPointID[0]+1; } } else { if(dot>0) { subTetra[0][0]=intersectedEdge[0]; subTetra[0][1]=pointsID[0]; subTetra[0][2]=pointsID[1]; subTetra[0][3]=intersectedPointID[0]+1; subTetra[1][0]=intersectedEdge[1]; subTetra[1][1]=pointsID[0]-1; subTetra[1][2]=pointsID[1]-1; subTetra[1][3]=intersectedPointID[0]; } else { subTetra[0][0]=intersectedEdge[0]; subTetra[0][1]=pointsID[0]-1; subTetra[0][2]=pointsID[1]-1; subTetra[0][3]=intersectedPointID[0]; subTetra[1][0]=intersectedEdge[1]; subTetra[1][1]=pointsID[0]; subTetra[1][2]=pointsID[1]; subTetra[1][3]=intersectedPointID[0]+1; } } }
Why does it need to determine the dot?
In the past two weeks, this problem has been bothering me and I have no progress.
Best,
Coco
1 February 2017 at 11:49 #8481HugoKeymasterHi Coco,
Hmm I’m no real expert of these topological changes.
As I understand it, when an intersection between the plane and a tetrahedron is detected, points are added at each intersection between the plane and the edges of the tetrahedron. Then, using these new points, new tetrahedron is created.
I’ll also see if anyone can tell us more about it.Best,
Hugo
8 February 2017 at 09:42 #8521CocoBlockedHi Hugo,
Thank you for always help.It is Lunar New Year now, Wish you all the best and success.
Best,
Coco
8 February 2017 at 15:56 #8525HugoKeymasterAhah ! Thank you very much !
Wish you all the best and many SOFA achievements !Did my reply help ?
Shall we resolve the topic? -
AuthorPosts
- You must be logged in to reply to this topic.