[IoId("00000000-ac6e-48bd-9ad0-ea8290204877")] public sealed class Region : IStorable
A two-dimensional bounded region with optional holes.

Constructors

Region

#
Deserialization constructor.
public Region(
reader
)

Properties

InnerArea

#
Gets the combined area of all inner hole curves.
public double InnerArea { get; }

InnerCount

#
Gets the total number of holes in all regions.
public int InnerCount { get; }

InnerLength

#
Gets the combined length of all inner hole curves.
public double InnerLength { get; }

OuterArea

#
Gets the combined area of all outer boundary curves.
public double OuterArea { get; }

OuterCount

#
Gets the number of sub-regions.
public int OuterCount { get; }

OuterLength

#
Gets the combined length of all outer boundary curves.
public double OuterLength { get; }

Plane

#
Gets the plane within which this region is defined.
public Plane Plane { get; }

PlaneToWorld3

#
Gets the transform from plane (u,v) coordinates to world (x,y,z) coordinates.
public Transform PlaneToWorld3 { get; }

WorldToPlane2

#
Gets the transform from world (x,y,z) coordinates to plane (u,v) coordinates.
public Transform WorldToPlane2 { get; }

WorldToPlane3

#
Gets the transform from world (x,y,z) coordinates to plane (u,v,w) coordinates.
public Transform WorldToPlane3 { get; }

Methods

BooleanDifference

#
Use a solid brep to cut holes in this region.
public Region BooleanDifference(
brep
Brep, should be solid.
)
Modified region.

BooleanDifference

#
Difference two regions. The difference happens in the plane of the first region.
public static Region BooleanDifference(
a,
First (and primary) region.
b
Secondary region.
)

BooleanIntersection

#
Use a solid brep to limit this region.
public Region BooleanIntersection(
brep
Brep, must be solid.
)
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.
public static Region BooleanIntersection(
a,
First (and primary) region.
b
Secondary region.
)

BooleanUnion

#
Union two regions. The union happens in the plane of the first region, as such, the order matters.
public static Region BooleanUnion(
params Region[]
regions
)

BoundingBox

#
Gets the boundingbox of this region after applying a transform to it.
public BoundingBox BoundingBox(
transform
)

Contains

#
Determine the relation between this region and a point in plane (u,v) coordinates.
public RegionRelation Contains(
point,
Point to test.
tolerance = 1E-06
Tolerance to be used for coincidence testing.
)
Containment relation.

Contains

#
Determine the relation between this region and a point in world coordinates.
public RegionRelation Contains(
point,
Point to test.
tolerance = 1E-06
Tolerance to be used for coincidence testing.
)
Containment relation.

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.
public bool ContainsFast(
point
)

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.
public bool ContainsFast(
point
)

CreateFromBrep

#
Convert a Brep with a single face into a region.
public static Region CreateFromBrep(
face
)

CreateFromBrep

#
Convert a Brep with a single face into a region.
public static Region CreateFromBrep(
plane,
face
)

CreateFromBreps

#
public static Region CreateFromBreps(
plane,
params Brep[]
breps
)

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.
public static Region CreateFromCurves(
outer,
Outer boundary curves.
inner = null
Zero or more holes.
)

CreateFromCurves

#
Create a region from an unsorted and unstructed set of boundaries and holes.
public static Region CreateFromCurves(
outer,
One or more outer boundary curves.
inner,
One or more holes. Any hole whose set intersection with a boundary is not empty is considered part of that boundary.
continuousHoles = 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.
public static Region CreateFromCurves(
outer,
One or more outer boundary curves.
Curve[][]
inner
For each boundary, zero or more holes. If the union of the holes fully contain their associated boundary, that particular boundary will go missing.
)

CreateFromCurves

#
Create a region from an outer boundary curve and a list of inner hole curves.
public static Region CreateFromCurves(
plane,
Region plane.
outer,
Outer boundary curves.
inner = null
Zero or more holes.
)

CreateFromCurves

#
Create a region from an unsorted and unstructed set of boundaries and holes.
public static Region CreateFromCurves(
plane,
Region plane.
outer,
One or more outer boundary curves.
inner,
One or more holes. Any hole whose set intersection with a boundary is not empty is considered part of that boundary.
continuousHoles = 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.
public static Region CreateFromCurves(
plane,
Region plane.
outer,
One or more outer boundary curves.
Curve[][]
inner
For each boundary, zero or more holes.
)

Empty

#
Create an empty region.
public static Region Empty(
plane
Plane of region.
)

Explode

#
Explode this region into multiple ones with only a single outer boundary each.
public Region[] Explode()

FitPlaneToCurves

#
Fit a single plane to the control points of a set of curves.
public static Plane FitPlaneToCurves(
params IEnumerable<Curve>[]
curves
)
Explicit

IStorable.Store

#
void IStorable.Store(
writer
)
Store

InnerBounds

#
Gets the bounds (in the 2D canonical plane) of the specified inner boundary.
public (Interval x, Interval y) InnerBounds(
outerIndex,
innerIndex
)

InteriorPoints

#
A method for generating the point distribution on the interior of the region.
public Point3d[] InteriorPoints(
densityHint
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.
)
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.
public (Interval x, Interval y) OuterBounds(
index
)

RollingBall

#
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.
public Region RollingBall(
radius,
tolerance = 1E-06,
token = default(CancellationToken)
)

RollingBall

#
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.
public Region RollingBall(
radius,
tolerance,
out RegionLoop[]
loops,
token = default(CancellationToken)
)

RollingBall

#
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.
public Region RollingBall(
radius,
tolerance,
start,
token = default(CancellationToken)
)

RollingBall

#
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.
public Region RollingBall(
radius,
tolerance,
start,
out RegionLoop[]
loops,
token = default(CancellationToken)
)

Slice

#
Slice this region along a line.
public void Slice(
line,
Slicing line.
out Region
left,
Region to the left.
out Region
right
Regio to the right.
)

ToBrep

#
Create a planar brep representing the specified subregion.
public Brep ToBrep(
index
)

ToCurve

#
Create a curve representing the specified inner boundary in 3D.
public Curve ToCurve(
outerIndex,
innerIndex
)

ToCurve

#
Create a curve representing the specified outer boundary in 3D.
public Curve ToCurve(
outerIndex
)

ToCurves

#
Gets an array of the outer boundary curve plus all associated hole curves for the given sub region.
public Curve[] ToCurves(
outerIndex
)

ToHatch

#
Create a hatch out of the specified subregion.
public Hatch ToHatch(
index,
patternIndex,
scale,
rotation
)

ToMesh

#
Create a mesh approximating this region.
public Mesh ToMesh(
tolerance
)

ToString

#
public override string ToString()
Object.ToString

Transform

#
Transform this region.
public Region Transform(
Transform
transform
)

WithoutHoles

#
Remove all holes from this region.
public Region WithoutHoles()

Convertors

OperationResultDescription
implicitCircleRegionConvert a circle into a region.
implicitRectangle3dRegionConvert a rectahgle into a region.