Adaptive Faceting
From DocR22
Important: As of R21, adaptive faceting is not recommended. The current default gridding algorithm meets tolerances. Refer to Quad Tree Gridding for more details.
The adaptive faceting algorithm obtains facet meshes of high visual quality. To use this algorithm, change the global option header adaptive_triangles to TRUE. The tolerances used in adaptive faceting are the same as for standard faceting (specified through a refinement object). Because the adaptive refinement scheme is based on triangles, some parameters in a refinement object, for example, MAX_GRID_LINES, do not apply.
Adaptive faceting uses the standard facet mesh as a starting point. It inspects each facet edge in the mesh. If tolerances are not met near an edge, the edge is split by adding a new facet node.
Contents |
Adaptive Faceting on the Fringe
ACIS can adaptively facet near the edges of topological faces while maintaining water-tightness. This is activated by a separate option header, adaptive_t_fringe.
The adaptive_t_fringe option is separate from adaptive_triangles, because adaptively faceting on the fringe is a large behavior change.
Important: This option conflicts with incremental faceting. Enabling adaptive_t_fringe only has an effect when you use either api_facet_entity or api_facet_entities for faceting. If you use api_facet_entities, the adaptive refinement on the fringe is enabled only if the list of entities to facet includes all faces from any shell containing a face you want faceted. If you use api_facet_entity with fringe adaptive faceting, you need to use it on a whole body or shell rather than on a single face from a shell.
Advantages
- The algorithm generally meets the user-specified surface and normal tolerances.
- Smooth parts look smooth, when viewed at the scale of the face, with few faceting artifacts.
- The time taken to facet given a part is very significantly less than with the pre-R19 version of the adaptive algorithm, and the quality is higher.
- Safe guards are in place to prevent the algorithm running away, even if the face being faceted has unmarked discontinuities.
Limitations
- Because faces may be faceted one at a time, the edges are not currently included in the adaptive refinement process. In addition, the current algorithm will not split "fringe" facet edges, that is, facet edges with at least one end incident on a topological edge of the face.
- Adaptive refinement is prevented from splitting facet edges with one end at a parametric singularity.
- There is a quality/expense trade off: any reasonable Faceter must evaluate positions and normal vectors for each sample point in the mesh. Thus, if all other things are equal, adding more facets requires more time and more memory consumption.
- When possible, approximate evaluations are used for faceting. This behavior can be turned off using the approx_eval option header. If you use approximate evaluation, do not facet to tolerances tighter than 1000*SPAresabs, because internal approximations are done to this tolerance. Attempts to facet to a tighter tolerance than the approximation are not meaningful and may yield unexpected behavior.
- Refinement is prohibited from splitting a facet edge if it has length less than the surface tolerance to which the face is being faceted. If default surface tolerance is specified, for example, -1 is used for the surface tolerance in the refinement, this distance is 1/500th of the length of the diagonal of the bounding box for the face. This limitation is one restriction which stops adaptive faceting from "running away" on bad parts, but it also may prevent the Faceter from meeting the normal tolerances specified by the user.
Warnings
- Be careful when selecting faceting tolerances.
- Standard faceting decides where to put grid lines based mostly on the parameterization of a face. Therefore, faceting does not consistently meet surface and normal tolerances.
- Adaptive faceting will meet tolerances unless the facets get too small, or it suspects a discontinuity. With adaptive faceting, tolerances can be much less stringent and a smooth, visually pleasing mesh will be produced.
- The time taken to facet a part, and the memory footprint increase as the number of facets required to meet tolerances goes up.
- On the other hand, because adaptive faceting will not split edges of length smaller than the active surface tolerance, regions where the radius of curvature is smaller than the surface tolerance will not be accurately faceted.
Examples
Sphere
The following image was produced without adaptive faceting on. To aid in visualization the facet lines are also drawn in. The mid points of the facet edges do not all lie within surface tolerances.
The following image was obtained using adaptive faceting, with the same view and tolerances as the image above.
Cone, with Singularity Regulated, in Rectangular Coordinates
(face:law "vec(x + .001, y - .001, (x*x + y*y)^1.5 /(x*x + y*y + .0000001))" -5 5 -5 5)
The following image is produced without adaptive faceting. The artifacts are produced because isoparameter lines (for example, the facet grid lines), do not follow the shape of the surface. Near the tip of the cone, the mesh misses the default surface tolerance by a factor of more than 8.
The following image is produced with the same tolerances and view perspective, but adaptive faceting turned on. Note that there are no visible parametric artifacts. The surface is within tolerance at the midpoint of each facet edge. Zooming in on the tip of the cone would show that adaptive faceting stopped refining edges there because they became too small.
Fringe Improvement 1
Below is a part where adaptive faceting greatly improves the results. In the center of Figure. Before: Without Adaptive, you see an interior facet node from the yellow face which is too close to the boundary of the face, causing a knife edge facet. Using adaptive faceting on the fringe, the problem is detected and the overly long edge facet is split. This corrects the issue.
Fringe Improvement 2
Below you see a spline part and the various levels of improvement offered by adaptive faceting. (Refer to face:make-spline-fit for a Scheme script which creates this part. This is f2, the second spline created.) Without adaptive faceting the free form spline — a smooth surface — has corners, because the faceting does not meet the requested tolerances. Using adaptive faceting, the corners you see are smoothed out. The interior is fixed without adaptive_t_fringe on, but there are still major wrinkles in the lower left hand corner. With both options turned on, the face renders much more smoothly.