- This topic has 2 replies, 2 voices, and was last updated 7 years, 3 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Using SOFA › [SOLVED] Reading indices of FixedConstraint from an ascii file
Tagged: 64_bits, Linux_ubuntu, SOFA_1608
Hello,
Is there a way to pass the indices of a “FixedConstraint” from an ascii file through the scene xml file directly?
In case this is possible, could you specify the format to use (csv, txt, the delimitor, etc.)?
I’m expecting something like this
indices= "@indices_file"
instead of
indices= "id_1 id_2 id_3 .. id_n"
Thanks,
Noura
Hi Noura,
A very simple way of doing what you want is to :
– create an obj file (let’s call it “file.obj”) with your ids like:
v id_1
v id_2
..
v id_n
– then, load the above-created obj files with a MeshObjLoader and give it to the FixedConstraint as follows:
<MeshObjLoader name="IDLoader" filename="file.obj" />
...
<FixedConstraint name="myConstraint" indices="@IDLoader.position" />
HTH
Cheers,
Hugo
It works fine, and makes the scene content more compact.
Thanks Hugo!
Noura
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.