It looks like it, but still hard to say. This remains a rather obscure part of sofa that could use some light 😉
Unfortunately this is not possible with the
LinearForceFieldcomponent. I’m not sure if there is another component that would do that. If you are comfortable enough with c++, you could try to extend the
LinearForceFieldclass to add this feature.
Otherwise, I would suggest to look at python scenes, you can have a look at the…[Read more]
You can look at the
LinearForceFieldcomponent. If “Volume” is the name of your
MechanicalObject, you could write:
<LinearForceField points="@Volume.indices" forces="0 -1 0 0 -5 0 0 -10 0" times="0 10 20" />
This will set the forces to (0,-1,0) at time 0, (0, -5, 0) at time 10 and (0, -10, 0) at time 20. Between those times,…[Read more]
It seems the Sofa’s include directory was not added to your project compilation.
Are you using CMake to configure your plugin compilation? If that’s the case, then you should have somewhere in your CMakeLists.txt file:
That should automatically add the sofa’s…[Read more]
It seems the merge function is only used by
MergeVectors<VecT>::update()(SofaGeneralEngine/MergeVectors.inl). In this case, the
Data<T>& outvariable you see will be of type
Data<VecT>. So, when expending the templates, the
out.push_backis in fact calling
VecT.push_back()since the WriteOnlyAccessor is creating a bridge between
Just to add a little bit to Vincent’s answer.
BaseClass::decodeTemplateNamewill use the abi to demangle the type name of your class and then parse what is between the first ‘<‘ and the last ‘>’. The type name of your class’s template is obtained through the
std::string::Name()function which you will need to define.
If you want to assign
I just want to add that, as Hugo said, I think the best way would be to use two
MechanicalObject, one with the reduced space and one with the full DOFs, instead of subclassing directly the
MechanicalObjectclass. In this case, you would only need to create a forcefield component in your code, and use mapping between the two default…[Read more]
This is a good question and I think it would be a good idea to document it a little bit more since it is not that trivial to see it in the sofa’s code.
I’ve just had a quick look up and here is what I think is going on.
First, in one of the cpp file of your plugin’s code, you should have registered your object by calling
Is there a reason why you call the
MeshSTLLoader::loadfunction on each call to
Looking at the
MeshSTLLoader::loadfunction, we can see that the vertices, normals and triangles are appended at the end of the internal data container. That means that each time you call the
loadfunction, it re-parse your entire mesh…[Read more]
I believe that in order to be used by a linked relationship, the object linked must inherit the
Baseclass, which isn’t the case with a
Also, note that in your scene node, you do not have any
sofa::helper::io::Mesh. You do have a
sofa::component::loader::MeshSTLLoaderwhich is named “loader” and a
I would advise not to use the
handletopologychangefunction since it is marked as deprecated and could be removed eventually.
Developer edition should not be a problem, the warning is only there to remind you that you cannot distribute your software in a commercial manner.
When you launch the Geomagic diagnostic tool, you can see the device move and correctly calibrate it?
Also, in the scene file, can you try with a completely random device name, just to…[Read more]
Try with the scene file “applications/plugins/Geomagic/scenes/Geomagic-FEMLiver.scn”.
Make sure the
deviceNamematch the name of your device (as shown in the Geomagic diagnostic tool).
<GeomagicDriver name="GeomagicDevice" deviceName="Default Device" scale="1" drawDeviceFrame="1" positionBase="0 0 0" orientationBase="0 0.707 0 -0.707" />
Did you make sure you set the good device name in your scene file? It should match the one shown in the Geomagic diagnostic tool.
Since you can see that the plugin is fully loaded in SOFA, the problem is probably elsewhere. Can you paste here the output of SOFA?
– And i can also increase to more vertices,right?
– Now I want to extract the whole edge of the liver as the constraint
You can use the BoxROI component :
<BoxROI name="fixed_indices" box="2 4.7 -2 -4 5 2" drawBoxes="1"/>
<FixedConstraint name="FixedConstraint" indices="@fixed_indices.indices" />
In SOFA, check the Behavior…[Read more]
I’m not quite sure what you are asking here. Since you are in the “Using SOFA” subforum, I’m guessing that you want to get the indices of the FixedConstraint component linked in another component directly in the scene file? Something like this:
<FixedConstraint name=”FixedConstraint” indices=”3 39 64″ />[Read more]
The proper way to do it would probably be by creating your own topological engine that would create an unique index for each tetra and receive topological change events from the mesh topology.
Here is an example of a simple component that create an unique id for each tetra and then print out the unique id of a tetra when it is…[Read more]
I will make a long shot guess here, but since you are using a dynamic simulation scheme (time integration), by only setting the position of your new vertex, you could be experiencing the consequence of a huge jump in velocity.
I can see two ways of testing this:
1. Manually set the velocity of your new vertex with the value of a nearby point.
There is a tetra collision model implemented in Sofa but it seems it can only collide with ray and point models:
TetrahedronDiscreteIntersection::TetrahedronDiscreteIntersection(DiscreteIntersection* object)[Read more]
To me, all those link errors related to std::string& arguments make me think of an c++ ABI version mismatch (see here for more details).
Can you try with a more recent compiler? (GCC 5.3+ or LLVM/clang 3.7+)
If this doesn’t work, you could play with the “_GLIBCXX_USE_CXX11_ABI” macro by setting it to 1 or 0.
With CMake, you can do…[Read more]
- Load More