Forum Replies Created
-
AuthorPosts
-
PengYuBlocked
Hi @epernod,
Thanks for your reply.
If drawing haptic force is not a good idea, can I export the haptic force into a file?
How can I make it in the .sce file?Best,
Peng YuPengYuBlockedHi, @epernod. I’m also working on Geomagic Touch. And I started with the example scenes under the `application/plugins/Geomagic/scenes/xxx.scn’.
If I want to show the interaction forces between tools controlled by the haptic device and soft body (liver). How should I do it?
I tried to add a monitor component in the ‘liver.scn’, but It doesn’t work.
Best wishes,
Peng YuPengYuBlockedHi @Hugo. Thanks for your reply.
Yes, the needle and suture can move.
However, the error keeps printing in the console which would slow down the simulation.
What’ more, I find that the BilaterialConstraints don’t work. The needle and suture can move independently as shown in the image below.Best wishes,
Peng YuPengYuBlockedHi @Hugo, it’s wired that the secen doesn’t work for me.
And the console image is as below. It seems something about MechanicalObject is wrong.
After debugging, it shows that clearingx
in CGLinearSolver (line 163, CGLinearSolver.inl) goes wrong.
After removing the FixedConstraint, the content of my scene is
<?xml version="1.0"?> <Node name="root" dt="0.01" gravity="0 0 -9.81"> <RequiredPlugin name="SofaOpenglVisual"/> <VisualStyle displayFlags="showBehaviorModels showForceFields showCollisionModels" /> <DefaultPipeline depth="6" verbose="0" draw="0" /> <BruteForceDetection name="N2" /> <MinProximityIntersection name="Proximity" alarmDistance="0.03" contactDistance="0.02" /> <DefaultContactManager name="Response" response="default" /> <FreeMotionAnimationLoop /><!-- this is necessary in BilateralInteractionConstraint--> <LCPConstraintSolver tolerance="1e-3" maxIt="1000"/> <Node name="RigidNeedle"> <EulerImplicitSolver rayleighStiffness="0.01" rayleighMass="0.1" /> <CGLinearSolver iterations="25" threshold="0.00000001" /> <MechanicalObject template="Rigid3d" translation="0 0 0" rotation="0 0 0" scale3d="3 3 3"/> <UniformMass /> <LinearSolverConstraintCorrection /> <!-- this is necessary in BilateralInteractionConstraint--> <Node name="Collision"> <MeshObjLoader name="loader" filename="mesh/needle/suture_needle.obj"/> <MeshTopology src="@loader"/> <MechanicalObject src="@loader" scale3d="1 1 1"/> <TriangleCollisionModel contactStiffness="200"/> <LineCollisionModel contactStiffness="@[-1].contactStiffness"/> <PointCollisionModel contactStiffness="@[-1].contactStiffness" /> <RigidMapping/> </Node> <Node name="Visual" tags="Visual"> <OglModel name="Visual" src="@../Collision/loader" color="gray" scale3d="1 1 1" /> <RigidMapping input="@.." output="@Visual" /> </Node> <Node name="Constraints"> <MechanicalObject name="DOFs" template="Rigid3d" position="0 0 -0.1 0 0 0 0" /> <RigidRigidMapping index="0" /> </Node> </Node> <Node name="Suture"> <EulerImplicitSolver rayleighStiffness="0" printLog="false" rayleighMass="0.1" /> <BTDLinearSolver template="BTDMatrix6d" printLog="false" verbose="false" /> <MechanicalObject template="Rigid3d" name="DOFs" position="0 0 0 0 0 0 1 1 0 0 0 0 0 1 2 0 0 0 0 0 1 3 0 0 0 0 0 1 4 0 0 0 0 0 1 5 0 0 0 0 0 1 6 0 0 0 0 0 1 7 0 0 0 0 0 1" /> <MeshTopology name="lines" lines="0 1 1 2 2 3 3 4 4 5 5 6 6 7" /> <UniformMass vertexMass="1 1 0.01 0 0 0 0.1 0 0 0 0.1" printLog="false" /> <BeamFEMForceField name="FEM" radius="0.1" youngModulus="20000000" poissonRatio="0.49"/> <LinearSolverConstraintCorrection /><!-- this is necessary in BilateralInteractionConstraint--> <Node name="Collision"> <CylinderGridTopology name="coli" nx="6" ny="6" nz="7" length="7" radius=".3" axis="1 0 0" /> <MechanicalObject /> <BeamLinearMapping isMechanical="true" /> <TriangleCollisionModel /> </Node> <Node name="Visual"> <CylinderGridTopology name="vis" nx="6" ny="6" nz="7" length="7" radius=".3" axis="1 0 0" /> <OglModel color='gray'/> <BeamLinearMapping isMechanical="false" /> </Node> </Node> <BilateralInteractionConstraint template="Rigid3d" object1="@RigidNeedle/Constraints/DOFs" object2="@Suture/DOFs" first_point="0" second_point="0" /> </Node>
PengYuBlockedHi @Hugo. Thanks for your reply.
I’ve deleted all FixedConstraint. But the same error occurs.PengYuBlockedThe path of
source file
(system/PluginManager.cp) inset_property
is not complete.
The correct method is :# D:\sofa\src\SofaKernel\modules\SofaHelper\CMakeLists.txt line 339 set_property(SOURCE ${SRC_ROOT}/system/PluginManager.cpp APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG "SOFA_LIBSUFFIX=_d" )
Then,
SOFA_LIBSUFFIX
would be defined as-d
.But what is strange is that only one plugin
CImgPlugin_d.dll
can’t be loaded. Others can be loaded without error. TheCImgPlugin_d.dll
is generated in theDebug
directory.
PengYuBlockedPengYuBlockedHi @hugo, I am really excited to receive your reply. I would appreciate that if I have an opportunity to cooperate with you about suturing simulation.
Indeed, suturing simulation is a complex project. I’ve read some related papers of Christian Duriez and Prof. Stephane Cotin. I find that the animation loop (FreeMotion Loop) was already implemented in the sofa framework. However, many critical procedures are uncovered.
1. The collision detection in sofa is not enough. The original papers discussed little this topic. I’ve implemented one kind of collision detection algorithm for suturing simulation. Maybe I can talk more details about it with you in private.
2. The constraints (contact, puncture, cutting, path, friction) involved in suturing are not defined clearly.
3. The interaction between the rigid needle and soft tissue is not the same as the interaction between the flexible suture and the soft tissue.
I would love to discuss this topic with you if you have time. Furthermore, a joint project would be great!
Best wishes.
RainVector18 May 2020 at 08:13 in reply to: Vec3d forcefield for suface mesh model with skeleton instead of Rigid3d BeamFEMF #16310PengYuBlockedI think hugo is clear about your question in his first answer.
The surface mesh is just a triangle mesh. According to this plugin, the force filed is BeamFEMForcefield for the blood vessels simulation. Thus, you don’t have to create tetrahedron mesh.PengYuBlockedHi @Sarah, thanks for your reply.
1. I can load a scene which is only defined in a python file like
houseOfCards.py
in directoryapplications/plugin/SofaPlugin/examples/
.2. I add the plugins in the warning log using
rootNode.createObject('RegquiredPlugin', pluginName='...')
, but the collision is still not work. And I want to know How can I find a detailed SofaPython API. Te functions in SofaPython plugin are not clear for me.3. What’s the entry point of python scripts? I just find some entry points in PythonScriptController components according to the documents in SofaPython directory.
Thanks again. I am new to Sofa. It often crash for no reason and generating many strange errors. Do you have some advices for learning it?
PengYuBlocked@Hugo I’m still confused about creating scene using python scripts.
I have three questions.
1. Is it necessary to create a.scn
file for each scene?
2. Do I have to setRequiredPlugin
in a.scn
file?
3. In a python scripts likehouseofcards.py
, it starts fromcreateScene(node)
other thancreateScene(sofa.PythonScriptController)
. Is it ok?According to the document, I should create a
.scn
file and usePythonScriptController
to reference the corresponding python scripts.
I still realize that.scn
file is not really necessary, for instance I can directly openhouseofCrad.py
and don’t need ahouseofCards.scn
. However, when animating the scene, the cards and floor don’t have collision detection. And I got the following warning
How can I solve this kind of problems to handle the collisions?PengYuBlocked@Hugo I’m still confused about creating scene using python scripts.
I have two questions.
1. Is it necessary to create a.scn
file for each scene?
2. Do I have to setRequiredPlugin
in a.scn
file?
3. In a python scripts likehouseofcards.py
, it starts fromcreateScene(node)
other thancreateScene(sofa.PythonScriptController)
. Is it ok?
According to the document, I should create a.scn
file and usePythonScriptController
to reference the corresponding python scripts.
I still realize that.scn
file is not really necessary, for instance I can directly openhouseofCrad.py
and don’t need ahouseofCards.scn
. However, when animating the scene, the cards and floor don’t have collision detection. And I got the following warning
How can I solve this kind of problems to handle the collisions? @Hugo I’m still confused about creating scene usin python scripts.
I have two questions.
1. Is it necessary to create a.scn
file for each scene?
2. Do I have to setRequiredPlugin
in a.scn
file?
3. In a python scripts likehouseofcards.py
, it starts fromcreateScene(node)
other thancreateScene(sofa.PythonScriptController)
. Is it ok?
According to the document, I should create a.scn
file and usePythonScriptController
to reference the corresponding python scripts.
I still realize that.scn
file is not really necessary, for instance I can directly openhouseofCrad.py
and don’t need ahouseofCards.scn
. However, when animating the scene, the cards and floor don’t have collision detection. And I got the following warning
How can I solve this kind of problems to handle the collisions? -
AuthorPosts