Rectangle3d

References
Represents the values of a plane and two intervals that form an oriented rectangle in three dimensions.

Constructors

Rectangle3d

#Since v5.0
Initializes a new rectangle from width and height.
public Rectangle3d(
plane,
Base plane for Rectangle.
width,
Width (as measured along the base plane x-axis) of rectangle.
height
Height (as measured along the base plane y-axis) of rectangle.
)

Rectangle3d

#Since v5.0
Initializes a new rectangle from dimensions.
public Rectangle3d(
plane,
Base plane for Rectangle.
width,
Dimension of rectangle along the base plane x-axis.
height
Dimension of rectangle along the base plane y-axis.
)

Rectangle3d

#Since v5.0
Initializes a new rectangle from a base plane and two corner points.
public Rectangle3d(
plane,
Base plane for Rectangle.
cornerA,
First corner of Rectangle (will be projected onto plane).
cornerB
Second corner of Rectangle (will be projected onto plane).
)

Properties

Area

#Since v5.0
Gets the unsigned Area of the rectangle.
public double Area { get; }

BoundingBox

#Since v5.0
Gets the world aligned bounding box for this rectangle.
public BoundingBox BoundingBox { get; }

Center

#Since v5.0
Gets the point in the center of the rectangle.
public Point3d Center { get; }

Circumference

#Since v5.0
Gets the circumference of the rectangle.
public double Circumference { get; }

Height

#Since v5.0
Gets the signed height of the rectangle. If the Y dimension is decreasing, the height will be negative.
public double Height { get; }

IsValid

#Since v5.0
Gets a value indicating whether or not this is a valid rectangle. A rectangle is considered to be valid when the base plane and both dimensions are valid.
public bool IsValid { get; }

Plane

#Since v5.0
Gets or sets the base plane of the rectangle.
public Plane Plane { get; set; }

Unset

#Since v5.0
Gets a rectangle with Unset components.
public static Rectangle3d Unset { get; }

Width

#Since v5.0
Gets the signed width of the rectangle. If the X dimension is decreasing, the width will be negative.
public double Width { get; }

X

#Since v5.0
Gets or sets the dimensions of the rectangle along the base plane X-Axis (i.e. the width).
public Interval X { get; set; }

Y

#Since v5.0
Gets or sets the dimensions of the rectangle along the base plane Y-Axis (i.e. the height).
public Interval Y { get; set; }

Methods

ClosestPoint

#Since v5.0
Gets the point on the rectangle that is closest to a test-point.
[ConstOperation] public Point3d ClosestPoint(
point,
Point to project.
includeInterior
If false, the point is projected onto the boundary edge only, otherwise the interior of the rectangle is also taken into consideration.
)
The point on the rectangle closest to the test point or Point3d.Unset on failure.

ClosestPoint

#Since v5.0
Gets the point on the rectangle that is closest to a test-point.
[ConstOperation] public Point3d ClosestPoint(
point
Point to project.
)
The point on or in the rectangle closest to the test point or Point3d.Unset on failure.

Contains

#Since v5.0
Determines if two plane parameters are included in this rectangle.
[ConstOperation] public PointContainment Contains(
x,
Parameter along base plane X direction.
y
Parameter along base plane Y direction.
)
Parameter Rectangle relationship.

Contains

#Since v5.0
Determines if a point is included in this rectangle.
[ConstOperation] public PointContainment Contains(
pt
Point to test. The point will be projected onto the Rectangle plane before inclusion is determined.
)
Point Rectangle relationship.

Corner

#Since v5.0
Gets the corner at the given index.
[ConstOperation] public Point3d Corner(
index
Index of corner, valid values are:

0 = lower left (min-x, min-y)

1 = lower right (max-x, min-y)

2 = upper right (max-x, max-y)

3 = upper left (min-x, max-y)

)
The point at the given corner index.

CreateFromPolyline

#Since v5.0
Attempts to create a rectangle from a polyline. This method only works well for polylines that already closely resemble rectangles. If the polyline contains more than four vertices, the least significant ones will be ignored. If the polylines is non-orthogonal, the discrepancies will be averaged away. This method should not be used as a Rectangle fitter.
public static Rectangle3d CreateFromPolyline(
polyline,
Polyline to parse.
out double
deviation,
On success, the deviation will contain the largest deviation between the polyline and the rectangle.
out double
angleDeviation
On success, the angleDeviation will contain the largest deviation (in radians) between the polyline edges and the rectangle edges.
)
A rectangle that is shaped similarly to the polyline or Rectangle3d.Unset if the polyline does not represent a rectangle.

CreateFromPolyline

#Since v5.0
Attempts to create a rectangle from a polyline. This method only works well for polylines that already closely resemble rectangles. If the polyline contains more than four vertices, the least significant ones will be ignored. If the polylines is non-orthogonal, the discrepancies will be averaged away. This method should not be used as a Rectangle fitter.
public static Rectangle3d CreateFromPolyline(
polyline
Polyline to parse.
)
A rectangle that is shaped similarly to the polyline or Rectangle3d.Unset if the polyline does not represent a rectangle.

EpsilonEquals

#Since v5.4
Check that all values in other are within epsilon of the values in this
[ConstOperation] public bool EpsilonEquals(
other,
epsilon
)
EpsilonEquals

MakeIncreasing

#Since v5.0
Ensures the X and Y dimensions are increasing or singleton intervals.
public void MakeIncreasing()

PointAt

#Since v5.0
Gets a point along the rectangle boundary.
[ConstOperation] public Point3d PointAt(
t
Parameter along rectangle boundary. Valid values range from 0.0 to 4.0, where each integer domain represents a single boundary edge.
)
The point at the given boundary parameter.

PointAt

#Since v5.0
Gets a point in Rectangle space.
[ConstOperation] public Point3d PointAt(
x,
Normalized parameter along Rectangle width.
y
Normalized parameter along Rectangle height.
)
The point at the given x,y parameter.

RecenterPlane

#Since v5.0
Re-centers the base plane on one of the corners.
public void RecenterPlane(
index
Index of corner, valid values are:

0 = lower left (min-x, min-y)

1 = lower right (max-x, min-y)

2 = upper right (max-x, max-y)

3 = upper left (min-x, max-y)

)

RecenterPlane

#Since v5.0
Re-centers the base plane on a new origin.
public void RecenterPlane(
origin
New origin for plane.
)
Explicit

ICloneable.Clone

#

ToNurbsCurve

#Since v5.0
Constructs a nurbs curve representation of this rectangle.
[ConstOperation] public NurbsCurve ToNurbsCurve()
A nurbs curve with the same shape as this rectangle.

ToPolyline

#Since v5.0
Constructs a polyline from this rectangle.
[ConstOperation] public Polyline ToPolyline()
A polyline with the same shape as this rectangle.

Transform

#Since v5.0
Transforms this rectangle. Note that rectangles cannot be skewed or tapered.
public bool Transform(
Transform
xform
Transformation to apply.
)