How can I view the convex hull geometry exported from a file solid block in simscape multibody?

12 views (last 30 days)
I'm attempting to model the contact between the landing leg of a launch vehicle using the spatial contact force block in simscape multibody.
The geometry of the landing leg is stored in a .STEP file and I can successfully run the simulation with the contact when exporting the geometry in simscape using the convex hull option.
However, I was wondering if it's possible to view the convex hull geometry that is created in simulink as I'm not sure what this looks like and if it will be suitable for use in my model or whether I should just implement the use of spheres at the ends of the legs to model the contact. Is there a way to view the export output from the solid block that then leads into the contact force? Or, alternatively, can I import a .STEP file (or perhaps convert it first as it's not in x,y,z coordinate format) into MATLAB and calculate the convex hull using 'convhull'?
Any help would be much appreciated.
Many thanks,
Will

Answers (1)

Yifeng Tang
Yifeng Tang on 29 Apr 2021
If you have a way to convert the STEP file into STL, I know of a way to do this outside Multibody using MATLAB command convhull that you suggested.
Here is an short example:
pts = stlread('Bar1_Default_sldprt.STL'); % load STL
figure(1); clf; % check the points in 3D
plot3(pts.Points(:,1),pts.Points(:,2),pts.Points(:,3),'.');
[k2,av2] = convhull(pts.Points(:,1),pts.Points(:,2),pts.Points(:,3)); % build convex hull
figure(2); clf; % visualize convex hull
trisurf(k2,pts.Points(:,1),pts.Points(:,2),pts.Points(:,3));
The STL file used is part of the shipping demo: sm_import_four_bar

Community Treasure Hunt

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

Start Hunting!