Forum Replies Created
-
AuthorPosts
-
NickHockBlocked
Hi @pasquale94,
That’s great to hear. Please send screen shots and videos to @hugo. He is always looking for images for the SOFA gallery. NB the SOFA GUI has options for capturing video.
Best,
NickNickHockBlockedHi @pasquale94,
Good to hear that you have it working now.
Short answer:
The domains are differentiated by keywords in their file names, defined in the .yaml file. The input files need to be .off surface meshes.Long Answer:
The way that it works is that it takes in a set of surface meshes, and uses them to define the partitioned tetrahedral mesh that it generates.
The surface meshes are divided into one group for each material. A surface mesh is identified as belonging to a particular material by the keyword at the end of its filename. e.g. “myFirstMesh_bone.ply” and “mySecondMesh_bone.ply” are both in the “bone” group. The members of each group are ‘union’ed to make a single surface mesh for each material.
These surface meshes defining each material are the subtracted from each other in order of precedence. The keywords of the materials and their order of precedence is defined in the .yaml file. The result of this step is a set of surface patch meshes that define the boundaries between each material.
The final step uses these patches to generate the partitioned tetrahedral mesh.
Note there are “mesh specification options” that define qualities of the tetrahedral mesh, including element size and facet angle. The right values depend on the scale of your input meshes, and the resolution you desire for the partitioned tetrahedral mesh.After that you need to follow the “Building a SOFA scene with a partitioned mesh:” instructions. Look at the “multi-stiffness_FEM_demo\demo.scn” file to see how the partitioned mesh is used, and don’t forget to do the “Manual editing of .vtu file xml tags 64bit -> 32bit”.
Best regards,
NickNickHockBlockedHi @pasquale94
I think the fault is here :
out_dir = output_files_dir/output_files_demo
“output_files_dir/output_files_demo”is not a directory
subdomain_meshes.begin()->mesh_vec.begin()->is_empty() = 0You need to create the directory “output_files_dir/output_files_demo”.
(This is partly because Git does not like me leaving an empty directory in the repository.)Best regards,
NickNickHockBlockedHi @pasquale94,
tree_ is internal to CGAL. The problem will be further back in the execution.
Please send me all the terminal output from where you called
Mesh_pipeline_exact_src/pipeline2 -i input_files_dir/input_files_demo/ -o output_files_dir/output_files_demo
…
The main program prints out statements as each section completes.
I need to see these and the whole stack of errors that it gives you.
Best regards,
NickNickHockBlocked@pasquale94,
It is looking for the input folder using a relative path from where “pipeline2” is run. Two ways it might not find the input folder (i) does the folder exist, (ii) is the relative path correct for where you are running the script.In the Git repository “SOFA_mesh_partitioning_tools/mesh_pipeline/input_files_dir/input_files_demo/” is already populated with the input files (identical to what would be produced by the “test_mesh_generator_python2.py” script). The instructions imply that you would be in the “SOFA_mesh_partitioning_tools/mesh_pipeline/” directory when calling “Mesh_pipeline_exact_src/pipeline2 -i input_files_dir/input_files_demo/ -o output_files_dir/output_files_demo”
Best,
NickNickHockBlockedHello @pasquale94
looking at the error messages, my first question is : do you have OpenSCAD installed ?
It is cross-platform and free-and-open-source, available here http://www.openscad.org/downloads.html .Explanation:
The python script makes calls to OpenSCAD, to generate the set of intersecting surface meshes used in the demo.Edit: I have just spotted that the file “movable_sphere2.scad” is missing from the repository. It is just the following OpenSCAD script:
module movable_sphere2()
{
translate([x,y,z])
sphere(20, $fs = 0.01);
}movable_sphere2();
Please let me know how you get on.
Best,
Nick10 March 2020 at 12:01 in reply to: Best Way to Implement Ligaments Attaching Finger Bones Together #15386NickHockBlockedHi @jayyang,
I have a full set of hand bones that I segmented from an MRI scan, and the original scans. If you contact me via email, I’ll send you a DropBox link. Using these requires an acknowledgement of the centre that took the scans for me.
Segmenting tissues takes time and practice. The ligaments are always hard to distinguish, and only the thickest ones are visible. The aponeuroses (sheet tendons) of the extensor hood are too fine to show up on MRI. You will always have to generate most ligaments from anatomical knowledge. The swept spline generator in the multi-material tools will help to generate appropriate shapes.
The Soft Robotics plugin can do many things, but requires setting up correctly to be stable. (i.e. Follow their instructions exactly and check and test each step of your install.) You should also be sure to start with simulation parameters (stiffness, damping, time step, mesh sizes etc) that are known to be stable.
You may well be able to do all that you want with just the standard Sofa Python plugin. The example .pyscn files in the multi-material-tools only use the Python plugin.
9 March 2020 at 12:14 in reply to: Best Way to Implement Ligaments Attaching Finger Bones Together #15343NickHockBlockedHello @jayyang
One option would be to use the tools-for-multi-material-simulations, on Sofa Marketplace. (Disclosure, I’m the author.)You would build a partitioned mesh for tetrahedral FEM, from the surface meshes of the bones, ligaments, tendons and muscles. The ligaments may not segment well from a CT/MRI scan. You can generate model for them using the swept spline tool. You can set the ligaments and tendons to a lower modulus than the bones. Provided there is a finite gap between the bones, then the surface mesh of the union can be used as the collision surface. You would also be able to actuate the muscles by changing their modulus with a python script controller.
The extensor tendon hood is particularly complex, as are the dermal ligaments if you are modelling the skin and subcutis. I would suggest working from a high resolution MRI scan plus specialist hand anatomy texts. You can create anisotropy by adding springs of the right orientation, to mimic collagen fibres in the layers of the tendon hood. With the exception of the synovial sheath of the flexor tendons, the soft tissues of the finger are a continuous hyper-elastic matrix, but the extreme distortion of the finite elements is likely to make even Sofa unstable. You would be more likely to achieve a stable simulation by introducing collision surfaces between the bones and the extensor tendon hood.
NickHockBlockedHi Wong @outtt,
I believe you are right. I need to check that it still compiles and runs correctly on Linux. (Today was really busy.)
Thanks,
NickNickHockBlockedHi @outtt,
I’m glad to hear your build on Windows10 went smoothly. (I only have Ubuntu, so have not had the chance to test it on other operating systems.)
After some problems posting on this forum (thank you Hugo for fixing that), I have updated the README.md file with instructions on installing the dependencies for Linux, Windows and Mac.
Best wishes,
NickNickHockBlockedHi @outtt
CGAL itself has very good documentation, with tutorials and example code for every class. These are what I learnt from while writing the Tools.
CGAL has a very particular way of working, due to being absolute precision. Be sure to read about how CGAL’s kernels work, here
CGAL tutorial_hello_world.html#intro_traitsBest wishes,
Nick
-
AuthorPosts