ClassesClasses | | Operators

connection_object_model_3dT_connection_object_model_3dConnectionObjectModel3dConnectionObjectModel3d (Operator)

Name

connection_object_model_3dT_connection_object_model_3dConnectionObjectModel3dConnectionObjectModel3d — 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

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)

Description

connection_object_model_3dconnection_object_model_3dConnectionObjectModel3dConnectionObjectModel3dConnectionObjectModel3d determines the connected components of the input 3D object model given in ObjectModel3DObjectModel3DObjectModel3DObjectModel3DobjectModel3D. 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 FeatureFeatureFeatureFeaturefeature:

'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 ValueValueValueValuevalue the points are considered as connected.

'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 ValueValueValueValuevalue. ValueValueValueValuevalue 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_3dSurfaceNormalsObjectModel3dSurfaceNormalsObjectModel3dSurfaceNormalsObjectModel3d.

'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 ValueValueValueValuevalue 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_3dXyzToObjectModel3dXyzToObjectModel3dXyzToObjectModel3d.

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

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

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

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

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

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

Alternatively, the required attributes can be set manually with set_object_model_3d_attribset_object_model_3d_attribSetObjectModel3dAttribSetObjectModel3dAttribSetObjectModel3dAttrib or set_object_model_3d_attrib_modset_object_model_3d_attrib_modSetObjectModel3dAttribModSetObjectModel3dAttribModSetObjectModel3dAttribMod. 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_3dReadObjectModel3dReadObjectModel3dReadObjectModel3d or if it has been deserialized with deserialize_object_model_3ddeserialize_object_model_3dDeserializeObjectModel3dDeserializeObjectModel3dDeserializeObjectModel3d. To check whether the required attribute is available, use get_object_model_3d_paramsget_object_model_3d_paramsGetObjectModel3dParamsGetObjectModel3dParamsGetObjectModel3dParams.

Note that if a 3D object model is no longer needed or should be overwritten, the memory has to be freed first by calling the operator clear_object_model_3dclear_object_model_3dClearObjectModel3dClearObjectModel3dClearObjectModel3d.

Execution Information

This operator supports cancelling timeouts.

Parameters

ObjectModel3DObjectModel3DObjectModel3DObjectModel3DobjectModel3D (input_control)  object_model_3d(-array) HObjectModel3D, HTupleHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

Handle of the 3D object model.

FeatureFeatureFeatureFeaturefeature (input_control)  string(-array) HTupleHTupleHtuple (string) (string) (HString) (char*)

Attribute used to calculate the connected components.

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

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

ValueValueValueValuevalue (input_control)  number(-array) HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Maximum value for the distance between two connected components.

Default value: 1.0

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

ObjectModel3DConnectedObjectModel3DConnectedObjectModel3DConnectedObjectModel3DConnectedobjectModel3DConnected (output_control)  object_model_3d-array HObjectModel3D, HTupleHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

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_3dConnectionObjectModel3dConnectionObjectModel3dConnectionObjectModel3d returns 2 (H_MSG_TRUE) if all parameters are correct. If necessary, an exception is raised.

Possible Predecessors

read_object_model_3dread_object_model_3dReadObjectModel3dReadObjectModel3dReadObjectModel3d, xyz_to_object_model_3dxyz_to_object_model_3dXyzToObjectModel3dXyzToObjectModel3dXyzToObjectModel3d, select_points_object_model_3dselect_points_object_model_3dSelectPointsObjectModel3dSelectPointsObjectModel3dSelectPointsObjectModel3d

Possible Successors

project_object_model_3dproject_object_model_3dProjectObjectModel3dProjectObjectModel3dProjectObjectModel3d, object_model_3d_to_xyzobject_model_3d_to_xyzObjectModel3dToXyzObjectModel3dToXyzObjectModel3dToXyz

See also

select_points_object_model_3dselect_points_object_model_3dSelectPointsObjectModel3dSelectPointsObjectModel3dSelectPointsObjectModel3d

Module

3D Metrology


ClassesClasses | | Operators