Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-4.56984 18.0925 3.09767
-0.707107 -2.08167e-17 4.93754e-18 0.707107
58 changes: 58 additions & 0 deletions scenes/TopologyBenchmarks/TriangleCut_benchmark-01_simpleCut.scn
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" ?>
<Node name="root" dt="0.03" showBoundingTree="0" gravity="0 -0.1 0">
<Node name="RequiredPlugins">
<RequiredPlugin name="Sofa.Component.Collision.Detection.Algorithm"/> <!-- Needed to use components [BVHNarrowPhase, BruteForceBroadPhase, CollisionPipeline] -->
<RequiredPlugin name="Sofa.Component.Collision.Detection.Intersection"/> <!-- Needed to use components [MinProximityIntersection] -->
<RequiredPlugin name="Sofa.Component.Collision.Geometry"/> <!-- Needed to use components [PointCollisionModel, SphereCollisionModel, TriangleCollisionModel] -->
<RequiredPlugin name="Sofa.Component.Collision.Response.Contact"/> <!-- Needed to use components [DefaultContactManager] -->
<RequiredPlugin name="Sofa.Component.Constraint.Projective"/> <!-- Needed to use components [FixedConstraint] -->
<RequiredPlugin name="Sofa.Component.Engine.Select"/> <!-- Needed to use components [BoxROI] -->
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader] -->
<RequiredPlugin name="Sofa.Component.LinearSolver.Iterative"/> <!-- Needed to use components [CGLinearSolver] -->
<RequiredPlugin name="Sofa.Component.Mapping.Linear"/> <!-- Needed to use components [IdentityMapping] -->
<RequiredPlugin name="Sofa.Component.Mapping.NonLinear"/> <!-- Needed to use components [RigidMapping] -->
<RequiredPlugin name="Sofa.Component.Mass"/> <!-- Needed to use components [DiagonalMass, UniformMass] -->
<RequiredPlugin name="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
<RequiredPlugin name="Sofa.Component.SceneUtility"/> <!-- Needed to use components [InfoComponent] -->
<RequiredPlugin name="Sofa.Component.SolidMechanics.FEM.Elastic"/> <!-- Needed to use components [TetrahedralCorotationalFEMForceField] -->
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
<RequiredPlugin name="Sofa.Component.Topology.Container.Dynamic"/> <!-- Needed to use components [TetrahedronSetGeometryAlgorithms, TetrahedronSetTopologyContainer, TetrahedronSetTopologyModifier, TriangleSetGeometryAlgorithms, TriangleSetTopologyContainer, TriangleSetTopologyModifier] -->
<RequiredPlugin name="Sofa.Component.Topology.Container.Grid"/> <!-- Needed to use components [RegularGridTopology] -->
<RequiredPlugin name="Sofa.Component.Topology.Mapping"/> <!-- Needed to use components [Hexa2TetraTopologicalMapping, Tetra2TriangleTopologicalMapping] -->
<RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
<RequiredPlugin name="Sofa.Component.SolidMechanics.Spring"/> <!-- Needed to use components [TriangularBendingSprings] -->
<RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
<RequiredPlugin name="Tearing" />
</Node>

<VisualStyle displayFlags="hideCollisionModels showVisual showBehaviorModels showWireframe" />

<DefaultAnimationLoop />
<DefaultVisualManagerLoop />
<CollisionPipeline verbose="0" />
<BruteForceBroadPhase/>
<BVHNarrowPhase/>
<CollisionResponse response="PenalityContactForceField" />
<MinProximityIntersection name="Proximity" alarmDistance="1.0" contactDistance="0.1" />

<Node name="FixedPlane" >
<EulerImplicitSolver name="cg_odesolver" />
<CGLinearSolver iterations="40" name="linear solver" tolerance="1.0e-9" threshold="1.0e-9" />
<MeshOBJLoader name="loader" filename="./mesh/plane_128_triangles.obj" scale3d="10 10 10" />
<MechanicalObject name="CoarseMesh" position="@loader.position" template="Vec3d" />
<TriangleSetTopologyContainer triangles="@loader.triangles" name="Ttopo" />
<TriangleSetTopologyModifier name="Modifier" />
<TriangleSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" drawEdges="1" showIndicesScale="0.04" showTriangleIndices="1" showEdgeIndices="1" showPointIndices="1"/>
<DiagonalMass template="Vec3d,Vec3d" name="default5" massDensity="0.1" />
<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"/>
<FixedProjectiveConstraint template="Vec3d" name="fixedConstraint1" indices="@box_roi1.indices"/>
<TriangularFEMForceField template="Vec3d" name="FEM" method="large" poissonRatio="0.45" youngModulus="600" />
<TriangleCollisionModel name="default7" selfCollision="true" />
<TriangleCuttingController name="TriCtrl" triAID="55" triBID="68" drawDebugCut="0" performCut="1"/>
<Node name="visu">
<OglModel name="Visual" texcoords="@../loader.texcoords" texturename="textures/colorMap.png"/>
<IdentityMapping input="@.." output="@." />
</Node>
</Node>

</Node>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-0.849029 46.9556 1.51729
-0.707107 2.01511e-19 -2.01511e-19 0.707107
58 changes: 58 additions & 0 deletions scenes/TopologyBenchmarks/TriangleCut_benchmark-02_snapping.scn
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" ?>
<Node name="root" dt="0.03" showBoundingTree="0" gravity="0 -0.1 0">
<Node name="RequiredPlugins">
<RequiredPlugin name="Sofa.Component.Collision.Detection.Algorithm"/> <!-- Needed to use components [BVHNarrowPhase, BruteForceBroadPhase, CollisionPipeline] -->
<RequiredPlugin name="Sofa.Component.Collision.Detection.Intersection"/> <!-- Needed to use components [MinProximityIntersection] -->
<RequiredPlugin name="Sofa.Component.Collision.Geometry"/> <!-- Needed to use components [PointCollisionModel, SphereCollisionModel, TriangleCollisionModel] -->
<RequiredPlugin name="Sofa.Component.Collision.Response.Contact"/> <!-- Needed to use components [DefaultContactManager] -->
<RequiredPlugin name="Sofa.Component.Constraint.Projective"/> <!-- Needed to use components [FixedConstraint] -->
<RequiredPlugin name="Sofa.Component.Engine.Select"/> <!-- Needed to use components [BoxROI] -->
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader] -->
<RequiredPlugin name="Sofa.Component.LinearSolver.Iterative"/> <!-- Needed to use components [CGLinearSolver] -->
<RequiredPlugin name="Sofa.Component.Mapping.Linear"/> <!-- Needed to use components [IdentityMapping] -->
<RequiredPlugin name="Sofa.Component.Mapping.NonLinear"/> <!-- Needed to use components [RigidMapping] -->
<RequiredPlugin name="Sofa.Component.Mass"/> <!-- Needed to use components [DiagonalMass, UniformMass] -->
<RequiredPlugin name="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
<RequiredPlugin name="Sofa.Component.SceneUtility"/> <!-- Needed to use components [InfoComponent] -->
<RequiredPlugin name="Sofa.Component.SolidMechanics.FEM.Elastic"/> <!-- Needed to use components [TetrahedralCorotationalFEMForceField] -->
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
<RequiredPlugin name="Sofa.Component.Topology.Container.Dynamic"/> <!-- Needed to use components [TetrahedronSetGeometryAlgorithms, TetrahedronSetTopologyContainer, TetrahedronSetTopologyModifier, TriangleSetGeometryAlgorithms, TriangleSetTopologyContainer, TriangleSetTopologyModifier] -->
<RequiredPlugin name="Sofa.Component.Topology.Container.Grid"/> <!-- Needed to use components [RegularGridTopology] -->
<RequiredPlugin name="Sofa.Component.Topology.Mapping"/> <!-- Needed to use components [Hexa2TetraTopologicalMapping, Tetra2TriangleTopologicalMapping] -->
<RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
<RequiredPlugin name="Sofa.Component.SolidMechanics.Spring"/> <!-- Needed to use components [TriangularBendingSprings] -->
<RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
<RequiredPlugin name="Tearing" />
</Node>

<VisualStyle displayFlags="hideCollisionModels showVisual showBehaviorModels showWireframe" />

<DefaultAnimationLoop />
<DefaultVisualManagerLoop />
<CollisionPipeline verbose="0" />
<BruteForceBroadPhase/>
<BVHNarrowPhase/>
<CollisionResponse response="PenalityContactForceField" />
<MinProximityIntersection name="Proximity" alarmDistance="1.0" contactDistance="0.1" />

<Node name="FixedPlane" >
<EulerImplicitSolver name="cg_odesolver" />
<CGLinearSolver iterations="40" name="linear solver" tolerance="1.0e-9" threshold="1.0e-9" />
<MeshOBJLoader name="loader" filename="./mesh/plane_128_triangles.obj" scale3d="10 10 10" />
<MechanicalObject name="CoarseMesh" position="@loader.position" template="Vec3d" />
<TriangleSetTopologyContainer triangles="@loader.triangles" name="Ttopo" />
<TriangleSetTopologyModifier name="Modifier" />
<TriangleSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" drawEdges="1" showIndicesScale="0.04" showTriangleIndices="1" showEdgeIndices="1" showPointIndices="1"/>
<DiagonalMass template="Vec3d,Vec3d" name="default5" massDensity="0.1" />
<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"/>
<FixedProjectiveConstraint template="Vec3d" name="fixedConstraint1" indices="@box_roi1.indices"/>
<TriangularFEMForceField template="Vec3d" name="FEM" method="large" poissonRatio="0.45" youngModulus="600" />
<TriangleCollisionModel name="default7" selfCollision="true" />
<TriangleCuttingController name="TriCtrl" triAID="55" triBID="85" drawDebugCut="0" performCut="1"/>
<Node name="visu">
<OglModel name="Visual" texcoords="@../loader.texcoords" texturename="textures/colorMap.png"/>
<IdentityMapping input="@.." output="@." />
</Node>
</Node>

</Node>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2.82916e-17 49.6379 8.72903e-15
-0.707107 2.01511e-19 -2.01511e-19 0.707107
58 changes: 58 additions & 0 deletions scenes/TopologyBenchmarks/TriangleCut_benchmark-03_snapping.scn
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" ?>
<Node name="root" dt="0.03" showBoundingTree="0" gravity="0 -0.1 0">
<Node name="RequiredPlugins">
<RequiredPlugin name="Sofa.Component.Collision.Detection.Algorithm"/> <!-- Needed to use components [BVHNarrowPhase, BruteForceBroadPhase, CollisionPipeline] -->
<RequiredPlugin name="Sofa.Component.Collision.Detection.Intersection"/> <!-- Needed to use components [MinProximityIntersection] -->
<RequiredPlugin name="Sofa.Component.Collision.Geometry"/> <!-- Needed to use components [PointCollisionModel, SphereCollisionModel, TriangleCollisionModel] -->
<RequiredPlugin name="Sofa.Component.Collision.Response.Contact"/> <!-- Needed to use components [DefaultContactManager] -->
<RequiredPlugin name="Sofa.Component.Constraint.Projective"/> <!-- Needed to use components [FixedConstraint] -->
<RequiredPlugin name="Sofa.Component.Engine.Select"/> <!-- Needed to use components [BoxROI] -->
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader] -->
<RequiredPlugin name="Sofa.Component.LinearSolver.Iterative"/> <!-- Needed to use components [CGLinearSolver] -->
<RequiredPlugin name="Sofa.Component.Mapping.Linear"/> <!-- Needed to use components [IdentityMapping] -->
<RequiredPlugin name="Sofa.Component.Mapping.NonLinear"/> <!-- Needed to use components [RigidMapping] -->
<RequiredPlugin name="Sofa.Component.Mass"/> <!-- Needed to use components [DiagonalMass, UniformMass] -->
<RequiredPlugin name="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
<RequiredPlugin name="Sofa.Component.SceneUtility"/> <!-- Needed to use components [InfoComponent] -->
<RequiredPlugin name="Sofa.Component.SolidMechanics.FEM.Elastic"/> <!-- Needed to use components [TetrahedralCorotationalFEMForceField] -->
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
<RequiredPlugin name="Sofa.Component.Topology.Container.Dynamic"/> <!-- Needed to use components [TetrahedronSetGeometryAlgorithms, TetrahedronSetTopologyContainer, TetrahedronSetTopologyModifier, TriangleSetGeometryAlgorithms, TriangleSetTopologyContainer, TriangleSetTopologyModifier] -->
<RequiredPlugin name="Sofa.Component.Topology.Container.Grid"/> <!-- Needed to use components [RegularGridTopology] -->
<RequiredPlugin name="Sofa.Component.Topology.Mapping"/> <!-- Needed to use components [Hexa2TetraTopologicalMapping, Tetra2TriangleTopologicalMapping] -->
<RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
<RequiredPlugin name="Sofa.Component.SolidMechanics.Spring"/> <!-- Needed to use components [TriangularBendingSprings] -->
<RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
<RequiredPlugin name="Tearing" />
</Node>

<VisualStyle displayFlags="hideCollisionModels showVisual showBehaviorModels showWireframe"/>

<DefaultAnimationLoop />
<DefaultVisualManagerLoop />
<CollisionPipeline verbose="0" />
<BruteForceBroadPhase/>
<BVHNarrowPhase/>
<CollisionResponse response="PenalityContactForceField" />
<MinProximityIntersection name="Proximity" alarmDistance="1.0" contactDistance="0.1" />

<Node name="FixedPlane" >
<EulerImplicitSolver name="cg_odesolver" />
<CGLinearSolver iterations="40" name="linear solver" tolerance="1.0e-9" threshold="1.0e-9" />
<MeshOBJLoader name="loader" filename="./mesh/plane_128_triangles.obj" scale3d="10 10 10" />
<MechanicalObject name="CoarseMesh" position="@loader.position" template="Vec3d" />
<TriangleSetTopologyContainer triangles="@loader.triangles" name="Ttopo" />
<TriangleSetTopologyModifier name="Modifier" />
<TriangleSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" drawEdges="1" showIndicesScale="0.04" showTriangleIndices="1" showEdgeIndices="1" showPointIndices="1"/>
<DiagonalMass template="Vec3d,Vec3d" name="default5" massDensity="0.1" />
<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"/>
<FixedProjectiveConstraint template="Vec3d" name="fixedConstraint1" indices="@box_roi1.indices"/>
<TriangularFEMForceField template="Vec3d" name="FEM" method="large" poissonRatio="0.45" youngModulus="600" />
<TriangleCollisionModel name="default7" selfCollision="true" />
<TriangleCuttingController name="TriCtrl" triAID="33" triBID="4" drawDebugCut="0" performCut="1"/>
<Node name="visu">
<OglModel name="Visual" texcoords="@../loader.texcoords" texturename="textures/colorMap.png"/>
<IdentityMapping input="@.." output="@." />
</Node>
</Node>

</Node>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-0.740008 44.5146 -4.62505
-0.707107 6.93889e-18 1.14281e-17 0.707107
3 changes: 3 additions & 0 deletions src/Tearing/Controllers/TriangleCuttingController.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ class TEARING_API TriangleCuttingController : public core::behavior::BaseControl

type::vector< TriangleSubdivider*> m_subviders;
type::vector< std::shared_ptr<PointToAdd> > m_pointsToAdd;

type::vector<Triangle> m_addTriangles;
type::vector<TriangleID> m_removedTriangles;
};


Expand Down
Loading
Loading