SimMechanics. Import. Solid properties. Simulink

1 view (last 30 days)
When I import in SimMechanics an assemble (for example from SolidWorks), I need to use some properties (like length, heigth, width and etc.) in other Simulink blocks. In solid properties there aren't any usefull information, only:
Shape : From file
File type : STL
File name : nameofpart
Units : mm
How can I take the information I need (length, heigth, width and etc.)?

Accepted Answer

Sebastian Castro
Sebastian Castro on 24 Jun 2015
Edited: Sebastian Castro on 24 Jun 2015
For each rigid part in SolidWorks, SimMechanics Link generates an STL file. You also get an XML file which says how the STL files are connected together (rigid transforms/joints) and what the properties (color, mass, etc.) are.
So, that file name in the Solid block, nameofpart.STL, contains all the points and connections that make up the shape of your object.
It's unfortunately not as easy as "length, width, and height" since the STL mesh can represent much more complicated shapes. I suppose, for a rough estimate, you could -- for example -- find the minimum and maximum X coordinates of all the vertices in that file and call that the "length".
- Sebastian

More Answers (0)

Community Treasure Hunt

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

Start Hunting!