Skip to content

connection_object_model_3dConnectionObjectModel3dConnectionObjectModel3dconnection_object_model_3dT_connection_object_model_3d🔗

Short description🔗

connection_object_model_3dConnectionObjectModel3dConnectionObjectModel3dconnection_object_model_3dT_connection_object_model_3d — Determine the connected components of the 3D object model.

Signature🔗

connection_object_model_3d( object_model_3d ObjectModel3D, string Feature, number Value, out object_model_3d ObjectModel3DConnected )void ConnectionObjectModel3d( const HTuple& ObjectModel3D, const HTuple& Feature, const HTuple& Value, HTuple* ObjectModel3DConnected )static void HOperatorSet.ConnectionObjectModel3d( HTuple objectModel3D, HTuple feature, HTuple value, out HTuple objectModel3DConnected )def connection_object_model_3d( object_model_3d: MaybeSequence[HHandle], feature: MaybeSequence[str], value: MaybeSequence[Union[int, float]] ) -> Sequence[HHandle]

Herror T_connection_object_model_3d( const Htuple ObjectModel3D, const Htuple Feature, const Htuple Value, Htuple* ObjectModel3DConnected )

static HObjectModel3DArray HObjectModel3D::ConnectionObjectModel3d( const HObjectModel3DArray& ObjectModel3D, const HTuple& Feature, const HTuple& Value )

HObjectModel3DArray HObjectModel3D::ConnectionObjectModel3d( const HString& Feature, double Value ) const

HObjectModel3DArray HObjectModel3D::ConnectionObjectModel3d( const char* Feature, double Value ) const

HObjectModel3DArray HObjectModel3D::ConnectionObjectModel3d( const wchar_t* Feature, double Value ) const (Windows only)

static HObjectModel3D[] HObjectModel3D.ConnectionObjectModel3d( HObjectModel3D[] objectModel3D, HTuple feature, HTuple value )

HObjectModel3D[] HObjectModel3D.ConnectionObjectModel3d( string feature, double value )

Description🔗

connection_object_model_3dConnectionObjectModel3d determines the connected components of the input 3D object model given in ObjectModel3DobjectModel3Dobject_model_3d. The decision if two parts of the 3D object model are connected can be based on different attributes and respective distance functions. The attribute and distance function can be selected in Featurefeaturefeature:

  • 'distance_3d'"distance_3d": The euclidean distance between the point coordinates of the set of the 3D points are tested. For any distance below Valuevaluevalue the points are considered as connected.

  • 'angle'"angle": The angles between the normals of the points in the 3D object model are compared. Similar normals are considered as connected if their angular distance is below Valuevaluevalue. Valuevaluevalue is specified in radians and should be between \(0\) and \(\pi\).

    Prerequisite: The 3D object model must contain normals, which can be computed with surface_normals_object_model_3dSurfaceNormalsObjectModel3d.

  • 'distance_mapping'"distance_mapping": The mapping measures the distance between the pixel coordinates of points in the 3D object model that are stored in the 2D mapping. Use a value larger than 1.5 for Valuevaluevalue to get a connection in an 8-neighborhood in the image.

    Prerequisite: The 3D object model must contain a 2D mapping, which is available if the 3D object model has been created with xyz_to_object_model_3dXyzToObjectModel3d.

  • 'mesh'"mesh": Returns parts of the 3D object model that are connected with triangles or polygons. Valuevaluevalue is ignored.

    Prerequisite: The 3D object model must provide a triangulation, which can be obtained with triangulate_object_model_3dTriangulateObjectModel3d. Alternatively, if the 3D object model already contains a 2D mapping, prepare_object_model_3dPrepareObjectModel3d can be used with Purposepurposepurpose set to 'segmentation'"segmentation" to quickly triangulate the 3D object model.

  • 'lines'"lines": Returns parts of the object model that are connected by lines. Valuevaluevalue is ignored.

    Prerequisite: The 3D object model must contain polylines, which can be computed with intersect_plane_object_model_3dIntersectPlaneObjectModel3d.

Alternatively, the required attributes can be set manually with set_object_model_3d_attribSetObjectModel3dAttrib or set_object_model_3d_attrib_modSetObjectModel3dAttribMod. Note that the 3D object model might already contain the required attribute, especially if the 3D object model has been read with read_object_model_3dReadObjectModel3d or if it has been deserialized with deserialize_object_model_3dDeserializeObjectModel3d. To check whether the required attribute is available, use get_object_model_3d_paramsGetObjectModel3dParams.

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.

This operator supports canceling timeouts and interrupts.

Parameters🔗

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

Handle of the 3D object model.

Featurefeaturefeature (input_control) string(-array) → (string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

Attribute used to calculate the connected components.

Default: 'distance_3d'"distance_3d"
List of values: 'angle', 'distance_3d', 'distance_mapping', 'lines', 'mesh'"angle", "distance_3d", "distance_mapping", "lines", "mesh"

Valuevaluevalue (input_control) number(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Maximum value for the distance between two connected components.

Default: 1.01.0
Suggested values: 1.0, 1.1, 1.5, 10.0, 100.01.0, 1.1, 1.5, 10.0, 100.0

ObjectModel3DConnectedobjectModel3DConnectedobject_model_3dconnected (output_control) object_model_3d-array → (handle)HTuple (HHandle)HObjectModel3D, HTuple (IntPtr)Sequence[HHandle]Htuple (handle)

Handle of the 3D object models that represent the connected components.

Example🔗

(HDevelop)

gen_object_model_3d_from_points (rand(100), rand(100),\
                                 rand(100), ObjectModel3D)
connection_object_model_3d (ObjectModel3D, 'distance_3d', 0.2,\
                            ObjectModel3DConnected)
dev_get_window (WindowHandle)
visualize_object_model_3d (WindowHandle, [ObjectModel3DConnected], [], [],\
                           ['colored'], [12], [], [], [], PoseOut)

Result🔗

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

Combinations with other operators🔗

Combinations

Possible predecessors

read_object_model_3dReadObjectModel3d, xyz_to_object_model_3dXyzToObjectModel3d, select_points_object_model_3dSelectPointsObjectModel3d

Possible successors

project_object_model_3dProjectObjectModel3d, object_model_3d_to_xyzObjectModel3dToXyz, select_object_model_3dSelectObjectModel3d

See also

select_object_model_3dSelectObjectModel3d, select_points_object_model_3dSelectPointsObjectModel3d

Module🔗

3D Metrology