refines a triangle mesh so that no triangles intersects in their interior.
template<class OutputIterator , class TriangleMesh , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters>
refines a triangle mesh so that no triangles intersects in their interior.
Note that this function is only provided as a shortcut for calling autorefine_triangle_soup() with a mesh. For any advance usage the aforementioned function should be called directly.
refines a soup of triangles so that no pair of triangles intersects.
Output triangles may share a common edge or a common vertex (but with the same indexed position in points). Note that if apply_iterative_snap_rounding option is set to false, points in soup_points can only be added (intersection points) at the end of the container, with the initial order preserved. Note that if soup_points contains two or more identical points then only the first copy (following the order in the soup_points) will be used in soup_triangles. if apply_iterative_snap_rounding is set to true, all duplicates points are removed. soup_triangles will be updated to contain both the input triangles and the new subdivided triangles. Degenerate triangles will be removed. Also if apply_iterative_snap_rounding option is set to false, triangles in soup_triangles will be triangles without intersection first, followed by triangles coming from a subdivision induced by an intersection. The named parameter visitor() can be used to track the creation and removal of triangles independently of the apply_iterative_snap_rounding option. If the apply_iterative_snap_rounding parameter is set to true, the coordinates of the vertices are rounded to fit within the precision of a double-precision floating point, while trying to make the triangle soup free of intersections. The snap_grid_size() parameter limits the drift of the snapped vertices. A smaller value is more likely to output an intersection free output and perform more vertex collapses, but it may increase the Hausdorff distance from the input.
Enable the rounding of the coordinates so that they fit in doubles.
Type: Boolean
Default: false
A value gs used to scale the points to [-2^gs, 2^gs] before rounding them on integers. Used only if apply_iterative_snap_rounding() is set to true
Type: unsigned int
Default: 23
Extra: Must be lower than 52.
Maximum number of iterations performed by the snap rounding algorithm. Used only if apply_iterative_snap_rounding is true.
Type: unsigned int
Default: 5
Returns
true if apply_iterative_snap_rounding is set to false. Otherwise, returns true if the modified triangle soup is free of self-intersections, or false if the algorithm was unable to produce such a result within the allowed number of iterations. In the latter case, the output triangle soup represents a partial result from the final iteration, with no guarantee of its validity.
template<class OutputIterator , class TriangleMesh , class NamedParameters1 = parameters::Default_named_parameters, class NamedParameters2 = parameters::Default_named_parameters>
Extra: If this parameter is omitted, an internal property map for CGAL::vertex_point_t should be available for the vertices of tm1 (tm2)
Extra: Both vertex point maps must have the same value type
If true, the set of triangles close to the intersection of tm1 and tm2 will be checked for self-intersections and Corefinement::Self_intersection_exception will be thrown if at least one self-intersection is found.