Hide menu
Loading...
Searching...
No Matches
cadex.Measurements.BoundingBox2d Class Reference

Computes bounding rectangles for 2D geometry. More...

Inherits global.SystemIDisposable.

Public Member Functions

 BoundingBox2d (global::System.IntPtr cPtr, bool cMemoryOwn)
 
void Dispose ()
 

Static Public Member Functions

static cadex.Geom.Box2d ComputeAxisAligned (cadex.Drawing.Drawing theDrawing, cadex.Geom.Transformation2d theTransformation)
 Computes an axis-aligned bounding box for the geometry in all sheets of the drawing.
 
static cadex.Geom.Box2d ComputeAxisAligned (cadex.Drawing.Drawing theDrawing)
 
static cadex.Geom.Box2d ComputeAxisAligned (cadex.Drawing.Sheet theSheet, cadex.Geom.Transformation2d theTransformation)
 Computes an axis-aligned bounding box for the geometry in all views of the sheet.
 
static cadex.Geom.Box2d ComputeAxisAligned (cadex.Drawing.Sheet theSheet)
 
static cadex.Geom.Box2d ComputeAxisAligned (cadex.Drawing.View theView, cadex.Geom.Transformation2d theTransformation)
 Computes an axis-aligned bounding box for the geometry in the view, in sheet coordinates.
 
static cadex.Geom.Box2d ComputeAxisAligned (cadex.Drawing.View theView)
 
static cadex.Geom.Box2d ComputeAxisAligned (cadex.Drawing.Element theElement, cadex.Geom.Transformation2d theTransformation)
 Computes an axis-aligned bounding box for the geometry of the element, in its local coordinates.
 
static cadex.Geom.Box2d ComputeAxisAligned (cadex.Drawing.Element theElement)
 
static cadex.Geom.Box2d ComputeAxisAligned (cadex.Drawing.CurveSet theCurves, cadex.Geom.Transformation2d theTransformation)
 Computes an axis-aligned bounding box for the specified 2D curves over their own parameter ranges.
 
static cadex.Geom.Box2d ComputeAxisAligned (cadex.Drawing.CurveSet theCurves)
 
static cadex.Geom.Box2d ComputeAxisAligned (cadex.Collections.Point2dList thePoints, cadex.Geom.Transformation2d theTransformation)
 Computes an axis-aligned bounding box for the specified 2D points.
 
static cadex.Geom.Box2d ComputeAxisAligned (cadex.Collections.Point2dList thePoints)
 
static cadex.Geom.Box2d ComputeOriented (cadex.Drawing.CurveSet theCurves, cadex.Measurements.BoundingBox2dParameters theParameters)
 Computes an oriented bounding rectangle for the specified 2D curves.
 
static cadex.Geom.Box2d ComputeOriented (cadex.Drawing.CurveSet theCurves)
 
static cadex.Geom.Box2d ComputeOriented (cadex.Collections.Point2dList theCurves, cadex.Measurements.BoundingBox2dParameters theParameters)
 Computes an oriented bounding rectangle for the specified 2D curves.
 
static cadex.Geom.Box2d ComputeOriented (cadex.Collections.Point2dList theCurves)
 

Protected Member Functions

virtual void Dispose (bool disposing)
 

Detailed Description

Computes bounding rectangles for 2D geometry.

The class provides algorithms for computing a rectangle that encloses the specified 2D geometry.

An oriented bounding rectangle is allowed to have an arbitrary orientation. Its orientation is selected to optimize the rectangle according to the criterion specified in BoundingBox2dParameters, such as minimum area or minimum perimeter.

For ComputeOriented(), the rectangle is computed directly from the input points. For a CurveSet, the curves are first discretized using the discretization tolerance specified in BoundingBox2dParameters, and the resulting points are used for the rectangle computation.

The axis-aligned box is computed directly from curve bounds or point coordinates. For drawing objects, it includes curve sets, piecewise contours, points and hatch boundaries. Text and dimension annotations are ignored. View positions and scales are applied before the optional transformation. Sheet paper sizes are ignored.

Both methods return a Geom.Box2d containing the rectangle position, orientation, width, and height. ComputeAxisAligned() aligns its axes with the coordinate axes.

See also
BoundingBox2dParameters

Member Function Documentation

◆ ComputeAxisAligned() [1/6]

static cadex.Geom.Box2d cadex.Measurements.BoundingBox2d.ComputeAxisAligned ( cadex.Collections.Point2dList thePoints,
cadex.Geom.Transformation2d theTransformation )
inlinestatic

Computes an axis-aligned bounding box for the specified 2D points.

Applies theTransformation to the points before computing their bounds. The default transformation is the identity. The box axes coincide with the coordinate axes. Returns an infinite box for empty input or non-finite point coordinates.

◆ ComputeAxisAligned() [2/6]

static cadex.Geom.Box2d cadex.Measurements.BoundingBox2d.ComputeAxisAligned ( cadex.Drawing.CurveSet theCurves,
cadex.Geom.Transformation2d theTransformation )
inlinestatic

Computes an axis-aligned bounding box for the specified 2D curves over their own parameter ranges.

Applies theTransformation to copies of the curves before computing their bounds. The default transformation is the identity. The box axes coincide with the coordinate axes. Returns an infinite box for empty input, unbounded curves or failed computations.

◆ ComputeAxisAligned() [3/6]

static cadex.Geom.Box2d cadex.Measurements.BoundingBox2d.ComputeAxisAligned ( cadex.Drawing.Drawing theDrawing,
cadex.Geom.Transformation2d theTransformation )
inlinestatic

Computes an axis-aligned bounding box for the geometry in all sheets of the drawing.

Sheet coordinates are combined without arranging the sheets relative to each other. Applies theTransformation after view positions and scales. The default transformation is the identity. Returns an infinite box if no supported geometry is found, or if bounds cannot be computed.

◆ ComputeAxisAligned() [4/6]

static cadex.Geom.Box2d cadex.Measurements.BoundingBox2d.ComputeAxisAligned ( cadex.Drawing.Element theElement,
cadex.Geom.Transformation2d theTransformation )
inlinestatic

Computes an axis-aligned bounding box for the geometry of the element, in its local coordinates.

Supports curve sets, piecewise contours, point sets and hatch boundaries. Applies theTransformation before computing bounds. The default transformation is the identity. Returns an infinite box for unsupported elements, empty geometry or failed computations.

◆ ComputeAxisAligned() [5/6]

static cadex.Geom.Box2d cadex.Measurements.BoundingBox2d.ComputeAxisAligned ( cadex.Drawing.Sheet theSheet,
cadex.Geom.Transformation2d theTransformation )
inlinestatic

Computes an axis-aligned bounding box for the geometry in all views of the sheet.

Applies theTransformation after view positions and scales. The default transformation is the identity. Returns an infinite box if no supported geometry is found, or if bounds cannot be computed.

◆ ComputeAxisAligned() [6/6]

static cadex.Geom.Box2d cadex.Measurements.BoundingBox2d.ComputeAxisAligned ( cadex.Drawing.View theView,
cadex.Geom.Transformation2d theTransformation )
inlinestatic

Computes an axis-aligned bounding box for the geometry in the view, in sheet coordinates.

Applies theTransformation after the view position and scale. The default transformation is the identity. Returns an infinite box if no supported geometry is found, or if bounds cannot be computed.

◆ ComputeOriented() [1/2]

static cadex.Geom.Box2d cadex.Measurements.BoundingBox2d.ComputeOriented ( cadex.Collections.Point2dList theCurves,
cadex.Measurements.BoundingBox2dParameters theParameters )
inlinestatic

Computes an oriented bounding rectangle for the specified 2D curves.

The curves are discretized using the tolerance specified in theParameters. The rectangle orientation is selected according to the optimization criterion specified in theParameters.

◆ ComputeOriented() [2/2]

static cadex.Geom.Box2d cadex.Measurements.BoundingBox2d.ComputeOriented ( cadex.Drawing.CurveSet theCurves,
cadex.Measurements.BoundingBox2dParameters theParameters )
inlinestatic

Computes an oriented bounding rectangle for the specified 2D curves.

The curves are discretized using the tolerance specified in theParameters. The rectangle orientation is selected according to the optimization criterion specified in theParameters.