Docs Home
/
KCL Standard Library
/
Functions
/
sketch2::region

sketch2::regionFunction in std::sketch2

WARNING: This function is experimental and may change or be removed.

Create a region from closed segments.

Form the region from sketch block segments that have a given point within a closed boundary. When using a 2D point, not a point from the sketch, the sketch parameter is required to specify which sketch the region is from.

Alternatively, form the region by tracing the first segment from its start point to the intersection with the second segment, and turn at each intersection using the direction until returning back to the first segment.

Arguments

NameTypeDescriptionRequired
pointPoint2d or SegmentA 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.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.No
directionstringCCW for counterclockwise, CW for clockwise. Default is CCW.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.

Found a typo?