Region
ReferencesA two-dimensional bounded region with optional holes.
Constructors
Properties
Methods
BooleanDifference
#Use a solid brep to cut holes in this region.
Parameters:
| brep (Brep) | Brep, should be solid. |
Returns: Modified region.
BooleanDifference
#Difference two regions. The difference happens in the plane of the first region.
BooleanIntersection
#Use a solid brep to limit this region.
Parameters:
| brep (Brep) | Brep, must be solid. |
Returns: Modified region. If null, it means this region was entirely disjoint from the brep.
BooleanIntersection
#Intersect two regions. The difference happens in the plane of the first region. As such, the order matters.
BooleanUnion
#Union two regions. The union happens in the plane of the first region, as such, the order matters.
Parameters:
| regions (params Region[]) |
BoundingBox
#Gets the boundingbox of this region after applying a transform to it.
Parameters:
| transform (Transform) |
ContainsFast
#Perform much faster but also slightly less accurate point inclusion. The first time this method is called a spatial cache is constructed which speeds up the inclusion testing. So only use this method if you know you'll be using it a lot.
Parameters:
| point (Point2d) |
ContainsFast
#Perform much faster but also slightly less accurate point inclusion. The first time this method is called a spatial cache is constructed which speeds up the inclusion testing. So only use this method if you know you'll be using it a lot.
Parameters:
| point (Point3d) |
CreateFromBrep
#Convert a Brep with a single face into a region.
CreateFromBreps
#CreateFromCurves
#Create a region from an outer boundary curve and a list of inner hole curves. If any of the inner curves fully contains the outer curvem, an empty region be created.
CreateFromCurves
#Create a region from an unsorted and unstructed set of boundaries and holes.
CreateFromCurves
#Create a region from a set of outer boundary curves and lists of inner hole curves.
CreateFromCurves
#Create a region from an outer boundary curve and a list of inner hole curves.
CreateFromCurves
#Create a region from an unsorted and unstructed set of boundaries and holes.
Parameters:
| plane (Plane) | Region plane. |
| outer (Curve[]) | One or more outer boundary curves. |
| inner (Curve[]) | One or more holes. Any hole whose set intersection with a boundary is not empty is considered part of that boundary. |
| continuousHoles (bool = true) | If true, holes across regions are treated as continuous spaces. |
CreateFromCurves
#Create a region from a set of outer boundary curves and lists of inner hole curves.
FitPlaneToCurves
#Fit a single plane to the control points of a set of curves.
Parameters:
| curves (params IEnumerable<Curve>[]) |
InnerBounds
#Gets the bounds (in the 2D canonical plane) of the specified inner boundary.
InteriorPoints
#A method for generating the point distribution on the interior of the region.
Parameters:
| densityHint (int) | Hint for the total number of points on the combined outer boundaries. 190 is a decent value to start with. Do note that after the points on the boundary are tesselated, triangles with naked edges are omitted from the result. So the density hint has very little to do with the actual number of returned points. |
Returns: An array of points on the interior of the region, or null if something went wrong.
OuterBounds
#Gets the bounds (in the 2D canonical plane) of the specified outer boundary.
Parameters:
| index (int) |
RollingBall
#public Region RollingBall(double radius, double tolerance = 1E-06, CancellationToken token = default(CancellationToken))
Computes the part of this region a disk of the given radius can reach while rolling around inside it: convex corners are rounded off and features narrower than the disk disappear. A negative radius rolls the disk around the outside instead and returns the region plus everything outside it the disk cannot get into: concave corners are rounded off and notches narrower than the disk fill up.
Parameters:
| radius (double) | |
| tolerance (double = 1E-06) | |
| token (CancellationToken = null) |
RollingBall
#public Region RollingBall(double radius, double tolerance, out RegionLoop[] loops, CancellationToken token = default(CancellationToken))
Computes the part of this region a disk of the given radius can reach while rolling around inside it, and reports the boundary of the result as trimmed pieces of the original curves joined by true arcs.
Parameters:
| radius (double) | |
| tolerance (double) | |
| loops (out RegionLoop[]) | |
| token (CancellationToken = null) |
RollingBall
#public Region RollingBall(double radius, double tolerance, Point3d start, CancellationToken token = default(CancellationToken))
Computes the part of this region a disk of the given radius can reach while rolling around inside it, starting out covering the given point; parts of the region the disk cannot roll to from there are left out.
Parameters:
| radius (double) | |
| tolerance (double) | |
| start (Point3d) | |
| token (CancellationToken = null) |
RollingBall
#public Region RollingBall(double radius, double tolerance, Point3d start, out RegionLoop[] loops, CancellationToken token = default(CancellationToken))
Computes the part of this region a disk of the given radius can reach while rolling around inside it, starting out covering the given point, and reports the boundary of the result as trimmed pieces of the original curves joined by true arcs.
Parameters:
| radius (double) | |
| tolerance (double) | |
| start (Point3d) | |
| loops (out RegionLoop[]) | |
| token (CancellationToken = null) |
Slice
#Slice this region along a line.
ToCurve
#Create a curve representing the specified inner boundary in 3D.
ToCurves
#Gets an array of the outer boundary curve plus all associated hole curves for the given sub region.
Parameters:
| outerIndex (int) |
ToHatch
#Create a hatch out of the specified subregion.
Convertors
| Operation | Result | Description | ||
|---|---|---|---|---|
| implicit | Circle | Region | Convert a circle into a region. | |
| implicit | Rectangle3d | Region | Convert a rectahgle into a region. | |