by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 5.4, Creation date: 2024-07-28, Last change: 2025-09-15
See Also: PLknurled
, PLcircle
, PLcircseg
, PLevolvente
, PLgearDIN
, PLkidney
, PLrand
, PLspiral
, PLsquare
PL=PLdiamond([dim,al])
dim: | [width height] or CPL | |
al: | angle, currently unsused, i.e. 45 deg |
PL: | CPL of a diamond in dim or that is a hull for the CPL |
PLdiamond([10 20]) % PLdiamond with size dimension
PLdiamond(PLstar(8)) % PLdiamond with a shape
The function PLdiamond generates a diamond shape, optionally as a convex hull for a Closed Polygon List (CPL). It is part of the SolidGeometry library.
dim parameter using getfuncparams, defaulting to [6 10] if not provided.al parameter using getfuncparams, defaulting to 60 degrees in radians.CPL as an empty array and r as 0.dim has more than one row, treat it as a CPL:
r using rofcirclearoundCPL.r4 as four times r using dofn(4).dim to [2*r4 2*r4].dim by 2 to get half-dimensions.PL using the half-dimensions:
nargout==0):
SGfigure to set up the figure.CPL is not empty, plot it using CPSplot.PL using CPLplot.r is greater than 0, plot a circle with radius r using CPSplot and PLcircle.