@@ -96,8 +96,7 @@ void TearingAlgorithms<DataTypes>::computeFracturePath(const Coord& pA, Index tr
9696template <class DataTypes >
9797void TearingAlgorithms<DataTypes>::computeFracturePath(FracturePath& my_fracturePath)
9898{
99- std::cout << " --- computeFracturePath --- " << std::endl;
100- std::cout << " my_fracturePath.ptA: " << my_fracturePath.ptA << " | " << my_fracturePath.triIdA << std::endl;
99+
101100 SReal snapThreshold = 0.8 ;
102101 SReal snapThresholdBorder = 0.8 ;
103102
@@ -112,27 +111,31 @@ void TearingAlgorithms<DataTypes>::computeFracturePath(FracturePath& my_fracture
112111 bool validPath2 = m_triangleGeo->computeSegmentTriangulationIntersections (my_fracturePath.ptA , my_fracturePath.ptC , my_fracturePath.triIdA , sofa::InvalidID, triangles_list2, edges_list2, coords_list2);
113112
114113
115- std::cout << " triangles_list: " << triangles_list << std::endl;
116- std::cout << " edges_list: " << edges_list << " | " << coords_list << std::endl;
117- std::cout << " triangles_list2: " << triangles_list2 << std::endl;
118- std::cout << " edges_list2: " << edges_list2 << " | " << coords_list2 << std::endl;
119-
120- if (!validPath || !validPath2) {
121- my_fracturePath.pathOk = false ;
122- return ;
114+ if (validPath && validPath2)
115+ {
116+ my_fracturePath.triIdB = triangles_list.back ();
117+ my_fracturePath.triIdC = triangles_list2.back ();
118+
119+ my_fracturePath.pointsToAdd = m_triangleGeo->computeIncisionPath (my_fracturePath.ptB , my_fracturePath.ptC , my_fracturePath.triIdB , my_fracturePath.triIdC );
120+ my_fracturePath.pathOk = true ;
121+ // for (auto pta : my_fracturePath.pointsToAdd)
122+ // {
123+ // pta->printValue();
124+ // }
123125 }
126+ else
127+ {
128+ my_fracturePath.pathOk = false ;
124129
125- std::cout << " -- computeIncisionPath -- " << std::endl;
126- my_fracturePath.triIdB = triangles_list.back ();
127- my_fracturePath.triIdC = triangles_list2.back ();
130+ std::cout << " --- computeFracturePath --- " << std::endl;
131+ std::cout << " my_fracturePath.ptA: " << my_fracturePath.ptA << " | " << my_fracturePath.triIdA << std::endl;
132+ std::cout << " triangles_list: " << triangles_list << std::endl;
133+ std::cout << " edges_list: " << edges_list << " | " << coords_list << std::endl;
134+ std::cout << " triangles_list2: " << triangles_list2 << std::endl;
135+ std::cout << " edges_list2: " << edges_list2 << " | " << coords_list2 << std::endl;
128136
129- my_fracturePath.pointsToAdd = m_triangleGeo->computeIncisionPath (my_fracturePath.ptB , my_fracturePath.ptC , my_fracturePath.triIdB , my_fracturePath.triIdC );
130- my_fracturePath.pathOk = true ;
131- for (auto pta : my_fracturePath.pointsToAdd )
132- {
133- pta->printValue ();
137+ return ;
134138 }
135- std::cout << " --- computeFracturePath END --- " << std::endl;
136139}
137140
138141
0 commit comments