Rectangle3d

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

Constructors

Rectangle3d

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

Rectangle3d

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

Rectangle3d

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

Properties

Area

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

BoundingBox

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

Center

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

Circumference

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

Height

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

IsValid

#Since v5.0
public bool IsValid { get; }
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.

Plane

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

Unset

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

Width

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

X

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

Y

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

Methods

ClosestPoint

#Since v5.0
[ConstOperation] public Point3d ClosestPoint(Point3d point, bool includeInterior)
Gets the point on the rectangle that is closest to a test-point.
point (Point3d)Point to project.
includeInterior (bool)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
[ConstOperation] public Point3d ClosestPoint(Point3d point)
Gets the point on the rectangle that is closest to a test-point.
point (Point3d)Point to project.
The point on or in the rectangle closest to the test point or Point3d.Unset on failure.

Contains

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

Contains

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

Corner

#Since v5.0
[ConstOperation] public Point3d Corner(int index)
Gets the corner at the given index.
index (int)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
public static Rectangle3d CreateFromPolyline(IEnumerable<Point3d> polyline, out double deviation, out double angleDeviation)
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.
polyline (IEnumerable<Point3d>)Polyline to parse.
deviation (out double)On success, the deviation will contain the largest deviation between the polyline and the rectangle.
angleDeviation (out double)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
public static Rectangle3d CreateFromPolyline(IEnumerable<Point3d> polyline)
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.
polyline (IEnumerable<Point3d>)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
[ConstOperation] public bool EpsilonEquals(Rectangle3d other, double epsilon)
Check that all values in other are within epsilon of the values in this
other (Rectangle3d)
epsilon (double)
EpsilonEquals

MakeIncreasing

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

PointAt

#Since v5.0
[ConstOperation] public Point3d PointAt(double t)
Gets a point along the rectangle boundary.
t (double)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
[ConstOperation] public Point3d PointAt(double x, double y)
Gets a point in Rectangle space.
x (double)Normalized parameter along Rectangle width.
y (double)Normalized parameter along Rectangle height.
The point at the given x,y parameter.

RecenterPlane

#Since v5.0
public void RecenterPlane(int index)
Re-centers the base plane on one of the corners.
index (int)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
public void RecenterPlane(Point3d origin)
Re-centers the base plane on a new origin.
origin (Point3d)New origin for plane.
Explicit

ICloneable.Clone

#

ToNurbsCurve

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

ToPolyline

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

Transform

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