regionFunction in std::sketch

Create a region from closed segments.

Prefer the segments parameter. It forms a region by tracing the first segment from its start point to the intersection with the second segment, then turning at each intersection using direction until returning to the first segment.

As a fallback, use the point parameter to select the closed boundary that contains a given point. When using a 2D point rather than a point from the sketch, provide the sketch parameter to specify which sketch the region is from.

To make a fallback point move with a parametric sketch, consider creating a construction point in the sketch and constraining it into place. You can then refer to that point to create the region.

Arguments

NameTypeDescriptionRequired
pointPoint2d or SegmentA fallback point that is within the region's boundary.No
segments[Segment; 1+]The first two segments that form the region's boundary. In case of a circle, the one circle segment that forms the region. This is the preferred way to create a region.No
intersectionIndexnumber(_)Index of the intersection of the first segment with the second segment to use as the region's boundary. The default is -1, which uses the last intersection. This is only used when the segments argument is provided.No
directionstringCCW for counterclockwise, CW for clockwise. Default is CCW. This is only used when the segments argument is provided.No
sketchanyThe sketch that the region is from. This is required when point is a Point2d.No

Returns

Sketch - A sketch is a collection of paths.

Examples