Custom Bounding Boxes - Intergraph Smart 3D - Reference Data

Intergraph Smart 3D Hangers and Supports Reference Data

Language
English
Product
Intergraph Smart 3D
Subproduct
Hangers and Supports
Search by Category
Reference Data
Smart 3D Version
12.1 (2019)

When supports are placed, bounding box reference ports are often used to locate and orient the individual parts of the support. The bounding box reference ports are especially useful when dealing with support assemblies that have multiple supported objects. Currently, many different types of bounding boxes exist, each with different predefined orientations. For certain support assemblies however, none of the existing predefined bounding boxes provide the required orientation. In these situations, you can use the bounding box Application Programming Interface (API) to create any bounding box with any orientation.

The aim of the API is to redefine how the bounding boxes are described and created in order to give the Custom Support Definition (CSD) developer more control over the bounding box behavior while also supplying many more types of bounding boxes. The API allows the CSD developer to define the required bounding box based on the requirements of the support being developed.

Custom Bounding Box API

Using the API to define a bounding box is a two-step process. First, you must define the orientation of the bounding box by providing vectors along the X, Y, or Z-axis of the bounding box. You can specify any vector; however, for ease of use, a function is provided that provides direct access to many commonly used vectors. Second, you can create the bounding box using the provided API.

The following sections explain, in detail, how to use the BBX API.

Define the vectors that define the BBX plane:

To begin, create two vectors that define the plane of the bounding box.

For more information about how vectors are used to define the bounding box plane, see Bounding Box Planes.

The GetVectorForBBXDirection function is provided to give you direct access to vectors commonly used to define bounding boxes. You can either use this function, or you can define the vectors directly. The GetVectorForBBXDirection function works as described below:

public Ingr.SP3D.Common.Middle.Vector GetVectorForBBXDirection(Ingr.SP3D.Support.Middle.BoundingBoxDirection eBBXDirection, Ingr.SP3D.Common.Middle.Vector vecNormal)

Parameters:

eBBXDirection: Direction along which the vector should lie.

vecNormal: Normal to the plane into which the vector should be projected.

The first input, eBBXDirection, specifies an enum that determines the direction of the vector. The second input, vecNormal, is optional and defines a vector that is normal to the desired plane of the bounding box. If the second input is given, then the resulting vector is projected into the plane that is perpendicular to the vecNormal. This can also be used to ensure that the returned vector is orthogonal to the second vector passed, and these two can then be used to define a bounding box.

The enum eBBXDirection currently contains the following:

  • AlongRoute - Returns a vector along the route’s primary axis.

  • GlobalX - Returns the global X vector [1,0,0].

  • GlobalY - Returns the global Y vector [0,1,0].

  • GlobalZ - Returns the global Z vector [0,0,1].

  • OrthogonalToRoute - Returns a vector perpendicular to the route’s primary axis.

  • RouteToStruct - Returns a vector from the route to the structure.

  • RouteX - Returns the route reference port's X-axis.

  • RouteY - Returns the route reference port's Y-axis.

  • RouteZ - Returns the route reference port's Z-axis.

  • StructureX - Returns the structure reference port's X-axis.

  • StructureY - Returns the structure reference port's Y-axis.

  • StructureZ - Returns the structure reference port's Z-axis.

  • Tangent - Returns a vector from the centerline of the first route to the centerline of the last.

For example, to create a bounding box similar to BBRV, you first call the API by passing the enum only, as globalZ.

oVec_Z = customSupportDefinition.BoundingBoxHelper.GetVectorForBBXDirection(BoundingBoxDirection.GlobalZ);

Where one of the vectors to be used for BBX creation is global Z.

oVec = customSupportDefinition.BoundingBoxHelper.GetVectorForBBXDirection(BoundingBoxDirection.AlongRoute, oVec_Z);

Where the second vector should be along route, but is projected into the horizontal plane whose normal is oVec_Z.

AlongRoute ensures that the oVec is first generated based on the direction of the route. When the second vector is passed, it receives a horizontal projection (on global XY plane), so that the vector is perpendicular to the oVec_Z.

Create BBX given two vectors:

Next, you use the specified vectors to create the bounding box. There are two different functions that you can use, depending on whether you want to specify two vectors in the bounding box plane (Y- and Z-axis) or you want to specify a vector normal to the bounding box plane (X-axis). The signatures of the functions are:

public Ingr.SP3D.Support.Middle.BoundingBox CreateBoundingBox(Ingr.SP3D.Common.Middle.Vector vecY, Ingr.SP3D.Common.Middle.Vector vecZ, string sBBXName, bool includeInsulation, bool bMirror, bool bIncludeSupportPort, bool bUseSecondVectorAsNormal)

Parameters:

vecY: A vector representing the Y-axis of the bounding box.

vecZ: A vector representing the Z-axis of the bounding box.

sBBXName: The name of the bounding box.

includeInsulation: Whether or not insulation thickness should be included in the bounding box dimensions.

bMirror: Whether or not the bounding box should be mirrored.

bIncludeSupportPort: Whether or not the location of the bounding box should be moved such that the supporting port lies on the plane of the bounding box.

bUseSecondVectorAsNormal: Whether the second vector needs to be used as the normal of the bounding box.

  • The name to be given to the bounding box (sBBXName) is used to create the name of the bounding box. For example, if the string is passed as MyBBX, then the bounding box ports are created with the names MyBBX_High and MyBBX_Low). This allows the CSD developer to define a bounding box with any orientation and any name.

  • The two steps defined earlier must be used together to create a user-defined bounding box. For more information, see Example Code for Custom Bounding Box API.