Repair: Polygon Corrections
Time to read: ~8 min
A number of good Polygon-Editors are available, some for free and some commercial products (see a short list on
the Importing Polygon Data page). However, there are a number of
frequently encountered errors/issues in files that originate from both high end professional as well as lower end 'hobby' type applications that can
make the conversion to a useful B-Rep model problematic. Though it is difficult to
address all possible problems, the Repair Tab of the InStep Studio application is intended to allow common issues to be automatically detected and corrected.
It is always advisable to make sure that the data imported has no issues and forms one solid, water-tight body. However, such an idealized workflow
cannot always be expected and thus the Repair tools can be used - if necessary - to reduce/remove some of the issues that may be more complicated to
resolve by other applications. It should however, always be considered that the InStep Studio application is primarily focused on the conversion of
valid data to a suitable boundary representation and if problematic geometry is not sufficiently removed, downstream problems may occur that
are beyond the control of the application. In some cases, using a strategy involving multiple applications and manual corrections is necessary.
Some of the functions described below can also be directly applied to one of the bodies by clicking on the body in the viewer and then using the
right mouse button to bring up the sub menu. Here the options are to: Split Body, Delete Body, [Delete All Others], Fix Normals, Flip Normals, Close Holes, Check Body (for All) or Change Color.
What is special with this (unlike the tool buttons discussed below) is that each option only acts on the selection and that there are two additional options,
to Delete the selected Body, the Delete All Other Bodies and to Flip Normals of the body. This last option allows all normal vectors to be reversed from their current orientation
(without consideration of whether either is correct). Note that inside/outside of a face is identified by the color with the inside being a dark grey.
Repair Tools: Overview
The following is a brief overview of the tools available on the Repair Tab. Several of these have additional details on their operation discussed
on a dedicated page, linked with each item.
Repair: Issues Main Page
Clicking this button will perform an evaluation of the data loaded. The Issues button is a toggle-on/off option. Five main items can be evaluated from this option:
- Open Edges
- Upon clicking the Issues button, any edges that are used by only one face (boundaries of the body) are identified and the total number displayed. Checking/Un-Checking the box
next to the item allows these items to be hidden from the immediate view. Since open edge detection is a quick process, it is always shown when Issues
are to be displayed.
- Invalid Edges
- Invalid Edges are those that are used by more than two faces. This indicates that there is a discontinuity across the faces as the neighboring face to
a given face is not uniquely identifiable. These errors require correction.
- Duplicate faces can indicate an issue whereby neighbor information for a given face cannot be obtained. These items need removing and attention needs
to be paid to where these occur and whether their removal is warranted and acceptable.
- Invalid Features
- Invalid Features (Faces) are those that do not correctly define an area and are likely ones where multiple points of the face have been
collapsed either onto other points or onto one of their edges. The result is that the face does not have an area and therefore does not have
a front or back surface. These items need to be removed; in some cases they can automatically be healed.
- Intersections of faces with other faces are automatically checked when the Issue button is pressed - though this behavior can be modified. In general, the process is
quite efficient and finds any cases where two or more faces intersect. Evaluation of very large files can take some time, so if this test is not desirable in all cases,
the Settings>Application Settings>Repair: AlwaysComputeIntersections value can be changed to False in which case intersections are only evaluated when first toggled on.
Repair: Remove Invalids Main Page
The Invalid Removal tool finds and removes (where possible) items that are defined as Invalid Features in the Issues display. There are two additional options provided:
Spit and Move as well as Project Split which attempt to separate facets where too many facets share an edge and facet splitting where vertices overlap edges, respectively.
Repair: Remove Duplicates Main Page
The Duplicate Removal tool searches for Faces that are present
more than one time (defining the same three vertices) and removes all but one of their instances. The orientation of the remaining facet is not considered as the tool
does not distinguish between facets' orientation, only their corners.
Repair: Fix Normals Main Page
The Normal Vector of a facet/triangle is defined by the order in which the corner locations are used. It is possible that some or all of them point inward rather
than (correctly) outwards from the body. This tool attempts to redefine the orientation of any that are pointing in the wrong direction though this is based on the
overall layout. This means that it is, in some cases, possible that all normals become
incorrectly (though consistently) oriented and require all of them to be manually reversed (see above for how to flip them).
Repair: Stitch-Fix Main Page
The Stitch option attempts to correct close proximity surfaces with edges that are otherwise only used by one face. This tool should be used in cases where the data
does not accurately define a continuous surface across edge boundaries (perhaps due to tolerance issues, rounding or data being generated on a per-face basis). Usually,
this scenario occurs when an application is used to generate the original surfaces that does not enforce continuity across adjoining surfaces.
Repair: Vertex Merge Main Page
The Vertex Merge tool allows locations within close (but not identical) proximity to each other to be re-assigned a location based on a tolerance value. This allows data
that does not contain accurate tolerance information to weld together.
Repair: Overlaps Main Page
Overlaps are regions identified in the Issues page for the Intersections. These are facets where two of more items intersect each other. This repair tool attempts to
correct the issue by splitting any involved facets using the neighboring facets as a boundary. In general, the result is simply that the surfaces become continuous though
the involved edges will likely become sources for the Invalid Edge issue and need to be handled separately. Usually, this helps as way to prepare the issue for further (manual)
correction and perhaps splitting and deleting of the resulting bodies. This tool should not be considered as a way to resolve the issue in a single step, but rather as part of
a longer process of identifying and resolving issues.
Repair: Fix Holes Main Page
Hole fixing works by finding open edges (those that are attached to only one face) and to then
generate new faces to close the edge loops together, using one of several options. If bodies consist of shells (such as generated by 3D scanners where only part of the body was
scanned), this option should not be used, rather the Thicken tool should be considered.
The usual case where hole-fixing is appropriate is for cases where circular features (screw-holes and similar) were removed.
Repairs: Auto Fix Main Page
There are different levels of Automatic repairs that can be applied. These are in no way intended to capture and resolve all issues but merely to capture
and process more common items that have a repair solution that can be automatically applied. Some of the available tools also approach the issue from the perspective
that the original data should only be considered as a approximate source and to generate a completely new set of surfaces.
Repair: Wrap Main Page
The Wrap tool can in some cases be used to generate an approximate representation of the original data for cases where the original set is not
usable. Two different approaches are implemented, one where the original data is resampled at an axis-aligned bounding box location and then a new set of surfaces
generated from these locations, the other by only considering known points and orientations of the surface and to then re-create the surface by means of a point-cloud