Operator Reference

smallest_bounding_box_object_model_3dT_smallest_bounding_box_object_model_3dSmallestBoundingBoxObjectModel3dSmallestBoundingBoxObjectModel3dsmallest_bounding_box_object_model_3d (Operator)

smallest_bounding_box_object_model_3dT_smallest_bounding_box_object_model_3dSmallestBoundingBoxObjectModel3dSmallestBoundingBoxObjectModel3dsmallest_bounding_box_object_model_3d — Calculate the smallest bounding box around the points of a 3D object model.

Signature

smallest_bounding_box_object_model_3d( : : ObjectModel3D, Type : Pose, Length1, Length2, Length3)

Herror T_smallest_bounding_box_object_model_3d(const Htuple ObjectModel3D, const Htuple Type, Htuple* Pose, Htuple* Length1, Htuple* Length2, Htuple* Length3)

void SmallestBoundingBoxObjectModel3d(const HTuple& ObjectModel3D, const HTuple& Type, HTuple* Pose, HTuple* Length1, HTuple* Length2, HTuple* Length3)

static HPoseArray HObjectModel3D::SmallestBoundingBoxObjectModel3d(const HObjectModel3DArray& ObjectModel3D, const HString& Type, HTuple* Length1, HTuple* Length2, HTuple* Length3)

HPose HObjectModel3D::SmallestBoundingBoxObjectModel3d(const HString& Type, double* Length1, double* Length2, double* Length3) const

HPose HObjectModel3D::SmallestBoundingBoxObjectModel3d(const char* Type, double* Length1, double* Length2, double* Length3) const

HPose HObjectModel3D::SmallestBoundingBoxObjectModel3d(const wchar_t* Type, double* Length1, double* Length2, double* Length3) const   ( Windows only)

static void HOperatorSet.SmallestBoundingBoxObjectModel3d(HTuple objectModel3D, HTuple type, out HTuple pose, out HTuple length1, out HTuple length2, out HTuple length3)

static HPose[] HObjectModel3D.SmallestBoundingBoxObjectModel3d(HObjectModel3D[] objectModel3D, string type, out HTuple length1, out HTuple length2, out HTuple length3)

HPose HObjectModel3D.SmallestBoundingBoxObjectModel3d(string type, out double length1, out double length2, out double length3)

def smallest_bounding_box_object_model_3d(object_model_3d: MaybeSequence[HHandle], type: str) -> Tuple[Sequence[Union[int, float]], Sequence[float], Sequence[float], Sequence[float]]

def smallest_bounding_box_object_model_3d_s(object_model_3d: MaybeSequence[HHandle], type: str) -> Tuple[Sequence[Union[int, float]], float, float, float]

Description

smallest_bounding_box_object_model_3dsmallest_bounding_box_object_model_3dSmallestBoundingBoxObjectModel3dSmallestBoundingBoxObjectModel3dsmallest_bounding_box_object_model_3d calculates the smallest bounding box around the points of a 3D object model. The resulting bounding box is described using its coordinate system (PosePosePoseposepose), which is oriented such that the longest side of the box is aligned with the x-axis, the second longest side is aligned with the y-axis and the smallest side is aligned with the z-axis. The lengths of the sides are returned in Length1Length1Length1length1length_1, Length2Length2Length2length2length_2, and Length3Length3Length3length3length_3, in descending order. The box can be either axis-aligned or oriented, which can be chosen by the TypeTypeTypetypetype. The algorithm for 'oriented'"oriented""oriented""oriented""oriented" is computationally significantly more costly than the algorithm for 'axis_aligned'"axis_aligned""axis_aligned""axis_aligned""axis_aligned", and returns only an approximation of the oriented bounding box. Note that the algorithm for the oriented bounding box is randomized and can return a different box for each call.

In order to retrieve the corners of the 'axis_aligned'"axis_aligned""axis_aligned""axis_aligned""axis_aligned" box, the operator get_object_model_3d_paramsget_object_model_3d_paramsGetObjectModel3dParamsGetObjectModel3dParamsget_object_model_3d_params can be used with the parameter 'bounding_box1'"bounding_box1""bounding_box1""bounding_box1""bounding_box1".

Execution Information

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Automatically parallelized on internal data level.

Parameters

ObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_model_3d (input_control)  object_model_3d(-array) HObjectModel3D, HTupleMaybeSequence[HHandle]HTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the 3D object model.

TypeTypeTypetypetype (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

The method that is used to estimate the smallest box.

Default: 'oriented' "oriented" "oriented" "oriented" "oriented"

List of values: 'axis_aligned'"axis_aligned""axis_aligned""axis_aligned""axis_aligned", 'oriented'"oriented""oriented""oriented""oriented"

PosePosePoseposepose (output_control)  pose(-array) HPose, HTupleSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

The pose that describes the position and orientation of the box that is generated. The pose has its origin in the center of the box and is oriented such that the x-axis is aligned with the longest side of the box.

Length1Length1Length1length1length_1 (output_control)  number(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

The length of the longest side of the box.

Number of elements: Length1 == ObjectModel3D

Length2Length2Length2length2length_2 (output_control)  number(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

The length of the second longest side of the box.

Number of elements: Length2 == ObjectModel3D

Length3Length3Length3length3length_3 (output_control)  number(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

The length of the third longest side of the box.

Number of elements: Length3 == ObjectModel3D

Example (HDevelop)

gen_object_model_3d_from_points (rand(20), rand(20), rand(20), \
                                 ObjectModel3D)
smallest_bounding_box_object_model_3d (ObjectModel3D, 'oriented', \
                                       Pose, Length1, Length2, Length3)
gen_box_object_model_3d (Pose, Length1, Length2, Length3, ObjectModel3D1)
dev_get_window (WindowHandle)
visualize_object_model_3d (WindowHandle, [ObjectModel3D,ObjectModel3D1], \
                           [], [], ['alpha_1'], [0.5], [], [], [], PoseOut)

Result

smallest_bounding_box_object_model_3dsmallest_bounding_box_object_model_3dSmallestBoundingBoxObjectModel3dSmallestBoundingBoxObjectModel3dsmallest_bounding_box_object_model_3d returns 2 ( H_MSG_TRUE) if all parameters are correct. If necessary, an exception is raised.

Possible Predecessors

connection_object_model_3dconnection_object_model_3dConnectionObjectModel3dConnectionObjectModel3dconnection_object_model_3d, simplify_object_model_3dsimplify_object_model_3dSimplifyObjectModel3dSimplifyObjectModel3dsimplify_object_model_3d

Possible Successors

gen_box_object_model_3dgen_box_object_model_3dGenBoxObjectModel3dGenBoxObjectModel3dgen_box_object_model_3d

See also

smallest_sphere_object_model_3dsmallest_sphere_object_model_3dSmallestSphereObjectModel3dSmallestSphereObjectModel3dsmallest_sphere_object_model_3d

Module

3D Metrology