Forum Replies Created
-
AuthorPosts
-
Hugo
KeymasterHi @faragassorobot-t-u-tokyo-ac-jp
As stated in my previous reply, most of the meshes in applications are using either patient or private data.
In the two examples you mentioned here, the data correspond to commercial products : the first reference corresponds to the Zygote dataset.
I hope this helps.
Best,Hugo
Hugo
KeymasterHi @faragassorobot-t-u-tokyo-ac-jp
And thank you for your question on the forum!
I am glad to see Bruno’s help clarified your question about the fish-eye effect.I can answer you about the question concerning the availability of models/anatomy in SOFA. The examples of medical simulations that you can see in SOFA online videos often use patient data. These data (even if anonymized) can not be provided in our open-source repository for legal reasons.
You can however find some geometry- and tool-meshes in SOFA/share/mesh. An example is provided in the simulation examples/Demos/liver.scn
I hope this helps, do not hesitate if you have any further question.
Best wishes,Hugo
Hugo
KeymasterHi @ma1991
I guess the executable runs SOFA in batch mode.
Have you made sure SOFA was correctly finding Qt5 and the associated libraries (in the CMake step) ?Best
Hugo
Hugo
KeymasterHi @amit
No problem it’s always a pleasure, but I apologize for my delay.
As you just attended the SOFA training session, I guess you have got the answer.Let me however give you some more input so that others can also benefit from your post.
The first step is to create your own plugin, as explained in the documentation and illustrated in the pluginExample.
Once your plugin created, to create a c++ class inheriting from AttachConstraint, here is an example to start from (TemplateAttachConstraint) I would use:TemplateAttachConstraint.h
/****************************************************************************** * SOFA, Simulation Open-Framework Architecture, development version * * (c) 2006-2017 INRIA, USTL, UJF, CNRS, MGH * * * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU Lesser General Public License as published by * * the Free Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * * for more details. * * * * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************* * Authors: The SOFA Team and external contributors (see Authors.txt) * * * * Contact information: contact@sofa-framework.org * ******************************************************************************/ #ifndef SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_TEMPLATEATTACHCONSTRAINT_H #define SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_TEMPLATEATTACHCONSTRAINT_H #include "config.h" #include <sofa/component/projectiveconstraintset/AttachConstraint.h> #include <sofa/defaulttype/Vec3Types.h> namespace sofa { namespace component { namespace projectiveconstraintset { template <class DataTypes> class TemplateAttachConstraint : public sofa::component::projectiveconstraintset::AttachConstraint<DataTypes> { public: SOFA_CLASS(SOFA_TEMPLATE(TemplateAttachConstraint,DataTypes),SOFA_TEMPLATE(sofa::core::behavior::AttachConstraint,DataTypes)); typedef typename DataTypes::VecCoord VecCoord; typedef typename DataTypes::VecDeriv VecDeriv; typedef typename DataTypes::Coord Coord; typedef typename DataTypes::Deriv Deriv; typedef typename DataTypes::Real Real; typedef core::objectmodel::Data<VecCoord> DataVecCoord; typedef core::objectmodel::Data<VecDeriv> DataVecDeriv; protected: TemplateAttachConstraint(core::behavior::MechanicalState<DataTypes> *mm1, core::behavior::MechanicalState<DataTypes> *mm2); TemplateAttachConstraint(); virtual ~TemplateAttachConstraint(); public: // -- Constraint interface void init() override {}; void projectJacobianMatrix(const core::MechanicalParams* /*mparams*/ /* PARAMS FIRST */, core::MultiMatrixDerivId /*cId*/) override {}; void projectResponse(const core::MechanicalParams *mparams, DataVecDeriv& dx1, DataVecDeriv& dx2) override {}; void projectVelocity(const core::MechanicalParams *mparams, DataVecDeriv& v1, DataVecDeriv& v2) override {}; void projectPosition(const core::MechanicalParams *mparams, DataVecCoord& x1, DataVecCoord& x2) override {}; /// Project the global Mechanical Matrix to constrained space using offset parameter void applyConstraint(const core::MechanicalParams *mparams, const sofa::core::behavior::MultiMatrixAccessor* matrix) override {}; /// Project the global Mechanical Vector to constrained space using offset parameter void applyConstraint(const core::MechanicalParams *mparams, defaulttype::BaseVector* vector, const sofa::core::behavior::MultiMatrixAccessor* matrix) override {}; /// Define your internal functions and data }; #if defined(SOFA_EXTERN_TEMPLATE) && !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_TEMPLATEATTACHCONSTRAINT_CPP) extern template class SOFA_GENERAL_OBJECT_INTERACTION_API TemplateAttachConstraint<defaulttype::Vec3Types>; extern template class SOFA_GENERAL_OBJECT_INTERACTION_API TemplateAttachConstraint<defaulttype::Vec2Types>; extern template class SOFA_GENERAL_OBJECT_INTERACTION_API TemplateAttachConstraint<defaulttype::Vec1Types>; #endif } // namespace projectiveconstraintset } // namespace component } // namespace sofa #endif
TemplateAttachConstraint.inl
/****************************************************************************** * SOFA, Simulation Open-Framework Architecture, development version * * (c) 2006-2017 INRIA, USTL, UJF, CNRS, MGH * * * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU Lesser General Public License as published by * * the Free Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * * for more details. * * * * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************* * Authors: The SOFA Team and external contributors (see Authors.txt) * * * * Contact information: contact@sofa-framework.org * ******************************************************************************/ #ifndef SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_TEMPLATEATTACHCONSTRAINT_INL #define SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_TEMPLATEATTACHCONSTRAINT_INL #include <SofaGeneralObjectInteraction/TemplateAttachConstraint.h> namespace sofa { namespace component { namespace projectiveconstraintset { template <class DataTypes> AttachConstraint<DataTypes>::AttachConstraint() : // INIT your data here { } template <class DataTypes> AttachConstraint<DataTypes>::AttachConstraint(core::behavior::MechanicalState<DataTypes> *mm1, core::behavior::MechanicalState<DataTypes> *mm2) : core::behavior::PairInteractionProjectiveConstraintSet<DataTypes>(mm1,mm2) , // INIT your data here { } template <class DataTypes> void AttachConstraint<DataTypes>::init() { // To implement } template<class DataTypes> void AttachConstraint<DataTypes>::projectJacobianMatrix(const core::MechanicalParams* /*mparams*/ /* PARAMS FIRST */, core::MultiMatrixDerivId /*cId*/) { // To implement } template <class DataTypes> void AttachConstraint<DataTypes>::projectPosition(const core::MechanicalParams * /*mparams*/, DataVecCoord& res1_d, DataVecCoord& res2_d) { // To implement } template <class DataTypes> void AttachConstraint<DataTypes>::projectVelocity(const core::MechanicalParams * /*mparams*/, DataVecDeriv& res1_d, DataVecDeriv& res2_d) { // To implement } template <class DataTypes> void AttachConstraint<DataTypes>::projectResponse(const core::MechanicalParams * /*mparams*/, DataVecDeriv& res1_d, DataVecDeriv& res2_d) { // To implement } // Matrix Integration interface template <class DataTypes> void AttachConstraint<DataTypes>::applyConstraint(const core::MechanicalParams * /*mparams*/, const sofa::core::behavior::MultiMatrixAccessor* matrix) { // To implement } template <class DataTypes> void AttachConstraint<DataTypes>::applyConstraint(const core::MechanicalParams * /*mparams*/, defaulttype::BaseVector* vect, const sofa::core::behavior::MultiMatrixAccessor* matrix) { // To implement } } } // namespace constraint } // namespace component } // namespace sofa #endif
TemplateAttachConstraint.cpp
/****************************************************************************** * SOFA, Simulation Open-Framework Architecture, development version * * (c) 2006-2017 INRIA, USTL, UJF, CNRS, MGH * * * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU Lesser General Public License as published by * * the Free Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * * for more details. * * * * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************* * Authors: The SOFA Team and external contributors (see Authors.txt) * * * * Contact information: contact@sofa-framework.org * ******************************************************************************/ #define SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_TEMPLATEATTACHCONSTRAINT_CPP #include "TemplateAttachConstraint.inl" #include <sofa/core/ObjectFactory.h> #include <sofa/defaulttype/VecTypes.h> namespace sofa { namespace component { namespace projectiveconstraintset { using namespace sofa::defaulttype; int TemplateAttachConstraintClass = core::RegisterObject("A specific constraint inheriting from AttachConstraint") .add< TemplateAttachConstraint<Vec3Types> >(); .add< TemplateAttachConstraint<Vec2Types> >(); .add< TemplateAttachConstraint<Vec1Types> >(); template class TemplateAttachConstraint<Vec3Types>; template class TemplateAttachConstraint<Vec2Types>; template class TemplateAttachConstraint<Vec1Types>; } // namespace projectiveconstraintset } // namespace component } // namespace sofa
NB: this kind of dev question is more dedicated on the Dev part of the forum.
Hope this helps, do not hesitate to close the topic if this explanation is fine for you.
Best,Hugo
19 May 2019 at 17:02 in reply to: [SOLVED] Compilation error while setValue to d_force in linearFF #13519Hugo
KeymasterThank you for sharing your solution and closing your issue.
Best,Hugo
Hugo
KeymasterHi @bence
Thank you for your interest in SOFA and in the SoftRobot plugin from the Defrost team.
Let me contact the devs in charge of the SoftPlugin and associated binaries.Best
Hugo
Hugo
Keymasteryou are very welcome @minj
Do not hesitate to close the topic if it is solved.
BestHugo
12 May 2019 at 18:33 in reply to: [SOLVED] How to export .OBJ files at specified time steps, before ending the animation? #13474Hugo
KeymasterHi @zahra
Actually the right way to write it is as follows:
<Node name="Visu" tags="Visual" gravity="0 -9.81 0"> <MeshObjLoader name="VisualLoader" filename="mesh/liver-smooth.obj" /> <OglModel name="VisualModel" src="@VisualLoader" /> <BarycentricMapping name="visual mapping" input="@../dofs" output="@VisualModel" /> <MeshExporter filename="testMyAwesomeExport" position="@VisualModel.position" edges="@VisualModel.edges" triangles="@VisualModel.triangles" exportEveryNumberOfSteps="1" format="gmsh"/> </Node>
and there, you can actually replace the
MeshObjLoader
with any other loader format (MeshGmshLoader
for instance) as long as they include a surface mesh topology.Best
Hugo
Hugo
KeymasterHi @minj Hi Noura !
Since I was already preparing some files for you Minj I am posting them.
Find here an example with a deformable liver on which we apply a constant force and this constant force is applied on a random point of the mesh.The scene :
<Node name="root" dt="0.05" gravity="0 -9.81 0"> <!-- Constant force for a deformable --> <VisualStyle displayFlags="showBehaviorModels showForceFields" /> <PythonScriptController name="randomForce" filename="randomForce.py" classname="randomize" listening="1"/> <MeshObjLoader name="VisualLoader" filename="mesh/liver-smooth.obj" /> <MeshGmshLoader name="MecaLoader" filename="mesh/liver.msh" /> <Node name="Liver" > <EulerImplicitSolver name="cg_odesolver" rayleighStiffness="0.1" rayleighMass="0.1" /> <CGLinearSolver name="linear solver" iterations="25" tolerance="1e-09" threshold="1e-09" /> <TetrahedronSetTopologyContainer name="topo" src="@../MecaLoader" /> <MechanicalObject name="dofs" src="@../MecaLoader" /> <TetrahedronSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" /> <DiagonalMass name="computed using mass density" massDensity="1" /> <TetrahedralCorotationalFEMForceField template="Vec3d" name="FEM" method="large" poissonRatio="0.3" youngModulus="3000" computeGlobalMatrix="0" /> <FixedConstraint name="FixedConstraint" indices="3 39 64" /> <ConstantForceField name="CFF" indices="14" forces="0 -10 0" /> <Node name="Visu" tags="Visual" gravity="0 -9.81 0"> <OglModel name="VisualModel" src="@../../VisualLoader" /> <BarycentricMapping name="visual mapping" input="@../dofs" output="@VisualModel" /> </Node> </Node> </Node>
The python script (randomForce.py):
import Sofa import sys import random class randomize(Sofa.PythonScriptController): # optionnally, script can create a graph... def initGraph(self,node): self.nodeLiver = node.getChild('Liver') self.activeRandomize=0 #save a pointer to the ConstantForceField self.RandomForce = self.nodeLiver.getObject('CFF') return 0 def bwdInitGraph(self,node): #count the number of points self.nbPoints = self.nodeLiver.getObject('dofs').findData("size").value print "nbPoints = "+str(self.nbPoints) return 0 def onBeginAnimationStep(self,dt): # if active, randomly change the indice on which the force is applied if self.activeRandomize==1 : newIndice = random.randint(1,self.nbPoints) self.nodeLiver.getObject('CFF').findData("indices").value = newIndice print "Randomizing force on point = "+str(newIndice) return 0 def onKeyPressed(self, c): if c=="L" : if self.activeRandomize==1 : self.activeRandomize=0 print "Randomizing inactive" else: self.activeRandomize=1 print "Randomizing active" return 0;
I hope this helps.
BestHugo
Hugo
KeymasterHi Wendy
I will discuss this in the coming days with the “topology” guys, and get back to you.
Best,Hugo
Hugo
KeymasterHi @amit
Please find documentation about creation of plugins, and components online.
You can also have a look to our template plugin: MyAwesomeComponents
Let me know if it helps.
BestHugo
Hugo
KeymasterHi @zahra
FixedConstraint are projective constraints and do not require a constraint resolution through Lagrange multipliers. Therefore, if it is the only constraint, you don’t need a FreeAnimationLoop, GenericConstraintSolver nor a ConstraintCorrection.
But I need to check if friction can still be computed this way.Indeed, documentation is still missing on uni/bilateralconstraints (it’s almost the last pages to do!). I will work on it as soon as I can.
Best
Hugo
8 May 2019 at 18:38 in reply to: [SOLVED] How to export .OBJ files at specified time steps, before ending the animation? #13463Hugo
KeymasterHi @zahra
Yes you can indeed a way to solve your issue and fo what you described. You can add the MeshExporter in the visual node and specify the data field (position, edges, triangles) you want to export.
Here is an example :
<Node name="Visu" tags="Visual" gravity="0 -9.81 0"> <OglModel name="VisualModel" fileMesh="mesh/liver-smooth.obj" /> <BarycentricMapping name="visual mapping" input="@../dofs" output="@VisualModel" /> <MeshExporter filename="testMyAwesomeExport" position="@VisualModel.position" edges="@VisualModel.edges" triangles="@VisualModel.triangles" exportEveryNumberOfSteps="1" format="gmsh"/> </Node>
Best
Hugo
Hugo
KeymasterHi Christoph
I just tested the scene, it’s nice simulation that you got there! Congratulations!
You can try the advise mentioned (like indeed hyperelasticity and Mass) above to improve the simulation.
A finer mesh (for the ball) might also be necessary to better capture oscillations of the ball.I forgot to mention, that using a non-diagonal mass (MeshMatrixMass, improving accuracy on the mass integration) might make the pre-computation of the PrecomputedConstraintCorrection. In this case, you can go for an UncoupledConstraintCorrection. This UncoupledConstraintCorrection needs a compliance (data) to be set. You can choose compliance equals to the 1/vertexMass (vertexMass info in MeshMatrixMass).
See the difference between ConstraintCorrection in the online doc.Best,
Hugo
Hugo
KeymasterBelow you can find a working case.
But before I have some questions:
– there is no constraints in your scene (no collision, uni/bilateralconstraints), do you intend to add it later ? If no, the use of the GenericConstraintSolver is not required
– the TopologicalMapping does not handle a MechanicalObject in the child (triangular) nodeMy version:
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Jan 23 13:13:55 2019 @author: zahra """ import Sofa def createScene(rootNode): rootNode.createObject('RequiredPlugin', name='SofaPython') rootNode.createObject('VisualStyle', displayFlags='showForceFields hideVisual') rootNode.createObject('DefaultPipeline', name='CollisionPipeline', verbose='0') rootNode.createObject('BruteForceDetection', name='N2') rootNode.createObject('FreeMotionAnimationLoop') rootNode.createObject('DefaultContactManager', response='FrictionContact', responseParams='mu=0.9') rootNode.createObject('DiscreteIntersection', name='discreteIntersection1') rootNode.createObject('GenericConstraintSolver', maxIt='10000', tolerance='1e-7') # rootNode/Liver Liver = rootNode.createChild('Liver') Liver.depend = 'topo dofs' Liver.createObject('EulerImplicitSolver', name='cg_odesolver', printLog='0') Liver.createObject('CGLinearSolver', threshold='1e-09', tolerance='1e-09', name='linear solver', iterations='25', template='GraphScattered') Liver.createObject('MeshGmshLoader', tetrahedraGroups=' -1 0 38144', name='loader', filename='mesh/livertetra7509.msh') Liver.createObject('TetrahedronSetTopologyContainer', triangles='@loader.triangles', position='@loader.position', edges='@loader.edges', name='topo', tetrahedra='@loader.tetras') Liver.createObject('MechanicalObject', force='0 0 0', name='dofs', template='Vec3d', position='@loader.position', velocity='0 0 0', externalForce='0 0 0', restScale='1') Liver.createObject('UncoupledConstraintCorrection') Liver.createObject('TetrahedronSetGeometryAlgorithms', drawColorEdges='0.4 1 0.298039 1', showIndicesScale='0.01', name='GeomAlgo', showPointIndices='0', template='Vec3d') Liver.createObject('DiagonalMass', massDensity='1', name='computed using mass density', template='Vec3d') Liver.createObject('TetrahedralCorotationalFEMForceField', poissonRatio='0.4', name='FEM', computeGlobalMatrix='0', method='large', template='Vec3d', youngModulus='120') Liver.createObject('PlaneForceField', name='planeFF0', template='Vec3d', normal='0 1 0', stiffness='10000',draw='1', drawSize='8') Liver.createObject('ConstantForceField', indices='27', name='constantFF0', template='Vec3d', forces='0 0 0') Liver.createObject('TetrahedronSetTopologyModifier', name='tetrahedronSetTopologyModifier9') Liver.createObject('TetrahedronSetTopologyAlgorithms', name='tetrahedronSetTopologyAlgorithms10', template='Vec3d') # rootNode/Liver/surface_fine surface_fine = Liver.createChild('surface_fine') surface_fine.createObject('TriangleSetTopologyContainer', name='triangleSetTopologyContainer0') surface_fine.createObject('TriangleSetTopologyModifier', name='triangleSetTopologyModifier1') surface_fine.createObject('TriangleSetTopologyAlgorithms', name='triangleSetTopologyAlgorithms2', template='Vec3d') surface_fine.createObject('TriangleSetGeometryAlgorithms', name='triangleSetGeometryAlgorithms3', template='Vec3d') # surface_fine.createObject('MechanicalObject', force='0 0 0', name='dofs2', template='Vec3d', position='@./', velocity='0 0 0', externalForce='0 0 0', restScale='1') surface_fine.createObject('Tetra2TriangleTopologicalMapping', input='@../', name='tetra2TriangleTopologicalMapping4', output='@triangleSetTopologyContainer0') surface_fine.createObject('TriangularFEMForceField', name='triangularFEMFF5', template='Vec3d', poissonRatio='0.4', youngModulus='120') # surface_fine.createObject('TriangularBendingSprings', name='triangularBendingSprings6', template='Vec3d') surface_fine.createObject('TTriangleModel', name='tTriangleModel15', template='Vec3d') # surface_fine.createObject('TrianglePressureForceField', name='trianglePressureFF22', template='Vec3d') # surface_fine.createObject('UncoupledConstraintCorrection') # surface_fine.createObject('MeshExporter', exportEveryNumberOfSteps='0', quads='0', name='meshExporter0', format='gmsh', exportAtEnd='1', filename='L1s_sofa', exportAtBegin='0', tetras='0', hexas='0', edges='0', triangles='1', listening='0') # rootNode/Liver/surface_fine/visu_surface_fine visu_surface_fine = surface_fine.createChild('visu_surface_fine') visu_surface_fine.createObject('OglModel', sfactor='GL_SRC_ALPHA', blendEquation='GL_FUNC_ADD', name='oglModel18', template='ExtVec3d', dfactor='GL_ONE_MINUS_SRC_ALPHA', material='Default Diffuse 1 0.74902 0.74902 0.74902 1 Ambient 1 0.592157 0.2 0.2 1 Specular 0 1 1 1 1 Emissive 0 0 0 0 0 Shininess 0 45 ', primitiveType='DEFAULT') visu_surface_fine.createObject('IdentityMapping', input='@../', name='identityMap20', template='Vec3d,ExtVec3d', output='@./') Liver.createObject('ClipPlane', name='clipplane', normal='1 0 0') return 0;
Best
Hugo
4 May 2019 at 07:52 in reply to: [SOLVED] How to export .OBJ files at specified time steps, before ending the animation? #13455Hugo
KeymasterHi Zahra
I have not used the OBJExporter which is an old component exporting not only one but all visual models available. It would need a lot of reformatting and cleaning.
A trick for you would be to mimic a key pressed (pressing ctrl+p seems to trigger an export). you could do this when the export is needed.
See python example hereLet me know if this helps.
BestHugo
Hugo
KeymasterDear @amit
Thank you for your feedback.
Unfortunately, for now, it is required to do it manually: first compute the pairing, save it and provide the full spring information.
But your remark is correct, it should be made simpler and more easy to set for the user.For visualization, you can activate the visual option for forcefields:
<VisualStyle displayFlags="showForceFields" />
Best wishes,
Hugo
Hugo
KeymasterHi Christoph
Unfortunately without the mesh files it will be complicated for us to test.
Let us know if you are willing to share it.Modeling a deformable ball falling on a floor is a good first simulation testcase. As you noticed, even if the testcase seems simple, all numerical parameters must be carefully defined and not randomly chosen.
- using litterature value (with coherency to your mesh units) is right
- Rayleigh damping should be used carefully (by default use 0) since it adds numerical damping to your simulation without physical meaning. Too high damping would lead to an excessively-damped system and will prevent you from a accurate solution
- your time step must be also well-chosen to capture the physics. Note that the element size influences the limit time step possible. A simple but empiric method to select your time step is too choose a very (very) small time step and try to increase it while you get the same result.
- depending on the complexity of your physics and the refinement of your mesh, it might not always be possible to achieve interactive/real-time simulations.
- in simulations (like yours) based on Lagrange multiplier resolution, contactStiffness is actually not used: you perfectly understood the way constraints were solved !
- note that the Mass you are using is simplistic (see details about UniformMass here), I’d rather advise to go for a DiagonalMass or better (but more computationnally demanding) MeshMatrixMass
- finally, getting a “realistic” gelatin simulation, requires to have a realistic gelatin model. The TetrahedronFEMForceField is an FEM-based implementation of a linear elastic material. The deformation will remain elastic and it might be complicated to replicate a gelatin like motion. But this model is good to start. Later you could use more advanced models (like Hyperelastic ones).
I hope this helps.
BestHugo
PS: for meshes, you can include a html link towards a Drive or other file transfer tools
Hugo
KeymasterHugo
KeymasterHi Fayad
Sorry the weeks are busy.
I will try to get a Geomagic this week and test it. BestHugo
28 April 2019 at 18:38 in reply to: [SOLVED] How to export .OBJ files at specified time steps, before ending the animation? #13438Hugo
KeymasterHi @zahra
Just to save us some time, could you explain why you need this controller, what it is meant to do?
ThanksHugo
28 April 2019 at 18:35 in reply to: [SOLVED] How to close the runSofa window/reinitialize it in python? #13437Hugo
KeymasterHugo
KeymasterHi @amit
Indeed a simplistic tearing could be done as described above for Wendy’s project.
To do so, a SpringForceField could be setup between the two meshes (liver and gallblader). Using Python, if the elongation of springs exceeds a threshold, you could access and modify (set to zero) the stiffness of these springs. This would mimic a tearing effect.
If you don’t feel able to to this yourself, let me know we can assist you in this. A short training session could make it possible.Otherwise, some developers of the community (Erik) are currently working on the implementation of a robust volumetric cutting in SOFA.
Best wishes,
28 April 2019 at 18:34 in reply to: [SOLVED] How to save the topology of component SparseGridRamification? #13434Hugo
KeymasterDear @outtt
For others, I give the hint:
all you need to do is to add a MeshVTKExporter with the option
exportAtBegin="true"
so that your mesh can be exported after initialization (including the initialization of the sparse grid).
You can find an example in examples/Components/misc/VTKExporter.scnOnce exported, you could change your scene file and load directly the VTK file using a MeshVTKLoader and providing the
filename
data (where your mesh is located)Best
Hugo
-
AuthorPosts