SG=SGofCPLrot(CPL,[n,rcorr])
CPL : | Radius-Z List | |
n : | optional number of edges of the rotated polygon | |
rcorr : | true = increase that R is on circle; default R is incircle |
SG : | Solid Geometry (SG.VL, SG.FL, SG.CPL) |
CPL=[0 0; 20 0; 20 10; 0 10; NaN NaN; 1 1; 9 1; 9 9; 1 9; NaN NaN; 2 2; 8 2; 8 8; 2 8 ];
CPL(:,1)=CPL(:,1)+5
CPL=PLcircle(10);
CPL=[0 10; 2 8; 0 5; 0 4; 4 1; 0 0];
A=SGofCPLrot (CPL); SGchecker(A);
VLFLviewer(A); VLFLplotlight (1,0.5), view(-30,30);
figure(2); PLELofCPL(A.CPL);
This function, SGofCPLrot
, generates a solid geometry by rotating a closed polygon list (CPL) around the z-axis. It is part of the SG-Library and was developed by Tim Lueth. The function is designed to facilitate the modeling of 3D objects from 2D profiles.
The function begins by calling VLFLofCPLrot
with the provided CPL and any additional parameters. This internal function handles the core computation of generating the vertex and face lists for the solid geometry.
If no output is requested (i.e., nargout==0
), the function automatically visualizes the generated solid geometry using SGfigure
and sets the view to a specific angle (-30, 30).
An example is provided in the comments, demonstrating how to create a CPL, adjust it, and then generate and visualize the solid geometry using SGofCPLrot
. The example also shows how to use other related functions like SGchecker
, VLFLviewer
, and VLFLplotlight
to further manipulate and view the geometry.