triangulate_object_model_3dT_triangulate_object_model_3dTriangulateObjectModel3dTriangulateObjectModel3dtriangulate_object_model_3d (Operator)

Name

triangulate_object_model_3dT_triangulate_object_model_3dTriangulateObjectModel3dTriangulateObjectModel3dtriangulate_object_model_3d — Create a surface triangulation for a 3D object model.

Signature

triangulate_object_model_3d( : : ObjectModel3D, Method, GenParamName, GenParamValue : TriangulatedObjectModel3D, Information)

Herror T_triangulate_object_model_3d(const Htuple ObjectModel3D, const Htuple Method, const Htuple GenParamName, const Htuple GenParamValue, Htuple* TriangulatedObjectModel3D, Htuple* Information)

void TriangulateObjectModel3d(const HTuple& ObjectModel3D, const HTuple& Method, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* TriangulatedObjectModel3D, HTuple* Information)

static HObjectModel3DArray HObjectModel3D::TriangulateObjectModel3d(const HObjectModel3DArray& ObjectModel3D, const HString& Method, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* Information)

HObjectModel3D HObjectModel3D::TriangulateObjectModel3d(const HString& Method, const HTuple& GenParamName, const HTuple& GenParamValue, Hlong* Information) const

HObjectModel3D HObjectModel3D::TriangulateObjectModel3d(const char* Method, const HTuple& GenParamName, const HTuple& GenParamValue, Hlong* Information) const

HObjectModel3D HObjectModel3D::TriangulateObjectModel3d(const wchar_t* Method, const HTuple& GenParamName, const HTuple& GenParamValue, Hlong* Information) const   ( Windows only)

static void HOperatorSet.TriangulateObjectModel3d(HTuple objectModel3D, HTuple method, HTuple genParamName, HTuple genParamValue, out HTuple triangulatedObjectModel3D, out HTuple information)

static HObjectModel3D[] HObjectModel3D.TriangulateObjectModel3d(HObjectModel3D[] objectModel3D, string method, HTuple genParamName, HTuple genParamValue, out HTuple information)

HObjectModel3D HObjectModel3D.TriangulateObjectModel3d(string method, HTuple genParamName, HTuple genParamValue, out int information)

def triangulate_object_model_3d(object_model_3d: MaybeSequence[HHandle], method: str, gen_param_name: Sequence[str], gen_param_value: Sequence[Union[float, int, str]]) -> Tuple[Sequence[HHandle], Sequence[Union[int, str]]]

def triangulate_object_model_3d_s(object_model_3d: MaybeSequence[HHandle], method: str, gen_param_name: Sequence[str], gen_param_value: Sequence[Union[float, int, str]]) -> Tuple[HHandle, Union[int, str]]

Description

The operator triangulate_object_model_3dtriangulate_object_model_3dTriangulateObjectModel3dTriangulateObjectModel3dtriangulate_object_model_3d generates a surface of triangular faces for the 3D object model ObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_model_3d and returns the resulting surface in TriangulatedObjectModel3DTriangulatedObjectModel3DTriangulatedObjectModel3DtriangulatedObjectModel3Dtriangulated_object_model_3d. Currently, the operator offers four methods for the triangulation that can be selected in MethodMethodMethodmethodmethod: 'polygon_triangulation'"polygon_triangulation""polygon_triangulation""polygon_triangulation""polygon_triangulation", 'xyz_mapping'"xyz_mapping""xyz_mapping""xyz_mapping""xyz_mapping", 'greedy'"greedy""greedy""greedy""greedy" and 'implicit'"implicit""implicit""implicit""implicit". 'polygon_triangulation'"polygon_triangulation""polygon_triangulation""polygon_triangulation""polygon_triangulation" is a simple method for the conversion of a polygonal to a triangular face representation in a 3D object model. 'xyz_mapping'"xyz_mapping""xyz_mapping""xyz_mapping""xyz_mapping" triangulates the points in 2D according to a 2D mapping. The other two methods are rather complex algorithms that are used to calculate triangular faces from pure 3D point data with unknown surface topology. A detailed comparison of the 'greedy'"greedy""greedy""greedy""greedy" and 'implicit'"implicit""implicit""implicit""implicit" algorithm is provided in the paragraph "Comparison of the triangulation methods" below.

Polygon triangulation

By selecting MethodMethodMethodmethodmethod='polygon_triangulation'"polygon_triangulation""polygon_triangulation""polygon_triangulation""polygon_triangulation", all polygons in ObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_model_3d are triangulated. No generic parameters are supported for this method. If no polygons are available, an exception is raised. A triangular mesh representing the same surface as ObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_model_3d is returned in TriangulatedObjectModel3DTriangulatedObjectModel3DTriangulatedObjectModel3DtriangulatedObjectModel3Dtriangulated_object_model_3d.

2D mapping triangulation

By selecting MethodMethodMethodmethodmethod='xyz_mapping'"xyz_mapping""xyz_mapping""xyz_mapping""xyz_mapping", the points are triangulated in 2D according to a 2D mapping contained in ObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_model_3d. The used method is the same as in prepare_object_model_3dprepare_object_model_3dPrepareObjectModel3dPrepareObjectModel3dprepare_object_model_3d for Purpose='segmentation'. If no 2D mapping is available, an exception is raised.

As a post-processing step, triangles whose normal differs strongly from a specified direction can be removed, refer to the description of GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name below. This is helpful in cases where the 2D neighborhood used for the triangulation does not reflect the 3D neighborhood well, e.g., when parts of the surface are hidden along the viewing direction of the sensor, or to remove typical noise along the viewing direction of the sensor.

By setting GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name to the following value, the additional parameter specific for the 2D mapping triangulation can be set with GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value:

'xyz_mapping_max_area_holes'"xyz_mapping_max_area_holes""xyz_mapping_max_area_holes""xyz_mapping_max_area_holes""xyz_mapping_max_area_holes"

specifies which area holes of the point coordinates are closed during a simple Delaunay triangulation. Only holes which are completely surrounded by the image region are closed. If 'xyz_mapping_max_area_holes'"xyz_mapping_max_area_holes""xyz_mapping_max_area_holes""xyz_mapping_max_area_holes""xyz_mapping_max_area_holes" is set to 0, no holes are triangulated. The parameter corresponds to the GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name 'max_area_holes'"max_area_holes""max_area_holes""max_area_holes""max_area_holes" of prepare_object_model_3dprepare_object_model_3dPrepareObjectModel3dPrepareObjectModel3dprepare_object_model_3d.

Suggested values: 1, 10, 100.

Default: 10.

'xyz_mapping_max_view_angle'"xyz_mapping_max_view_angle""xyz_mapping_max_view_angle""xyz_mapping_max_view_angle""xyz_mapping_max_view_angle"

specifies the maximum allowed angle difference between the triangle normal and the viewing direction of the sensor. The smaller this value is set, the fewer triangles are returned. The viewing direction of the sensor is assumed to be the z-axis in the coordinate system of ObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_model_3d if not specified differently using GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name set to 'xyz_mapping_max_view_dir_x'"xyz_mapping_max_view_dir_x""xyz_mapping_max_view_dir_x""xyz_mapping_max_view_dir_x""xyz_mapping_max_view_dir_x", 'xyz_mapping_max_view_dir_y'"xyz_mapping_max_view_dir_y""xyz_mapping_max_view_dir_y""xyz_mapping_max_view_dir_y""xyz_mapping_max_view_dir_y", and 'xyz_mapping_max_view_dir_z'"xyz_mapping_max_view_dir_z""xyz_mapping_max_view_dir_z""xyz_mapping_max_view_dir_z""xyz_mapping_max_view_dir_z". The angle has to be specified between 0 and 90 degrees.

Suggested values: 'rad(60)'"rad(60)""rad(60)""rad(60)""rad(60)", 'rad(85)'"rad(85)""rad(85)""rad(85)""rad(85)", 'rad(90)'"rad(90)""rad(90)""rad(90)""rad(90)".

Default: 'rad(90)'"rad(90)""rad(90)""rad(90)""rad(90)".

'xyz_mapping_max_view_dir_x'"xyz_mapping_max_view_dir_x""xyz_mapping_max_view_dir_x""xyz_mapping_max_view_dir_x""xyz_mapping_max_view_dir_x", 'xyz_mapping_max_view_dir_y'"xyz_mapping_max_view_dir_y""xyz_mapping_max_view_dir_y""xyz_mapping_max_view_dir_y""xyz_mapping_max_view_dir_y", 'xyz_mapping_max_view_dir_z'"xyz_mapping_max_view_dir_z""xyz_mapping_max_view_dir_z""xyz_mapping_max_view_dir_z""xyz_mapping_max_view_dir_z"

specify the viewing direction of the sensor for use with the GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name 'xyz_mapping_max_view_angle'"xyz_mapping_max_view_angle""xyz_mapping_max_view_angle""xyz_mapping_max_view_angle""xyz_mapping_max_view_angle", in the coordinate system of ObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_model_3d. If not all three coordinate directions are set simultaneously or the direction equals the zero vector, an exception is raised.

Suggested values: [1, 0, 0], [0, 0, 1].

Default: [0, 0, 1].

'xyz_mapping_output_all_points'"xyz_mapping_output_all_points""xyz_mapping_output_all_points""xyz_mapping_output_all_points""xyz_mapping_output_all_points"

controls, if all input points are returned, regardless whether they were used in the output triangulation or not. Mainly provided for reasons of backward compatibility. When 'xyz_mapping_output_all_points'"xyz_mapping_output_all_points""xyz_mapping_output_all_points""xyz_mapping_output_all_points""xyz_mapping_output_all_points" is set to 'false'"false""false""false""false", the old point indices are stored as an extended attribute named 'original_point_indices'"original_point_indices""original_point_indices""original_point_indices""original_point_indices" in the 3D object model TriangulatedObjectModel3DTriangulatedObjectModel3DTriangulatedObjectModel3DtriangulatedObjectModel3Dtriangulated_object_model_3d. This attribute can subsequently be queried with get_object_model_3d_paramsget_object_model_3d_paramsGetObjectModel3dParamsGetObjectModel3dParamsget_object_model_3d_params or be processed with other operators that use extended attributes.

List of values: 'false'"false""false""false""false", 'true'"true""true""true""true".

Default: 'false'"false""false""false""false".

image/svg+xml
( 1)
image/svg+xml
( 2)
(1) In order to triangulate the 3D object model, a 2D mapping of the model is used. The triangulation is based on the respective 2D neighborhood. Thereby it is possible, that unwanted triangles are created along the sensor's direction of view, e.g., because of hidden object parts or clutter data. (2) Whether or not a triangle is returned, is decided by computing the difference between the normal direction of each triangle and the viewing direction. The maximum deviation is specified in 'xyz_mapping_max_view_angle'"xyz_mapping_max_view_angle""xyz_mapping_max_view_angle""xyz_mapping_max_view_angle""xyz_mapping_max_view_angle".

Greedy triangulation

By selecting MethodMethodMethodmethodmethod='greedy'"greedy""greedy""greedy""greedy", a so called greedy triangulation algorithm is invoked. It requires 3D point data containing normals. If ObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_model_3d does not contain the normals, they are calculated internally, in an identical manner to calling surface_normals_object_model_3dsurface_normals_object_model_3dSurfaceNormalsObjectModel3dSurfaceNormalsObjectModel3dsurface_normals_object_model_3d with its default parameters before triangulation. The algorithm constructs a surface, which passes through the points and whose surface normals must be conform to the corresponding point normals up to a given tolerance. The surface is represented by triangular faces, which are constructed from triplets of neighboring points. In order to determine which triplets qualify for a surface triangle, the algorithm applies for each point pair the following local neighborhood test, denoted as surface neighborhood criteria (SNC):

If a point P is lying on a surface, with N being the orientation (normal) of the surface, then a point P' with normal N' is considered to lay on this surface if:

  1. the distance between both points is smaller or equal to r, i.e.,

  2. both normals have similar orientation, i.e., the angle or - if no strict consistency of the normals is enforced -

  3. the vector is close to orthogonal with respect to N, i.e., the angle

  4. if P' does not meet 3. but it is not further away from the plane defined by [P,N] than d, then it is accepted as well.

The four parameters r (see 'greedy_radius_type'"greedy_radius_type""greedy_radius_type""greedy_radius_type""greedy_radius_type" and 'greedy_radius_value'"greedy_radius_value""greedy_radius_value""greedy_radius_value""greedy_radius_value"), (see 'greedy_neigh_orient_tol'"greedy_neigh_orient_tol""greedy_neigh_orient_tol""greedy_neigh_orient_tol""greedy_neigh_orient_tol"), (see 'greedy_neigh_latitude_tol'"greedy_neigh_latitude_tol""greedy_neigh_latitude_tol""greedy_neigh_latitude_tol""greedy_neigh_latitude_tol"), and d (see 'greedy_neigh_vertical_tol'"greedy_neigh_vertical_tol""greedy_neigh_vertical_tol""greedy_neigh_vertical_tol""greedy_neigh_vertical_tol") control the criteria and have the following meaning:

The parameter essentially controls the curvature of the generated surface: for small values of the generated surface will be locally flatter; larger values of permit the generation of more curved surface fragments.

The other three parameters define a portion of a sphere that defines the valid SNC neighborhood. The sphere has a radius r, it is centered in P, and its equatorial plane is incident with the plane [P,N]. Only points that are within the sphere (first SNC criteria) are considered. Furthermore, they need to have a latitude within [- ; ] (third SNC criteria) with respect to the equator unless they are lying within the thin layer defined on the both sides of the equatorial plane by the distance parameter d (fourth SNC criteria). In contrast, points lying in any of both pole segments of the sphere (i.e., with higher latitude than and a distance from the equatorial plane beyond d) are not considered as neighbors.

The parameter r prevents the algorithm from constructing too big triangles. This is particularly important for point sets that represent several disconnected surface pieces or a surface with holes that must not be closed. The latitude window defined by enables neighbors which deviate from [P,N] due to noise or curvature to be considered as well. Similarly, the parameter d enables neighbors right "above" or "below" the equatorial plane to be accepted, which essentially accounts for data noise.

Here is some advice for selecting the appropriate values for these parameters:

The greedy triangulation algorithm starts by initializing a surface with one triangle constructed from three SNC-eligible, neighboring points. If all valid neighborhoods show local inconsistencies like collinear or 'double' points, an error will be raised. A prior call of sample_object_model_3dsample_object_model_3dSampleObjectModel3dSampleObjectModel3dsample_object_model_3d with Method set to 'fast' and a small SampleDistance will remove most local inconsistencies from ObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_model_3d. Having found one triangle, the algorithm then greedily constructs new triangles as long as further points can be reached by the SNC rules from any point on the surface boundaries. If no points can be reached from the current surface, but there are unprocessed points in the 3D object model, a new surface is initialized. Because the SNC rules are essentially defined only in the small local neighborhoods of the points, the resulting surface can have global topological artifacts like holes and flips. The latter occur, when - while it is growing - a surface meets itself but with inverted face orientations (i.e., the surface was flipped somewhere while it was growing). These artifacts are handled in special post-processing steps: hole filling and flip resolving, respectively.

Finally, a mesh morphology can be performed to additionally remove artifacts that occurred on the final surface boundaries. The mesh morphology consists of several mesh erosion cycles and several subsequent mesh dilation cycles. With each erosion cycle, all triangles reachable from the surface boundaries are removed and the surface boundaries shrink. Then, with each dilation cycle all triangles reachable from the surface boundaries are appended again to the surface and the boundaries expand. Note that this is only possible for triangles, which were removed by an erosion cycle before that. Therefore, once the original boundaries of the surface (i.e., those which existed before the mesh erosion cycles) are reached, the dilation cannot advance any further and hence the dilation cycles cannot be more than the erosion cycles. Applying mesh erosion and dilation subsequently is analogous to performing opening to standard HALCON regions. At last, the mesh morphology can delete surface pieces which have too few triangles.

The individual algorithm steps are summarized here:

  1. Triangulation of all points reachable by SNC

  2. Hole filling (see 'greedy_hole_filling'"greedy_hole_filling""greedy_hole_filling""greedy_hole_filling""greedy_hole_filling")

  3. Flip resolving (see 'greedy_fix_flips'"greedy_fix_flips""greedy_fix_flips""greedy_fix_flips""greedy_fix_flips")

  4. Mesh morphology (see 'greedy_mesh_erosion'"greedy_mesh_erosion""greedy_mesh_erosion""greedy_mesh_erosion""greedy_mesh_erosion", 'greedy_mesh_dilation'"greedy_mesh_dilation""greedy_mesh_dilation""greedy_mesh_dilation""greedy_mesh_dilation", and 'greedy_remove_small_surfaces'"greedy_remove_small_surfaces""greedy_remove_small_surfaces""greedy_remove_small_surfaces""greedy_remove_small_surfaces")

By setting GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name to one of the following values, additional parameters specific for the greedy triangulation can be set with GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value:

'greedy_kNN'"greedy_kNN""greedy_kNN""greedy_kNN""greedy_kNN"

specifies the size k of the neighborhood. While looking for reachable SNC neighbors for a surface boundary point, the algorithm considers only its closest k neighbors.

Suggested values: 20, 30, 40, 50, 60.

Default: 40.

'greedy_radius_type'"greedy_radius_type""greedy_radius_type""greedy_radius_type""greedy_radius_type":

if set to 'fixed'"fixed""fixed""fixed""fixed",'greedy_radius_value'"greedy_radius_value""greedy_radius_value""greedy_radius_value""greedy_radius_value" specifies the SNC radius r in meter units.

If set to 'z_factor'"z_factor""z_factor""z_factor""z_factor", r is calculated for each point P by multiplying its z-coordinate by the value specified by 'greedy_radius_value'"greedy_radius_value""greedy_radius_value""greedy_radius_value""greedy_radius_value". This representation of r is appropriate for data where the density of the points correlates with their distance from the sensor they were recorded with. This is typically the case with depth sensors or TOF cameras.

If set to 'auto'"auto""auto""auto""auto", the algorithm determines internally whether to use a 'fixed'"fixed""fixed""fixed""fixed" or a 'z_factor'"z_factor""z_factor""z_factor""z_factor" radius and estimates its value. The estimated value is then multiplied by the value specified in 'greedy_radius_value'"greedy_radius_value""greedy_radius_value""greedy_radius_value""greedy_radius_value". This way, the user specifies a scale factor for the estimated radius.

List of values: 'auto'"auto""auto""auto""auto", 'fixed'"fixed""fixed""fixed""fixed", 'z_factor'"z_factor""z_factor""z_factor""z_factor".

Default: 'auto'"auto""auto""auto""auto".

'greedy_radius_value'"greedy_radius_value""greedy_radius_value""greedy_radius_value""greedy_radius_value":

see 'greedy_radius_type'"greedy_radius_type""greedy_radius_type""greedy_radius_type""greedy_radius_type".

Suggested values: 0.01, 0.05, 0.5, 0.66, 1.0, 1.5, 2.0, 3.0, 4.0

'greedy_neigh_orient_tol'"greedy_neigh_orient_tol""greedy_neigh_orient_tol""greedy_neigh_orient_tol""greedy_neigh_orient_tol":

sets the SNC parameter in degree units. controls the surface curvature as described with the SNC rules above.

Suggested values: 10, 20, 30, 40.

Default: 30.

'greedy_neigh_orient_consistent'"greedy_neigh_orient_consistent""greedy_neigh_orient_consistent""greedy_neigh_orient_consistent""greedy_neigh_orient_consistent":

enforces that the normals of two neighboring points have the same orientation (i.e., they do not show in opposite directions). If enabled, this parameter disables the second part of the SNC criteria for , i.e., if , the criteria fails even if .

List of values: 'true'"true""true""true""true", 'false'"false""false""false""false".

Default: 'false'"false""false""false""false".

'greedy_neigh_latitude_tol'"greedy_neigh_latitude_tol""greedy_neigh_latitude_tol""greedy_neigh_latitude_tol""greedy_neigh_latitude_tol":

sets the SNC parameter in degree units. controls the surface neighborhood latitude window as described with the SNC rules above.

Suggested values: 10, 20, 30 40.

Default: 30.

'greedy_neigh_vertical_tol'"greedy_neigh_vertical_tol""greedy_neigh_vertical_tol""greedy_neigh_vertical_tol""greedy_neigh_vertical_tol":

sets the SNC parameter d as a factor of the radius r.

Suggested values: 0.01, 0.1, 0.2, 0.3.

Default: 0.1.

'greedy_hole_filling'"greedy_hole_filling""greedy_hole_filling""greedy_hole_filling""greedy_hole_filling":

sets the length of surface boundaries (in number of point vertices) that should be considered for the hole filling. If 'false'"false""false""false""false" is specified, then the hole filling step is disabled.

Suggested values: 'false'"false""false""false""false", 20, 40, 60.

Default: 40.

'greedy_fix_flips'"greedy_fix_flips""greedy_fix_flips""greedy_fix_flips""greedy_fix_flips":

enables/disables the flip resolving step of the algorithm.

List of values: 'true'"true""true""true""true", 'false'"false""false""false""false".

Default: 'true'"true""true""true""true".

'greedy_prefetch_neighbors'"greedy_prefetch_neighbors""greedy_prefetch_neighbors""greedy_prefetch_neighbors""greedy_prefetch_neighbors":

enables/disables prefetching of lists of the k nearest neighbors for all points. This prefetching improves the algorithm speed, but has high memory requirements (O(k*n), where k is the number specified by 'greedy_kNN'"greedy_kNN""greedy_kNN""greedy_kNN""greedy_kNN", and n is the number of points in ObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_model_3d). For very large data, it might be impossible to preallocate such a big amount of memory, results in a memory error message. In such a case the prefetching must be disabled.

List of values: 'true'"true""true""true""true", 'false'"false""false""false""false" Default: 'true'"true""true""true""true".

'greedy_mesh_erosion'"greedy_mesh_erosion""greedy_mesh_erosion""greedy_mesh_erosion""greedy_mesh_erosion":

specifies the number of erosion cycles applied to the final mesh.

Suggested values:0, 1, 2, 3.

Default: 0.

'greedy_mesh_dilation'"greedy_mesh_dilation""greedy_mesh_dilation""greedy_mesh_dilation""greedy_mesh_dilation":

specifies the number of dilation cycles. The mesh dilation is applied after the mesh erosion. If 'greedy_mesh_dilation'"greedy_mesh_dilation""greedy_mesh_dilation""greedy_mesh_dilation""greedy_mesh_dilation" is set to a greater value than 'greedy_mesh_erosion'"greedy_mesh_erosion""greedy_mesh_erosion""greedy_mesh_erosion""greedy_mesh_erosion", it will be reduced internally to the value of 'greedy_mesh_erosion'"greedy_mesh_erosion""greedy_mesh_erosion""greedy_mesh_erosion""greedy_mesh_erosion".

Suggested values: 0, 1, 2, 3 Default: 0.

'greedy_remove_small_surfaces'"greedy_remove_small_surfaces""greedy_remove_small_surfaces""greedy_remove_small_surfaces""greedy_remove_small_surfaces":

controls the criteria for removing small surface pieces. If set to 'false'"false""false""false""false", the small surface removal is disabled. If set to a value between 0.0 and 1.0, all surfaces having less triangles than 'greedy_remove_small_surfaces'"greedy_remove_small_surfaces""greedy_remove_small_surfaces""greedy_remove_small_surfaces""greedy_remove_small_surfaces"xnum_triangles will be removed, where num_triangles is the total number of triangles generated by the algorithm. If set to a value greater than 1, all surfaces having less triangles than 'greedy_remove_small_surfaces'"greedy_remove_small_surfaces""greedy_remove_small_surfaces""greedy_remove_small_surfaces""greedy_remove_small_surfaces" will be removed.

Suggested values:'false'"false""false""false""false", 0.01, 0.05, 0.1, 10, 100, 1000, 10000.

Default: 'false'"false""false""false""false".

'greedy_timeout'"greedy_timeout""greedy_timeout""greedy_timeout""greedy_timeout":

using a timeout, it is possible to interrupt the operator after a defined period of time in seconds. This is especially useful in cases, where a maximum cycle time has to be ensured. The temporal accuracy of this interrupt is about 10 ms. Passing values less then zero is not valid. Setting 'greedy_timeout'"greedy_timeout""greedy_timeout""greedy_timeout""greedy_timeout" to 'false'"false""false""false""false" deactivates the timeout, which corresponds to the default. The temporal accuracy depends on several factors including the size of the model, the speed of your computer, and the 'timer_mode'"timer_mode""timer_mode""timer_mode""timer_mode" set via set_systemset_systemSetSystemSetSystemset_system.

Suggested values:'false'"false""false""false""false", 0.1, 0.5, 1, 10, 100.

Default: 'false'"false""false""false""false".

'greedy_suppress_timeout_error'"greedy_suppress_timeout_error""greedy_suppress_timeout_error""greedy_suppress_timeout_error""greedy_suppress_timeout_error":

by default, if a timeout occurs the operator returns a timeout error code. By setting 'greedy_suppress_timeout_error'"greedy_suppress_timeout_error""greedy_suppress_timeout_error""greedy_suppress_timeout_error""greedy_suppress_timeout_error" to 'true'"true""true""true""true" instead, the operator returns no error and the intermediate results of the triangulation are returned in TriangulatedObjectModel3DTriangulatedObjectModel3DTriangulatedObjectModel3DtriangulatedObjectModel3Dtriangulated_object_model_3d. With the error suppressed, the occurrence of a timeout can be checked by querying the list of values returned in InformationInformationInformationinformationinformation (in 'verbose'"verbose""verbose""verbose""verbose" mode) by looking for the value corresponding to 'timeout_occured'"timeout_occured""timeout_occured""timeout_occured""timeout_occured".

List of values: 'false'"false""false""false""false", 'true'"true""true""true""true".

Default: 'false'"false""false""false""false".

'greedy_output_all_points'"greedy_output_all_points""greedy_output_all_points""greedy_output_all_points""greedy_output_all_points":

controls, if all input points are returned, regardless whether they were used in the output triangulation or not. Mainly provided for reasons of backward compatibility. When 'greedy_output_all_points'"greedy_output_all_points""greedy_output_all_points""greedy_output_all_points""greedy_output_all_points" is set to 'false'"false""false""false""false", the old point indices are stored as an extended attribute named 'original_point_indices'"original_point_indices""original_point_indices""original_point_indices""original_point_indices" in the 3D object model TriangulatedObjectModel3DTriangulatedObjectModel3DTriangulatedObjectModel3DtriangulatedObjectModel3Dtriangulated_object_model_3d. This attribute can subsequently be queried with get_object_model_3d_paramsget_object_model_3d_paramsGetObjectModel3dParamsGetObjectModel3dParamsget_object_model_3d_params or be processed with other operators that use extended attributes.

List of values: 'false'"false""false""false""false", 'true'"true""true""true""true".

Default: 'false'"false""false""false""false".

'information'"information""information""information""information":

specifies, which intermediate results shall be reported in InformationInformationInformationinformationinformation. By default ('information'"information""information""information""information"='num_triangles'"num_triangles""num_triangles""num_triangles""num_triangles"), the number of generated triangles is reported. For 'information'"information""information""information""information"='verbose'"verbose""verbose""verbose""verbose", a list of name-value information pairs is returned. Currently, the following information is reported:

Name Value Description
'num_triangles'"num_triangles""num_triangles""num_triangles""num_triangles" <number of triangles> returns the number of generated triangular faces.
'specified_radius_type'"specified_radius_type""specified_radius_type""specified_radius_type""specified_radius_type" 'auto'"auto""auto""auto""auto" | 'fixed'"fixed""fixed""fixed""fixed" | 'z_factor'"z_factor""z_factor""z_factor""z_factor" | 'none'"none""none""none""none" returns the radius type as specified by the user.
'specified_radius_value'"specified_radius_value""specified_radius_value""specified_radius_value""specified_radius_value" <specified radius value> returns the radius value specified by the user.
'used_radius_type'"used_radius_type""used_radius_type""used_radius_type""used_radius_type" 'fixed'"fixed""fixed""fixed""fixed" | 'z_factor'"z_factor""z_factor""z_factor""z_factor" | 'sampling'"sampling""sampling""sampling""sampling" returns the radius type used internally;
if the user specified 'auto'"auto""auto""auto""auto" for 'specified_radius_type'"specified_radius_type""specified_radius_type""specified_radius_type""specified_radius_type", this field returns the radius type that was selected internally;
if ObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_model_3d is a 3D primitive, the user specified radius value is internally used as a sampling step and 'used_radius_type'"used_radius_type""used_radius_type""used_radius_type""used_radius_type" returns 'sampling'"sampling""sampling""sampling""sampling".
'used_radius_value'"used_radius_value""used_radius_value""used_radius_value""used_radius_value" <used radius value> returns the radius value used internally;
if 'used_radius_type'"used_radius_type""used_radius_type""used_radius_type""used_radius_type"='fixed'"fixed""fixed""fixed""fixed", the absolute neighborhood radius in meters is reported;
if 'used_radius_type'"used_radius_type""used_radius_type""used_radius_type""used_radius_type"='z_factor'"z_factor""z_factor""z_factor""z_factor", the multiplication factor is reported, which is used to compute the neighborhood radius from the z-coordinate of the neighborhood center point;
if 'used_radius_type'"used_radius_type""used_radius_type""used_radius_type""used_radius_type"='sampling'"sampling""sampling""sampling""sampling", then the sub-sampling factor is reported, which is used to generate the triangulation of 3D primitives, in particular: cylinder and sphere.
'neigh_orient_tol'"neigh_orient_tol""neigh_orient_tol""neigh_orient_tol""neigh_orient_tol" < > returns the surface curvature parameter in degrees that was used for the triangulation.
'neigh_latitude_tol'"neigh_latitude_tol""neigh_latitude_tol""neigh_latitude_tol""neigh_latitude_tol" < > returns the angular tolerance window in degrees that was used to select surface neighbors.
'neigh_vertical_tol'"neigh_vertical_tol""neigh_vertical_tol""neigh_vertical_tol""neigh_vertical_tol" < > returns the neighborhood parameter as a factor of the used radius.
'fix_flips'"fix_flips""fix_flips""fix_flips""fix_flips" 'true'"true""true""true""true" | 'false'"false""false""false""false" returns whether the flip fixing was enabled.
'hole_filling'"hole_filling""hole_filling""hole_filling""hole_filling" 'false'"false""false""false""false" | <max hole boundary length> returns 'false'"false""false""false""false" when the hole filling was disabled, or the specified maximal hole boundary length in number of points.
'timeout'"timeout""timeout""timeout""timeout" 'false'"false""false""false""false" | <timeout> 'false'"false""false""false""false" when the timeout was disabled, or the specified timeout in seconds.
'timeout_occured'"timeout_occured""timeout_occured""timeout_occured""timeout_occured" 'yes'"yes""yes""yes""yes" | 'no'"no""no""no""no" returns whether a timeout occurred.

List of values: 'num_triangles'"num_triangles""num_triangles""num_triangles""num_triangles", 'verbose'"verbose""verbose""verbose""verbose".

Default: 'num_triangles'"num_triangles""num_triangles""num_triangles""num_triangles".

Implicit triangulation

By selecting MethodMethodMethodmethodmethod='implicit'"implicit""implicit""implicit""implicit" an implicit triangulation algorithm based on a Poisson solver (see the paper in References) is invoked. It constructs a water-tight surface, i.e., it is completely closed. The implicit triangulation requires 3D point data containing normals. Additionally, it is required that the 3D normals are pointing strictly inwards or strictly outwards regarding the volume enclosed by the surface to be reconstructed. Unlike the 'greedy'"greedy""greedy""greedy""greedy" algorithm, the 'implicit'"implicit""implicit""implicit""implicit" algorithm does not construct the surface through the input 3D points. Instead, it constructs a surface that approximates the original 3D data and creates a new set of 3D points lying on this surface.

First, the algorithm organizes the point data in an adaptive octree structure: the volume of the bounding box containing the point data is split in the middle in each dimension resulting in eight sub-volumes, or octree voxels. Voxels still containing enough point data can be split in further eight sub-voxels. Voxels that contain no or just few points must not be split further. This splitting is repeated recursively in regions of dense 3D point data until the resulting voxels contain no or just few points. The recursion level of the voxel splits, reached with the smallest voxels, is denoted as depth of the octree.

In the next step, the algorithm estimates the values of the so-called implicit indicator function of the surface, based on the assumption that the points from ObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_model_3d are lying on the surface of an object and the normals of the points in ObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_model_3d are pointing inwards that object (see the paper in References). This assumption explains the requirement of mutually consistent normal orientations. The implicit function has a value of 1 in voxel corners that are strictly inside the body and 0 for voxel corners strictly outside of it. Due to noisy data, voxel corners that are close to the boundary of the object cannot be 'labeled' unambiguously. Therefore, they receive a value between 0 and 1.

The implicit surface defined by the indicator function is a surface, such that each point lying on it has an indicator value of 0.5. The implicit algorithm uses a standard marching cubes algorithm to compute the intersection points of the implicit surface with the sides of the octree voxels. The intersection points result in the new set of 3D points spanning the surface returned in TriangulatedObjectModel3DTriangulatedObjectModel3DTriangulatedObjectModel3DtriangulatedObjectModel3Dtriangulated_object_model_3d. As a consequence, the resolution of the surface details reconstructed in TriangulatedObjectModel3DTriangulatedObjectModel3DTriangulatedObjectModel3DtriangulatedObjectModel3Dtriangulated_object_model_3d depends directly on the resolution of the octree (i.e., on its depth).

By setting GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name to one of the following values, additional parameters specific for the implicit triangulation can be set with GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value:

'implicit_octree_depth'"implicit_octree_depth""implicit_octree_depth""implicit_octree_depth""implicit_octree_depth":

sets the depth of the octree. The octree depth controls the resolution of the surface generation - a higher depth leads to a higher surface resolution. The octree depth has an exponential effect on the runtime and an exponential effect on the memory requirements of the octree. Therefore, the depth is limited to 12.

Restriction: 5 'implicit_octree_depth'"implicit_octree_depth""implicit_octree_depth""implicit_octree_depth""implicit_octree_depth" 12.

Suggested values:5, 6, 8, 10, 11, 12.

Default: 6.

'implicit_solver_depth'"implicit_solver_depth""implicit_solver_depth""implicit_solver_depth""implicit_solver_depth":

enables an alternative algorithm, which can prepare the implicit function up to a user specified octree depth, before the original algorithm takes over the rest of the computations. This algorithm requires less memory than the original one, but is a bit slower.

Restriction: 'implicit_solver_depth'"implicit_solver_depth""implicit_solver_depth""implicit_solver_depth""implicit_solver_depth" 'implicit_octree_depth'"implicit_octree_depth""implicit_octree_depth""implicit_octree_depth""implicit_octree_depth".

Suggested values:2, 4, 6, 8, 10, 11, 12.

Default: 6.

'implicit_min_num_samples'"implicit_min_num_samples""implicit_min_num_samples""implicit_min_num_samples""implicit_min_num_samples":

sets the minimal number of point samples required per octree voxel node. If the number of points in a voxel is less than this value, the voxel is not split any further. For noise free data, this value can be set low (e.g., between 1-5). For noisy data, this value should be set higher (e.g., 10-20), such that the noisy data is accumulated in single voxel nodes to smooth the noise.

Suggested values:1 5, 10, 15, 20, 30.

Default: 1.

'information'"information""information""information""information":
specifies, which intermediate results shall be reported in InformationInformationInformationinformationinformation. By default ('information'"information""information""information""information"='num_triangles'"num_triangles""num_triangles""num_triangles""num_triangles"), the number of generated triangles is reported. For 'information'"information""information""information""information"='verbose'"verbose""verbose""verbose""verbose", a list of name-value information pairs is returned. Currently, the following information is reported:
Name Value Description
'num_triangles'"num_triangles""num_triangles""num_triangles""num_triangles" <number of triangles> returns the number of generated triangular faces.
'num_points'"num_points""num_points""num_points""num_points" <number of points> returns the number of generated points.

List of values: 'num_triangles'"num_triangles""num_triangles""num_triangles""num_triangles", 'verbose'"verbose""verbose""verbose""verbose".

Default: 'num_triangles'"num_triangles""num_triangles""num_triangles""num_triangles".

Comparison of the triangulation methods

In this paragraph, a simple comparison of both supported triangulation methods is provided:

Property Greedy triangulation Implicit triangulation
required data: 3D points with 3D normals 3D points with 3D normals, the normals must point consistently inwards
resulting surface: open, triangulation of the input points closed (water-tight), approximation of the input points
resulting point data: the input point data is preserved new point data is generated
noise handling: moderate point and normal noise handled properly point and normal noise handled implicitly; moderate and high noise levels are accepted
triangulation resolution: explicit, controlled by surface neighborhood parameters implicit, controlled by octree depth and minimal number of point samples per node
time complexity:
memory complexity: , with neighborhood prefetching
, without neighborhood prefetching
where:
    : number of points
    : size of the neighborhood
    : depth of the octree

Depending on the number of points in ObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_model_3d, noise, and specific structure of the data, both algorithms deliver different results and perform with different time and memory complexity. The greedy algorithm works fast, requires less memory, and returns a high level of details in the reconstructed surface for rather small data sets (up to, e.g., 500.000 points). Since the algorithm must basically process every single point in the data, its time performance cannot be decoupled from the point number and it can be rather time consuming for more than 500.000 points. If large point sets need to be triangulated with this method anyway, it is recommended to first sub-sample them via sample_object_model_3dsample_object_model_3dSampleObjectModel3dSampleObjectModel3dsample_object_model_3d.

In contrast, as described above, the implicit algorithm organizes all points in an underlying octree. Therefore, the details returned by it, its speed, and its memory consumption are dominated by the depth of the octree. While higher levels of surface details can only be achieved at disproportionately higher time and memory costs, the octree offers the advantage that it handles large point sets more efficiently. With the octree, the performance of the implicit algorithm depends mostly on the depth of the octree and to a lesser degree on the number of points to be processed. One further disadvantage of the implicit algorithm is its requirement that the adjacent point normals are strictly consistent. This requirement can seldom be fulfilled by usual normal estimation routines.

Execution Information

Parameters

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

Handle of the 3D object model containing 3D point data.

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

Triangulation method.

Default: 'greedy' "greedy" "greedy" "greedy" "greedy"

List of values: 'greedy'"greedy""greedy""greedy""greedy", 'implicit'"implicit""implicit""implicit""implicit", 'polygon_triangulation'"polygon_triangulation""polygon_triangulation""polygon_triangulation""polygon_triangulation", 'xyz_mapping'"xyz_mapping""xyz_mapping""xyz_mapping""xyz_mapping"

GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (input_control)  attribute.name-array HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Names of the generic triangulation parameters.

Default: []

List of values: 'greedy_fix_flips'"greedy_fix_flips""greedy_fix_flips""greedy_fix_flips""greedy_fix_flips", 'greedy_hole_filling'"greedy_hole_filling""greedy_hole_filling""greedy_hole_filling""greedy_hole_filling", 'greedy_kNN'"greedy_kNN""greedy_kNN""greedy_kNN""greedy_kNN", 'greedy_mesh_dilation'"greedy_mesh_dilation""greedy_mesh_dilation""greedy_mesh_dilation""greedy_mesh_dilation", 'greedy_mesh_erosion'"greedy_mesh_erosion""greedy_mesh_erosion""greedy_mesh_erosion""greedy_mesh_erosion", 'greedy_neigh_latitude_tol'"greedy_neigh_latitude_tol""greedy_neigh_latitude_tol""greedy_neigh_latitude_tol""greedy_neigh_latitude_tol", 'greedy_neigh_orient_consistent'"greedy_neigh_orient_consistent""greedy_neigh_orient_consistent""greedy_neigh_orient_consistent""greedy_neigh_orient_consistent", 'greedy_neigh_orient_tol'"greedy_neigh_orient_tol""greedy_neigh_orient_tol""greedy_neigh_orient_tol""greedy_neigh_orient_tol", 'greedy_neigh_vertical_tol'"greedy_neigh_vertical_tol""greedy_neigh_vertical_tol""greedy_neigh_vertical_tol""greedy_neigh_vertical_tol", 'greedy_output_all_points'"greedy_output_all_points""greedy_output_all_points""greedy_output_all_points""greedy_output_all_points", 'greedy_prefetch_neighbors'"greedy_prefetch_neighbors""greedy_prefetch_neighbors""greedy_prefetch_neighbors""greedy_prefetch_neighbors", 'greedy_radius_type'"greedy_radius_type""greedy_radius_type""greedy_radius_type""greedy_radius_type", 'greedy_radius_value'"greedy_radius_value""greedy_radius_value""greedy_radius_value""greedy_radius_value", 'greedy_remove_small_surfaces'"greedy_remove_small_surfaces""greedy_remove_small_surfaces""greedy_remove_small_surfaces""greedy_remove_small_surfaces", 'greedy_suppress_timeout_error'"greedy_suppress_timeout_error""greedy_suppress_timeout_error""greedy_suppress_timeout_error""greedy_suppress_timeout_error", 'greedy_timeout'"greedy_timeout""greedy_timeout""greedy_timeout""greedy_timeout", 'implicit_min_num_samples'"implicit_min_num_samples""implicit_min_num_samples""implicit_min_num_samples""implicit_min_num_samples", 'implicit_octree_depth'"implicit_octree_depth""implicit_octree_depth""implicit_octree_depth""implicit_octree_depth", 'implicit_solver_depth'"implicit_solver_depth""implicit_solver_depth""implicit_solver_depth""implicit_solver_depth", 'information'"information""information""information""information", 'xyz_mapping_max_area_holes'"xyz_mapping_max_area_holes""xyz_mapping_max_area_holes""xyz_mapping_max_area_holes""xyz_mapping_max_area_holes", 'xyz_mapping_max_view_angle'"xyz_mapping_max_view_angle""xyz_mapping_max_view_angle""xyz_mapping_max_view_angle""xyz_mapping_max_view_angle", 'xyz_mapping_max_view_dir_x'"xyz_mapping_max_view_dir_x""xyz_mapping_max_view_dir_x""xyz_mapping_max_view_dir_x""xyz_mapping_max_view_dir_x", 'xyz_mapping_max_view_dir_y'"xyz_mapping_max_view_dir_y""xyz_mapping_max_view_dir_y""xyz_mapping_max_view_dir_y""xyz_mapping_max_view_dir_y", 'xyz_mapping_max_view_dir_z'"xyz_mapping_max_view_dir_z""xyz_mapping_max_view_dir_z""xyz_mapping_max_view_dir_z""xyz_mapping_max_view_dir_z", 'xyz_mapping_output_all_points'"xyz_mapping_output_all_points""xyz_mapping_output_all_points""xyz_mapping_output_all_points""xyz_mapping_output_all_points"

GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (input_control)  attribute.value-array HTupleSequence[Union[float, int, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Values of the generic triangulation parameters.

Default: []

Suggested values: 6, 8, 12, 'true'"true""true""true""true", 'false'"false""false""false""false", 'auto'"auto""auto""auto""auto", 'fixed'"fixed""fixed""fixed""fixed", 'z_factor'"z_factor""z_factor""z_factor""z_factor", 'verbose'"verbose""verbose""verbose""verbose", 'num_triangles'"num_triangles""num_triangles""num_triangles""num_triangles"

TriangulatedObjectModel3DTriangulatedObjectModel3DTriangulatedObjectModel3DtriangulatedObjectModel3Dtriangulated_object_model_3d (output_control)  object_model_3d(-array) HObjectModel3D, HTupleSequence[HHandle]HTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the 3D object model with the triangulated surface.

InformationInformationInformationinformationinformation (output_control)  number(-array) HTupleSequence[Union[int, str]]HTupleHtuple (integer / string) (int / long / string) (Hlong / HString) (Hlong / char*)

Additional information about the triangulation process.

Possible Predecessors

read_object_model_3dread_object_model_3dReadObjectModel3dReadObjectModel3dread_object_model_3d, gen_plane_object_model_3dgen_plane_object_model_3dGenPlaneObjectModel3dGenPlaneObjectModel3dgen_plane_object_model_3d, gen_sphere_object_model_3dgen_sphere_object_model_3dGenSphereObjectModel3dGenSphereObjectModel3dgen_sphere_object_model_3d, gen_cylinder_object_model_3dgen_cylinder_object_model_3dGenCylinderObjectModel3dGenCylinderObjectModel3dgen_cylinder_object_model_3d, gen_box_object_model_3dgen_box_object_model_3dGenBoxObjectModel3dGenBoxObjectModel3dgen_box_object_model_3d, gen_sphere_object_model_3d_centergen_sphere_object_model_3d_centerGenSphereObjectModel3dCenterGenSphereObjectModel3dCentergen_sphere_object_model_3d_center, sample_object_model_3dsample_object_model_3dSampleObjectModel3dSampleObjectModel3dsample_object_model_3d

Possible Successors

write_object_model_3dwrite_object_model_3dWriteObjectModel3dWriteObjectModel3dwrite_object_model_3d, render_object_model_3drender_object_model_3dRenderObjectModel3dRenderObjectModel3drender_object_model_3d, project_object_model_3dproject_object_model_3dProjectObjectModel3dProjectObjectModel3dproject_object_model_3d, simplify_object_model_3dsimplify_object_model_3dSimplifyObjectModel3dSimplifyObjectModel3dsimplify_object_model_3d

References

M. Kazhdan, M. Bolitho, and H. Hoppe: “Poisson Surface Reconstruction.” Symposium on Geometry Processing (June 2006).

Module

3D Metrology