SGofCPLflat(CPL,[T])
CPL : | Closed Polygon or Polyshape | |
T : | vector, rotation matrix, or HT matrix to locate the surface in space |
SGofCPLflat(PLstar(30),[0 0 10])
SGofCPLflat(PLsquare(30),rot(pi/3))
SGofCPLflat(PLsquare(30),rot(pi/3,-pi/3,-pi/3))
SGofCPLflat(CPLsample(12),rot(pi/3,-pi/3,-pi/3))
This function, SGofCPLflat
, generates a surface geometry (SG) structure from a closed polygon or polyshape. It is designed to create a flat surface representation of the polygon in space, rather than a solid, watertight geometry.
T
from the variable input arguments using getfuncparams
. If T
is not provided, it defaults to an empty array.CPL
is not numeric, it is converted to a closed polygon list using CPLofCPS
.PLFLofCPLdelaunay
is called to generate a point list (PL
) and a face list (FL
) from the closed polygon.VL
) is created by adding a z-coordinate to the point list using VLaddz
.SG
is initialized with the vertex list and face list.T
is provided, it is applied to the surface geometry using SGtrans
.SGfigure
and SGplot
, setting the view and lighting for better visualization.SGofCPLflat(PLstar(30),[0 0 10])
: Creates a surface from a star-shaped polygon and positions it at z=10.SGofCPLflat(PLsquare(30),rot(pi/3))
: Creates a surface from a square polygon and rotates it by pi/3 radians.SGofCPLflat(PLsquare(30),rot(pi/3,-pi/3,-pi/3))
: Creates a surface from a square polygon and applies a 3D rotation.SGofCPLflat(CPLsample(12),rot(pi/3,-pi/3,-pi/3))
: Creates a surface from a sample polygon and applies a 3D rotation.