Skip to content

Commit 55d9043

Browse files
committed
Fix compilation and add new sceen for debug
1 parent c15dfd8 commit 55d9043

File tree

2 files changed

+61
-3
lines changed

2 files changed

+61
-3
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0" ?>
2+
<Node name="root" dt="0.03" showBoundingTree="0" gravity="0 -0.1 0">
3+
<Node name="RequiredPlugins">
4+
<RequiredPlugin name="Sofa.Component.Collision.Detection.Algorithm"/> <!-- Needed to use components [BVHNarrowPhase, BruteForceBroadPhase, CollisionPipeline] -->
5+
<RequiredPlugin name="Sofa.Component.Collision.Detection.Intersection"/> <!-- Needed to use components [MinProximityIntersection] -->
6+
<RequiredPlugin name="Sofa.Component.Collision.Geometry"/> <!-- Needed to use components [PointCollisionModel, SphereCollisionModel, TriangleCollisionModel] -->
7+
<RequiredPlugin name="Sofa.Component.Collision.Response.Contact"/> <!-- Needed to use components [DefaultContactManager] -->
8+
<RequiredPlugin name="Sofa.Component.Constraint.Projective"/> <!-- Needed to use components [FixedConstraint] -->
9+
<RequiredPlugin name="Sofa.Component.Engine.Select"/> <!-- Needed to use components [BoxROI] -->
10+
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader] -->
11+
<RequiredPlugin name="Sofa.Component.LinearSolver.Iterative"/> <!-- Needed to use components [CGLinearSolver] -->
12+
<RequiredPlugin name="Sofa.Component.Mapping.Linear"/> <!-- Needed to use components [IdentityMapping] -->
13+
<RequiredPlugin name="Sofa.Component.Mapping.NonLinear"/> <!-- Needed to use components [RigidMapping] -->
14+
<RequiredPlugin name="Sofa.Component.Mass"/> <!-- Needed to use components [DiagonalMass, UniformMass] -->
15+
<RequiredPlugin name="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
16+
<RequiredPlugin name="Sofa.Component.SceneUtility"/> <!-- Needed to use components [InfoComponent] -->
17+
<RequiredPlugin name="Sofa.Component.SolidMechanics.FEM.Elastic"/> <!-- Needed to use components [TetrahedralCorotationalFEMForceField] -->
18+
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
19+
<RequiredPlugin name="Sofa.Component.Topology.Container.Dynamic"/> <!-- Needed to use components [TetrahedronSetGeometryAlgorithms, TetrahedronSetTopologyContainer, TetrahedronSetTopologyModifier, TriangleSetGeometryAlgorithms, TriangleSetTopologyContainer, TriangleSetTopologyModifier] -->
20+
<RequiredPlugin name="Sofa.Component.Topology.Container.Grid"/> <!-- Needed to use components [RegularGridTopology] -->
21+
<RequiredPlugin name="Sofa.Component.Topology.Mapping"/> <!-- Needed to use components [Hexa2TetraTopologicalMapping, Tetra2TriangleTopologicalMapping] -->
22+
<RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
23+
<RequiredPlugin name="Sofa.Component.SolidMechanics.Spring"/> <!-- Needed to use components [TriangularBendingSprings] -->
24+
<RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
25+
<RequiredPlugin name="Tearing" />
26+
</Node>
27+
28+
<VisualStyle displayFlags="hideCollisionModels showVisual showBehaviorModels showWireframe" />
29+
30+
<DefaultAnimationLoop />
31+
<DefaultVisualManagerLoop />
32+
<CollisionPipeline verbose="0" />
33+
<BruteForceBroadPhase/>
34+
<BVHNarrowPhase/>
35+
<CollisionResponse response="PenalityContactForceField" />
36+
<MinProximityIntersection name="Proximity" alarmDistance="1.0" contactDistance="0.1" />
37+
38+
<Node name="FixedPlane" >
39+
<EulerImplicitSolver name="cg_odesolver" />
40+
<CGLinearSolver iterations="40" name="linear solver" tolerance="1.0e-9" threshold="1.0e-9" />
41+
<MeshOBJLoader name="loader" filename="./mesh/plane_128_triangles.obj" scale3d="10 10 10" />
42+
<MechanicalObject name="CoarseMesh" position="@loader.position" template="Vec3d" />
43+
<TriangleSetTopologyContainer triangles="@loader.triangles" name="Ttopo" />
44+
<TriangleSetTopologyModifier name="Modifier" />
45+
<TriangleSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" drawEdges="1" showIndicesScale="0.04" showTriangleIndices="1" showEdgeIndices="1" showPointIndices="1"/>
46+
<DiagonalMass template="Vec3d,Vec3d" name="default5" massDensity="0.1" />
47+
<BoxROI template="Vec3d" name="box_roi1" box="-20.1 -1 -20.1 -19.9 1 20.1 19.9 -1 -20.1 20.1 1 20.1" drawBoxes="1"/>
48+
<FixedProjectiveConstraint template="Vec3d" name="fixedConstraint1" indices="@box_roi1.indices"/>
49+
<TriangularFEMForceField template="Vec3d" name="FEM" method="large" poissonRatio="0.45" youngModulus="600" />
50+
<TriangleCollisionModel name="default7" selfCollision="true" />
51+
<TriangleCuttingController name="TriCtrl" triAID="8" triBID="66" triACoefs="0.33 0.33 0.33 " triBCoefs=" 0.33 0.33 0.33" drawDebugCut="1" performCut="1"/>
52+
<Node name="visu">
53+
<OglModel name="Visual" texcoords="@../loader.texcoords" texturename="textures/colorMap.png"/>
54+
<IdentityMapping input="@.." output="@." />
55+
</Node>
56+
</Node>
57+
58+
</Node>

src/Tearing/Controllers/TriangleCuttingController.inl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,11 @@ void TriangleCuttingController<DataTypes>::processCutNew()
476476
SReal snapThreshold = 0.8;
477477
SReal snapThresholdBorder = 0.8;
478478

479-
m_pointsToAdd = m_geometryAlgorithms->computeIncisionPathNew(ptA, ptB, triIds[0], triIds[1], snapThreshold, snapThresholdBorder);
479+
m_pointsToAdd = m_geometryAlgorithms->computeIncisionPath(ptA, ptB, triIds[0], triIds[1], snapThreshold, snapThresholdBorder);
480480
std::cout << "m_pointsToAdd: " << m_pointsToAdd.size() << std::endl;
481481

482482
if (d_performCut.getValue())
483-
m_geometryAlgorithms->ComputeIncision(ptA, ptB, triIds[0], triIds[1], m_pointsToAdd);
483+
m_geometryAlgorithms->InciseAlongPath(ptA, ptB, triIds[0], triIds[1], m_pointsToAdd);
484484

485485
std::cout << "TriangleCuttingController::processCutNew() out" << std::endl;
486486
}
@@ -524,7 +524,7 @@ void TriangleCuttingController<DataTypes>::processCut()
524524

525525
std::cout << "ptA: " << ptA << std::endl;
526526
std::cout << "ptB: " << ptB << std::endl;
527-
m_geometryAlgorithms->computeIncisionPath(ptA, ptB, triIds[0], triIds[1], triangles_list, edges_list, coords_list);
527+
m_geometryAlgorithms->computeSegmentTriangulationIntersections(ptA, ptB, triIds[0], triIds[1], triangles_list, edges_list, coords_list);
528528

529529
std::cout << "triangles_list: " << triangles_list << std::endl;
530530
std::cout << "edges_list: " << edges_list << std::endl;

0 commit comments

Comments
 (0)