Show / Hide Table of Contents

Struct BoundingCube

Represents a bounding cuboid, that is an extent in 3 dimensions

Implements
System.Runtime.Serialization.ISerializable
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: CADability
Assembly: CADability.dll
Syntax
[Serializable]
public struct BoundingCube : ISerializable

Constructors

| Improve this Doc View Source

BoundingCube(GeoPoint, Double)

Constructs a equal sided BoundingCube from a center point and a "radius" (half width)

Declaration
public BoundingCube(GeoPoint center, double halfSize)
Parameters
Type Name Description
GeoPoint center

Center point

System.Double halfSize

Half of the width

| Improve this Doc View Source

BoundingCube(GeoPoint[])

Constructs a BoundingCube, that encloses all given points

Declaration
public BoundingCube(params GeoPoint[] p)
Parameters
Type Name Description
GeoPoint[] p

points to enclose

| Improve this Doc View Source

BoundingCube(Double, Double, Double, Double, Double, Double)

Constructs a BoundingCube from minimum and maximum values

Declaration
public BoundingCube(double Xmin, double Xmax, double Ymin, double Ymax, double Zmin, double Zmax)
Parameters
Type Name Description
System.Double Xmin

Minimum in x-direction

System.Double Xmax

Maximum in x-direction

System.Double Ymin

Minimum in y-direction

System.Double Ymax

Maximum in y-direction

System.Double Zmin

Minimum in z-direction

System.Double Zmax

Maximum in z-direction

| Improve this Doc View Source

BoundingCube(SerializationInfo, StreamingContext)

Constructor required by deserialization

Declaration
public BoundingCube(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
System.Runtime.Serialization.SerializationInfo info

SerializationInfo

System.Runtime.Serialization.StreamingContext context

StreamingContext

Fields

| Improve this Doc View Source

UnitBoundingCube

BoundingCube defining the interval [0,1] in all directions

Declaration
public static BoundingCube UnitBoundingCube
Field Value
Type Description
BoundingCube
| Improve this Doc View Source

Xmax

Declaration
public double Xmax
Field Value
Type Description
System.Double
| Improve this Doc View Source

Xmin

Declaration
public double Xmin
Field Value
Type Description
System.Double
| Improve this Doc View Source

Ymax

Declaration
public double Ymax
Field Value
Type Description
System.Double
| Improve this Doc View Source

Ymin

Declaration
public double Ymin
Field Value
Type Description
System.Double
| Improve this Doc View Source

Zmax

Declaration
public double Zmax
Field Value
Type Description
System.Double
| Improve this Doc View Source

Zmin

Declaration
public double Zmin
Field Value
Type Description
System.Double

Properties

| Improve this Doc View Source

DiagonalLength

Declaration
public double DiagonalLength { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

EmptyBoundingCube

Empty BoundingCube. Defined by the special values System.Double.MinValue and System.Double.MaxValue. Often used with the MinMax(GeoPoint) or MinMax(BoundingCube) Methods.

Declaration
public static BoundingCube EmptyBoundingCube { get; }
Property Value
Type Description
BoundingCube
| Improve this Doc View Source

InfiniteBoundingCube

Infinite BoundingCube. Ranging from System.Double.MinValue to System.Double.MaxValue.

Declaration
public static BoundingCube InfiniteBoundingCube { get; }
Property Value
Type Description
BoundingCube
| Improve this Doc View Source

IsEmpty

Returns true if this is the special empty cube

Declaration
public bool IsEmpty { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsValid

Declaration
public bool IsValid { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

LineNumbers

Gets an array[12,2] of pairs of point indices defining the 12 edges of this cube. Indices are to the Points

Declaration
public int[, ] LineNumbers { get; }
Property Value
Type Description
System.Int32[,]
| Improve this Doc View Source

Lines

Gets the 12 edges of the cube as a GeoPoint[12, 2] array

Declaration
public GeoPoint[, ] Lines { get; }
Property Value
Type Description
GeoPoint[,]
| Improve this Doc View Source

MaxSide

Gets the length of the maximum side

Declaration
public double MaxSide { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Points

Gets an array of the 8 vertices of this cube

Declaration
public GeoPoint[] Points { get; }
Property Value
Type Description
GeoPoint[]
| Improve this Doc View Source

Size

Gets the sum of width, height and deepth

Declaration
public double Size { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Volume

Gets the product of width, height and deepth

Declaration
public double Volume { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

XDiff

Gets the extension in x direction

Declaration
public double XDiff { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

YDiff

Gets the extension in y direction

Declaration
public double YDiff { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

ZDiff

Gets the extension in z direction

Declaration
public double ZDiff { get; }
Property Value
Type Description
System.Double

Methods

| Improve this Doc View Source

Clip(ICurve)

Declaration
public ICurve[] Clip(ICurve toClip)
Parameters
Type Name Description
ICurve toClip
Returns
Type Description
ICurve[]
| Improve this Doc View Source

ClipLine(ref GeoPoint, ref GeoPoint)

Clips the provided line (defined by start and end) by this cube. Returns true if the line interferes with this boundingcube, modifies the start and endpoint in the parameters if clipping occures

Declaration
public bool ClipLine(ref GeoPoint start, ref GeoPoint end)
Parameters
Type Name Description
GeoPoint start

Startpoint of the line, may be changed upon return

GeoPoint end

Endpoint of the line, may be changed upon return

Returns
Type Description
System.Boolean

true if the line and this cube interfere

| Improve this Doc View Source

Contains(BoundingCube)

Returns true if this cube contains the provided cube. (<= will be checked)

Declaration
public bool Contains(BoundingCube extn)
Parameters
Type Name Description
BoundingCube extn

Cube to be checked

Returns
Type Description
System.Boolean

true if there is containment

| Improve this Doc View Source

Contains(GeoPoint)

Returns true if this cube contains the provided point. (<= will be checked)

Declaration
public bool Contains(GeoPoint p)
Parameters
Type Name Description
GeoPoint p

The Point

Returns
Type Description
System.Boolean

true if there is containment

| Improve this Doc View Source

Contains(GeoPoint, Double)

Returns true if this cube contains the provided point. Points within the cube extended by precision will also be accepted.

Declaration
public bool Contains(GeoPoint p, double prec)
Parameters
Type Name Description
GeoPoint p

The Point

System.Double prec
Returns
Type Description
System.Boolean

true if there is containment

| Improve this Doc View Source

Disjoint(BoundingCube, BoundingCube)

Returns true if the two cubes are disjoint (do not overlap and do not touch)

Declaration
public static bool Disjoint(BoundingCube b1, BoundingCube b2)
Parameters
Type Name Description
BoundingCube b1

First cube

BoundingCube b2

Second cube

Returns
Type Description
System.Boolean

true if disjoint

| Improve this Doc View Source

Equals(Object)

Determines whether the specified System.Object is equal to this instance.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

The System.Object to compare with this instance.

Returns
Type Description
System.Boolean

true if the specified System.Object is equal to this instance; otherwise, false.

Overrides
System.ValueType.Equals(System.Object)
| Improve this Doc View Source

Expand(Double)

Expands the bounding cube by the given value in all directions.

Declaration
public void Expand(double w)
Parameters
Type Name Description
System.Double w

offset to expand with

| Improve this Doc View Source

GetCenter()

Returns the center of this BoundingCube

Declaration
public GeoPoint GetCenter()
Returns
Type Description
GeoPoint
| Improve this Doc View Source

GetExtent(Projection)

Returns the extent of the projected BoundingCube

Declaration
public BoundingRect GetExtent(Projection pr)
Parameters
Type Name Description
Projection pr

the projection

Returns
Type Description
BoundingRect

the resulting 2-dimensional extent

| Improve this Doc View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.ValueType.GetHashCode()
| Improve this Doc View Source

GetObjectData(SerializationInfo, StreamingContext)

Implements System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)

Declaration
public void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
System.Runtime.Serialization.SerializationInfo info

The System.Runtime.Serialization.SerializationInfo to populate with data.

System.Runtime.Serialization.StreamingContext context

The destination (System.Runtime.Serialization.StreamingContext) for this serialization.

| Improve this Doc View Source

GetPlanes()

Declaration
public PlaneSurface[] GetPlanes()
Returns
Type Description
PlaneSurface[]
| Improve this Doc View Source

GetSides()

Returns 6 planar faces, the faces of this cube

Declaration
public Face[] GetSides()
Returns
Type Description
Face[]

the faces

| Improve this Doc View Source

GetSolid()

Returns a solid cube as a Solid.

Declaration
public Solid GetSolid()
Returns
Type Description
Solid

the solid

| Improve this Doc View Source

Interferes(BoundingCube)

Checks the interference of this cube with the other provided cube

Declaration
public bool Interferes(BoundingCube bc)
Parameters
Type Name Description
BoundingCube bc

the other cube to test with

Returns
Type Description
System.Boolean

true if the two cubes interfere (overlap)

| Improve this Doc View Source

Interferes(GeoPoint, GeoPoint, GeoPoint, GeoPoint)

Returns true if the provided tetrahedron (given by the four points tetra1..tetra4) and this BoundingCube interfere

Declaration
public bool Interferes(GeoPoint tetra1, GeoPoint tetra2, GeoPoint tetra3, GeoPoint tetra4)
Parameters
Type Name Description
GeoPoint tetra1

1st tetrahedron vertex

GeoPoint tetra2

2nd tetrahedron vertex

GeoPoint tetra3

3rd tetrahedron vertex

GeoPoint tetra4

4th tetrahedron vertex

Returns
Type Description
System.Boolean

True if objects interfere

| Improve this Doc View Source

Interferes(GeoPoint, GeoVector, GeoVector, GeoVector)

Checks the interference of this cube with the provided parallelepiped (the affine projection of a cube)

Declaration
public bool Interferes(GeoPoint loc, GeoVector dirx, GeoVector diry, GeoVector dirz)
Parameters
Type Name Description
GeoPoint loc
GeoVector dirx
GeoVector diry
GeoVector dirz
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Interferes(GeoPoint, GeoVector, Double, Boolean)

Returns true if the given line intersects the this bounding cube. Returns false otherwise.

Declaration
public bool Interferes(GeoPoint start, GeoVector dir, double maxdist, bool onlyForward)
Parameters
Type Name Description
GeoPoint start

Startpoint of the line

GeoVector dir

Direction of the line

System.Double maxdist

Maximum allowable distance from the line

System.Boolean onlyForward

Set to true, if only the positive ray should be cinsidered

Returns
Type Description
System.Boolean
| Improve this Doc View Source

Interferes(ref GeoPoint, ref GeoPoint)

Returns true if the given line segment intersects the this bounding cube. Returns false otherwise.

Declaration
public bool Interferes(ref GeoPoint start, ref GeoPoint end)
Parameters
Type Name Description
GeoPoint start

Start point of the line

GeoPoint end

End point of the line

Returns
Type Description
System.Boolean

True if intersection

| Improve this Doc View Source

Interferes(ref GeoPoint, ref GeoPoint, ref GeoPoint)

Returns true when the triangle defined by tri1, tri2 and tri3 (including the inside of the triangle) and this BoundingCube interfere.

Declaration
public bool Interferes(ref GeoPoint tri1, ref GeoPoint tri2, ref GeoPoint tri3)
Parameters
Type Name Description
GeoPoint tri1

First point of triangle

GeoPoint tri2

Second point of triangle

GeoPoint tri3

Third point of triangle

Returns
Type Description
System.Boolean

true if interference, false otherwise

| Improve this Doc View Source

Interferes(GeoPoint[])

Checks the interference of this cube with the provided polyline. The array of points defines a polyline connecting consecutive points.

Declaration
public bool Interferes(GeoPoint[] points)
Parameters
Type Name Description
GeoPoint[] points

The polyline

Returns
Type Description
System.Boolean

true when some part of the polyline interferes with this cube

| Improve this Doc View Source

Interferes(GeoPoint[], Int32[])

Checks the interference of this cube with the provided triangles. The triangles are defined by three points each. Each triple of indices in triangleIndex defines one triangle. Not only the edges of the triangle are checked but also the inner surface.

Declaration
public bool Interferes(GeoPoint[] trianglePoint, int[] triangleIndex)
Parameters
Type Name Description
GeoPoint[] trianglePoint

Array of vertives of the triangles

System.Int32[] triangleIndex

Indices to trianglePoint, each triple defines one triangle

Returns
Type Description
System.Boolean

true if any of the provides triangles interferes with this cube

| Improve this Doc View Source

Interferes(Plane)

Returns true if the given plane intersects the this bounding cube. Returns false otherwise.

Declaration
public bool Interferes(Plane plane)
Parameters
Type Name Description
Plane plane

The plane to test with

Returns
Type Description
System.Boolean

true if intersection

| Improve this Doc View Source

Interferes(Projection, BoundingRect)

Returns true, if the provided rectangle rect and this BoundingCube interfere with the provided projection.

Declaration
public bool Interferes(Projection projection, BoundingRect rect)
Parameters
Type Name Description
Projection projection

The projection

BoundingRect rect

The rectangle

Returns
Type Description
System.Boolean

ture if interference, false otherwise

| Improve this Doc View Source

Interferes(Projection.PickArea)

Checks the interference of this cube with the provided area. The pickarea is either a rectangular prism of infinite length or a frustum.

Declaration
public bool Interferes(Projection.PickArea area)
Parameters
Type Name Description
Projection.PickArea area
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsOnBounds(GeoPoint, Double)

Tests whether the provided point toTest falls on the bounds of this cube with respect to precision.

Declaration
public bool IsOnBounds(GeoPoint toTest, double precision)
Parameters
Type Name Description
GeoPoint toTest

Point to test

System.Double precision

Precision for the test

Returns
Type Description
System.Boolean

True if on bounds, false otherwise

| Improve this Doc View Source

MinMax(BoundingCube)

Makes this BoundingCube include the provided BoundingCube. You can start with an EmptyBoundingCube

Declaration
public void MinMax(BoundingCube b)
Parameters
Type Name Description
BoundingCube b

Cube to be included

| Improve this Doc View Source

MinMax(GeoPoint)

Makes this BoundingCube include the provided point. You can start with an EmptyBoundingCube

Declaration
public void MinMax(GeoPoint p)
Parameters
Type Name Description
GeoPoint p

Point to be included

| Improve this Doc View Source

Modify(ModOp)

Modifies this cube according to the provided modification. If this modification contains a rotation the resulting cube will contain the rotated original cube. BoundingCubes are always axis aligned.

Declaration
public void Modify(ModOp m)
Parameters
Type Name Description
ModOp m

Modification

| Improve this Doc View Source

OnSameSide(GeoPoint[])

Declaration
public bool OnSameSide(params GeoPoint[] pnts)
Parameters
Type Name Description
GeoPoint[] pnts
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Set(Double, Double, Double, Double, Double, Double)

Declaration
public void Set(double Xmin, double Xmax, double Ymin, double Ymax, double Zmin, double Zmax)
Parameters
Type Name Description
System.Double Xmin
System.Double Xmax
System.Double Ymin
System.Double Ymax
System.Double Zmin
System.Double Zmax
| Improve this Doc View Source

ToString()

Returns a System.String that represents this instance.

Declaration
public override string ToString()
Returns
Type Description
System.String

A System.String that represents this instance.

Overrides
System.ValueType.ToString()

Operators

| Improve this Doc View Source

Addition(BoundingCube, BoundingCube)

Declaration
public static BoundingCube operator +(BoundingCube b1, BoundingCube b2)
Parameters
Type Name Description
BoundingCube b1
BoundingCube b2
Returns
Type Description
BoundingCube

Implements

System.Runtime.Serialization.ISerializable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX