Skip to content

smallest_bounding_box_object_model_3dsmallest_bounding_box_object_model_3dSmallestBoundingBoxObjectModel3dSmallestBoundingBoxObjectModel3dsmallest_bounding_box_object_model_3dT_smallest_bounding_box_object_model_3d🔗

Short description🔗

smallest_bounding_box_object_model_3dsmallest_bounding_box_object_model_3dSmallestBoundingBoxObjectModel3dSmallestBoundingBoxObjectModel3dsmallest_bounding_box_object_model_3dT_smallest_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( object_model_3d ObjectModel3D, string Type, out pose Pose, out number Length1, out number Length2, out number Length3 )smallest_bounding_box_object_model_3d( : : ObjectModel3D, Type : Pose, Length1, Length2, Length3 )void SmallestBoundingBoxObjectModel3d( const HTuple& ObjectModel3D, const HTuple& Type, HTuple* Pose, HTuple* Length1, HTuple* Length2, HTuple* Length3 )static void HOperatorSet.SmallestBoundingBoxObjectModel3d( HTuple objectModel3D, HTuple type, out HTuple pose, out HTuple length1, out HTuple length2, out HTuple 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]Herror T_smallest_bounding_box_object_model_3d( 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 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 )

Description🔗

smallest_bounding_box_object_model_3dSmallestBoundingBoxObjectModel3d calculates the smallest bounding box around the points of a 3D object model. The resulting bounding box is described using its coordinate system (Poseposepose), 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 Length1length1length_1, Length2length2length_2, and Length3length3length_3, in descending order. The box can be either axis-aligned or oriented, which can be chosen by the Typetypetype. The algorithm for 'oriented'"oriented" is computationally significantly more costly than the algorithm for '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" box, the operator get_object_model_3d_paramsGetObjectModel3dParams can be used with the parameter 'bounding_box1'"bounding_box1".

Execution information🔗

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🔗

ObjectModel3DobjectModel3Dobject_model_3d (input_control) object_model_3d(-array) → (handle)(handle)HTuple (HHandle)HObjectModel3D, HTuple (IntPtr)MaybeSequence[HHandle]Htuple (handle)

Handle of the 3D object model.

Typetypetype (input_control) string → (string)(string)HTuple (HString)HTuple (string)strHtuple (char*)

The method that is used to estimate the smallest box.

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

Poseposepose (output_control) pose(-array) → (real / integer)(real / integer)HTuple (double / Hlong)HPose, HTuple (double / int / long)Sequence[Union[int, float]]Htuple (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.

Length1length1length_1 (output_control) number(-array) → (real)(real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

The length of the longest side of the box.

Number of elements: Length1 == ObjectModel3D

Length2length2length_2 (output_control) number(-array) → (real)(real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

The length of the second longest side of the box.

Number of elements: Length2 == ObjectModel3D

Length3length3length_3 (output_control) number(-array) → (real)(real)HTuple (double)HTuple (double)Sequence[float]Htuple (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_3dSmallestBoundingBoxObjectModel3d returns 2 (H_MSG_TRUE) if all parameters are correct. If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

connection_object_model_3dConnectionObjectModel3d, simplify_object_model_3dSimplifyObjectModel3d

Possible successors

gen_box_object_model_3dGenBoxObjectModel3d

See also

smallest_sphere_object_model_3dSmallestSphereObjectModel3d

Module🔗

3D Metrology