Home › Forum › SOFA › Using SOFA › Carving into model does not work when using another model
Tagged: 64_bits, SOFA_1806, Windows_10
- This topic has 11 replies, 4 voices, and was last updated 5 years, 8 months ago by epernod.
-
AuthorPosts
-
1 January 2019 at 16:46 #12713AnonymousInactive
I was working with the SOFA Carving plugin and it was working perfectly. I tried to ad a tool to cut through the model instead of the point that is defined, but when I do that there is no more cutting just collision.
Here is my code:
<?xml version="1.0" ?> <Node name="root" dt="0.05" showBoundingTree="0" gravity="0 0 0"> <RequiredPlugin name="Carving" pluginName="SofaCarving" /> <VisualStyle displayFlags="" /> <CollisionPipeline verbose="0" /> <BruteForceDetection name="N2" /> <CollisionResponse response="default" /> <MinProximityIntersection name="Proximity" alarmDistance="0.08" contactDistance="0.05" useSurfaceNormals="false"/> <CollisionGroup /> <CarvingManager active="true"/> <Node name="TT"> <EulerImplicit name="cg_odesolver" printLog="false" rayleighStiffness="0.1" rayleighMass="0.1" /> <CGLinearSolver iterations="25" name="linear solver" tolerance="1.0e-9" threshold="1.0e-9" /> <MeshVTKLoader filename="data/mesh/prostate.vtk" name="loader" /> <MechanicalObject src="@loader" name="Volume" /> <include href="Objects/TetrahedronSetTopology.xml" src="@loader" /> <DiagonalMass massDensity="0.5" /> <TetrahedralCorotationalFEMForceField name="CFEM" youngModulus="360" poissonRatio="0.3" method="large" /> <Node name="T"> <include href="Objects/TriangleSetTopology.xml" /> <Tetra2TriangleTopologicalMapping input="@../Container" output="@Container" /> <TriangleSet /> <Node name="Visu"> <OglModel name="Visual" color="red" texturename="C:\Users\Fayad\Documents\sofa\Models\virtualLabco\prostate.png"/> <IdentityMapping input="@../../Volume" output="@Visual" /> </Node> </Node> </Node> <Node name="Instrument" > <EulerImplicitSolver name="ODE solver" rayleighStiffness="0.05" rayleighMass="1.0" /> <CGLinearSolver name="linear solver" iterations="25" tolerance="1e-10" threshold="10e-10" /> <MechanicalObject name="instrumentState" template="Rigid" /> <UniformMass name="mass" totalmass="0.05" /> <LCPForceFeedback activate="true" forceCoef="0.001"/> <UncoupledConstraintCorrection/> <Node name="VisualModel" > <OglModel name="InstrumentVisualModel" fileMesh="mesh/dental_instrument.obj" color="blue" scale="0.05" /> <RigidMapping name="MM->VM mapping" input="@instrumentState" output="@InstrumentVisualModel" /> </Node> <Node name="CollisionModel" > <MeshObjLoader filename="mesh/dental_instrument.obj" name="loader"/> <Mesh src="@loader" name="InstrumentCollisionModel" /> <MechanicalObject src="@loader" name="instrumentCollisionState" scale="0.05" /> <Line name="instrument" tags="CarvingTool" contactStiffness="2" /> <Point name="instrument" tags="CarvingTool" contactStiffness="2" /> <Triangle name="instrument" tags="CarvingTool" contactStiffness="2" /> <RigidMapping name="MM->CM mapping" input="@instrumentState" output="@instrumentCollisionState" /> </Node> </Node> </Node>
2 January 2019 at 18:42 #12715AnonymousInactiveI found out that only one point can do the carving into the model and not multiple, is there a way to make it the whole model instead of only one point?
3 January 2019 at 18:11 #12719HugoKeymasterHi @fayad
I am no expert from this plugin, I’ll try to find the answer (or someone who knows) for you 😉
BestHugo
5 January 2019 at 09:32 #12724BineshBlockedDear @fayad
Your scene is incorrect
In instrument node you declare 3 CarvingTool and first CarvingTool is TlineModel so Carving Manager Component find Tline Model as Model Tool.
Carving Manager doesn’t support multiple tool (although i can give you our codes for multiple tools if you needed), so you must select one collision model for model toolBest,
Behnam Binesh
5 January 2019 at 10:10 #12727AnonymousInactiveI see, Then if you can give me the code for multiple models that would be great.
Thanks,
Fayad5 January 2019 at 10:53 #12728AnonymousInactiveAlso if the code is incorrect, is this the right way of doing it:
<Point name="instrument" tags="CarvingTool" contactStiffness="2" /> <Line name="instrument" contactStiffness="2" /> <Triangle name="instrument" contactStiffness="2" />
or is it this way:
<Point name="instrument" tags="CarvingTool" contactStiffness="2" />
Because both ways did not produce any cutting so I am a little bit confused, thanks :).
Best,
Fayad7 January 2019 at 23:23 #12732BineshBlockedDear @fayad
in triangle topology modifier, removing triangles due to removing isolate point and edge,
my idea is set carving model tag to triangle modelBest,
Behnam Binesh
7 January 2019 at 23:27 #12733BineshBlockedDear @fayad
i’m very busy, I will share the codes as soon as possible
I apologize for the delay
Best,Behnam Binesh
9 January 2019 at 14:29 #12744HugoKeymasterDear @secretdevil @fayad
Note that @epernod is actively working in the current version of SOFA on topological changes (also needed in Carving). You can follow pull requests over here. Stay tuned.
Hugo
13 January 2019 at 19:46 #12784AnonymousInactiveHi @Binesh,
Yes please share it as soon as you can. Thank you so much.
Fayad
6 March 2019 at 09:33 #13183AnonymousInactive8 March 2019 at 10:36 #13188epernodBlockedHi guys,
just going quickly through the scene example, I think the tag “CarvingSurface” is missing on the target collision Model.
Then the class
TopologicalChangeManager
can give you which combination of collision model can be used for carving.And yes only one collision model at a time can be used for your tool.
regards,
-
AuthorPosts
- You must be logged in to reply to this topic.