connection_object_model_3dT_connection_object_model_3dConnectionObjectModel3dConnectionObjectModel3dconnection_object_model_3d (Operator)

Name

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

Signature

connection_object_model_3d( : : ObjectModel3D, Feature, Value : ObjectModel3DConnected)

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

void ConnectionObjectModel3d(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 void HOperatorSet.ConnectionObjectModel3d(HTuple objectModel3D, HTuple feature, HTuple value, out HTuple objectModel3DConnected)

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

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

def connection_object_model_3d(object_model_3d: MaybeSequence[HHandle], feature: MaybeSequence[str], value: MaybeSequence[Union[int, float]]) -> Sequence[HHandle]

Description

connection_object_model_3dconnection_object_model_3dConnectionObjectModel3dConnectionObjectModel3dConnectionObjectModel3dconnection_object_model_3d determines the connected components of the input 3D object model given in ObjectModel3DObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_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 FeatureFeatureFeatureFeaturefeaturefeature:

'distance_3d'"distance_3d""distance_3d""distance_3d""distance_3d""distance_3d":

The euclidean distance between the point coordinates of the set of the 3D points are tested. For any distance below ValueValueValueValuevaluevalue the points are considered as connected.

'angle'"angle""angle""angle""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 ValueValueValueValuevaluevalue. ValueValueValueValuevaluevalue 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_3dsurface_normals_object_model_3dSurfaceNormalsObjectModel3dSurfaceNormalsObjectModel3dSurfaceNormalsObjectModel3dsurface_normals_object_model_3d.

'distance_mapping'"distance_mapping""distance_mapping""distance_mapping""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 ValueValueValueValuevaluevalue 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_3dxyz_to_object_model_3dXyzToObjectModel3dXyzToObjectModel3dXyzToObjectModel3dxyz_to_object_model_3d.

'mesh'"mesh""mesh""mesh""mesh""mesh":

Returns parts of the 3D object model that are connected with triangles or polygons. ValueValueValueValuevaluevalue is ignored.

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

'lines'"lines""lines""lines""lines""lines":

Returns parts of the object model that are connected by lines. ValueValueValueValuevaluevalue is ignored.

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

Alternatively, the required attributes can be set manually with set_object_model_3d_attribset_object_model_3d_attribSetObjectModel3dAttribSetObjectModel3dAttribSetObjectModel3dAttribset_object_model_3d_attrib or set_object_model_3d_attrib_modset_object_model_3d_attrib_modSetObjectModel3dAttribModSetObjectModel3dAttribModSetObjectModel3dAttribModset_object_model_3d_attrib_mod. 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_3dread_object_model_3dReadObjectModel3dReadObjectModel3dReadObjectModel3dread_object_model_3d or if it has been deserialized with deserialize_object_model_3ddeserialize_object_model_3dDeserializeObjectModel3dDeserializeObjectModel3dDeserializeObjectModel3ddeserialize_object_model_3d. To check whether the required attribute is available, use get_object_model_3d_paramsget_object_model_3d_paramsGetObjectModel3dParamsGetObjectModel3dParamsGetObjectModel3dParamsget_object_model_3d_params.

Execution Information

This operator supports canceling timeouts and interrupts.

Parameters

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

Handle of the 3D object model.

FeatureFeatureFeatureFeaturefeaturefeature (input_control)  string(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Attribute used to calculate the connected components.

Default: 'distance_3d' "distance_3d" "distance_3d" "distance_3d" "distance_3d" "distance_3d"

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

ValueValueValueValuevaluevalue (input_control)  number(-array) HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Maximum value for the distance between two connected components.

Default: 1.0

Suggested values: 1.0, 1.1, 1.5, 10.0, 100.0

ObjectModel3DConnectedObjectModel3DConnectedObjectModel3DConnectedObjectModel3DConnectedobjectModel3DConnectedobject_model_3dconnected (output_control)  object_model_3d-array HObjectModel3D, HTupleSequence[HHandle]HTupleHtuple (handle) (IntPtr) (HHandle) (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_3dconnection_object_model_3dConnectionObjectModel3dConnectionObjectModel3dConnectionObjectModel3dconnection_object_model_3d returns 2 ( H_MSG_TRUE) if all parameters are correct. If necessary, an exception is raised.

Possible Predecessors

read_object_model_3dread_object_model_3dReadObjectModel3dReadObjectModel3dReadObjectModel3dread_object_model_3d, xyz_to_object_model_3dxyz_to_object_model_3dXyzToObjectModel3dXyzToObjectModel3dXyzToObjectModel3dxyz_to_object_model_3d, select_points_object_model_3dselect_points_object_model_3dSelectPointsObjectModel3dSelectPointsObjectModel3dSelectPointsObjectModel3dselect_points_object_model_3d

Possible Successors

project_object_model_3dproject_object_model_3dProjectObjectModel3dProjectObjectModel3dProjectObjectModel3dproject_object_model_3d, object_model_3d_to_xyzobject_model_3d_to_xyzObjectModel3dToXyzObjectModel3dToXyzObjectModel3dToXyzobject_model_3d_to_xyz

See also

select_object_model_3dselect_object_model_3dSelectObjectModel3dSelectObjectModel3dSelectObjectModel3dselect_object_model_3d, select_points_object_model_3dselect_points_object_model_3dSelectPointsObjectModel3dSelectPointsObjectModel3dSelectPointsObjectModel3dselect_points_object_model_3d

Module

3D Metrology