Load a graphic STL file saved in a Object in a Simulink solid block.

9 views (last 30 days)
Hi everyone!
I'm wondering if it is a possibility to use a STL file that is saved in a class instance (object) for the visualization of a solid block in Simmechanics ?
Thanks for your help.

Answers (1)

Sebastian Castro
Sebastian Castro on 2 Oct 2014
Edited: Sebastian Castro on 2 Oct 2014
Yes, you can use STL or STEP files for visualization. Note that STEP files are new in R2014a, but they give you the advantage of automatic inertia calculations (assuming uniform mass/density). With STL files, you'll have to manually enter the mass and inertia properties.
What you need to do is set the geometry to "From file" and then specify the file you want to use. Check out the image below.
Also, if you're using SolidWorks, Inventor, or PRO/ENGINEER, you can import entire CAD assemblies into SimMechanics. This is a free add-on named SimMechanics Link.
  3 Comments
Sebastian Castro
Sebastian Castro on 2 Oct 2014
Interesting... If your object contains the file name of your STL file, then this could work. Instead of browsing to the file, you can instead use a MATLAB expression like
myObject.getSTLFileName()
so long as the output of that function is a MATLAB character array.
If the STL file itself is embedded in the object, that might be pretty tricky :)
Pierrick Bersier
Pierrick Bersier on 3 Oct 2014
Yes for the moment it is what I do. I save the path name in the object and set it with set_param to Simulink. It works fine, but what I dislike is the fact that you can access to the STL directly from the windows explorer and manipulate it. So ideally I would like to save it as a properties in my object so I can set the access to it as privat.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!