I am new to MATLAB. I want to find the equations of a set of planes that are part of a convex hull that I calculated using convhulln
. It is a convex polyhedron. I tried to search quite a bit but couldn't find anything. Any help is appreciated.
Here's a set of points that I find the convex hull of. The code is not in MATLAB but can be understood easily. All points are 3D points.
pts = {{-0.00033004023134713956, 0, 0},{-0.00033004023134713956, -0.001, 0},
{0.00033004023134713956, -0.001, 0},{0.00033004023134713956, -0.00033004023134713956, 0},
{0,0,0},{-0.00033004023134713956, 0.001, -0.00033004023134713956},{0.00033004023134713956,
0.001, 0.00033004023134713956},{0.00033004023134713956, 0, 0.00033004023134713956},
{-0.00033004023134713956, 0.00033004023134713956, -0.00033004023134713956},{0,0,0},
{-0.00033004023134713956, 0, 0},{-0.00033004023134713956, 0.00033004023134713956,
-0.00033004023134713956},{0,0,0},{0.00033004023134713956, 0, 0.00033004023134713956},
{0.00033004023134713956, -0.00033004023134713956, 0},{0,0,0}};
first you need to convert your data to a N-by-3 numerical array:
(numerical arrays are defined with brackets, use semicolon to separate rows)
Then you can call the convhulln function
The result is a NF-by-3 array containing indices of polyhedron faces. To get the origin and the direction vectors of plane containing the first face, you can process as is: