const
function: Path segment (unsigned int factor, [real angle = 0, [bool closed = true
]])Returns a
Path
representing a segment of theReg_Cl_Plane_Curve
. factor must be >1 and <=number_of_points
. If it is not, an error message is issued and an emptyPath
is returned.If angle is non-zero, the segment
Path
is rotated by angle about a line fromcenter
in the direction of the normal to the plane of theReg_Cl_Plane_Curve
. Please note, that aReg_Cl_Plane_Curve
must have a meaningfulcenter
, in order for rotation to work. If the absolute value of angle >360, a warning is issued, andfmod(
angle, 360)
is used.If closed is
true
, thePath
will be a cycle, with the ends of the curved segment joined using the connector ‘--’. The curved segment is joined to the line using ‘&’ on each side.Circle c(origin, 4, 30, 30, 30); Path p = c.segment(3, 130); p.show("p:"); -| p: points.size() == 8 connectors.size() == 8(-0.00662541, -0.888379, -1.79185) .. (0.741088, -0.673392, -1.73128) .. (1.37598, -0.355887, -1.40714) .. (1.80139, 0.0157987, -0.868767) .. (1.95255, 0.385079, -0.198137) .. (1.80646, 0.695735, 0.502658) & (1.80646, 0.695735, 0.502658) -- (-0.00662541, -0.888379, -1.79185) & cycle;
![]()
Fig. 156.
const
inline function: Path half ([real angle = 0, [bool closed = true]])Returns a
Path
using half of thePoints
on theReg_Cl_Plane_Curve
. The effect of the arguments angle and closed is similar to that insegment()
, above.Ellipse e(origin, 3, 5, 20, 15, 12.5); Path p = e.half(0, false);
![]()
Fig. 157.
const
inline function: Path quarter ([real angle = 0, [bool closed = true
]])Returns a
Path
using a quarter of thePoints
on theReg_Cl_Plane_Curve
. The effect of the arguments angle and closed is similar to that insegment()
, above.Ellipse e(origin, 3, 5, 60, 5, 2.5); Path p = e.quarter(180, false);
![]()
Fig. 158.