How to use Cartesian coordinates to create Grid Surface?
9 views (last 30 days)
Show older comments
Greetings,
I have been tasked with using Simscape Multibody to investigate contact forces between objects. One step in the Simscape process is to create a Grid Surface, as is described here: https://www.mathworks.com/help/sm/ref/gridsurface.html .
I am provided with CAD files (.stl) and have written a Matlab script that pulls in coordinate points from the STL that describe the shapes I'm interested in. It is simple enough to pull the X and Y values from the STL file and save them as vectors since Grid Surfaces require X and Y to be defined as "Coordinates in the x-direction or y-direction of the grid surface, specified as a real 1-by-m vector".
The Z values, however, are defined as "Elevations of the grid points in the grid surface, specified as a real m-by-n matrix. m and n are the lengths of the vectors for the X Grid Vector and Y Grid Vector parameters."
Does anybody have an idea of how to generate a Z-matrix given cartesian coordinates? I have manually done so with simple shapes, like a cube, but will need to eventually automate the process with a Matlab script.
Thanks
0 Comments
Answers (1)
See Also
Categories
Find more on Bodies in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!