Defeaturing and simplification

Imported and computed geometry often contains details that a mesher cannot use: ends that miss each other by a hair, edges far shorter than the part, straight runs in many pieces, and arcs or free-form curves tessellated into short segments. Simplify cleans these up in place, Simplified returns a cleaned copy, and the exports to OpenCASCADE and netgen run the same steps. Gaps, small edges and collinear pieces are handled below 10⁻⁷ by default, the resolution of OpenCASCADE and netgen.
Fitting arcs and splines is switched on when needed, and every fit is checked against the edges it replaces and rejected if it strays further than its tolerance.
In this section





The steps, in order
Step |
Option |
Default |
|---|---|---|
Close small gaps |
|
|
Merge collinear lines |
|
|
Fit arcs |
|
Off |
Fit splines |
|
Off |
Remove small edges |
|
|
Remove free edges (touching no other edge at either end) |
|
On for faces, off for wires |
Remove small faces |
|
|
The defaults are stored in px.config and can be changed for the whole session. A dict for a fit changes the options it names and switches the fit on:
[1]:
import planex as px
px.config.fit_arcs = dict(tol=1e-4)
print(px.config.fit_arcs)
{'enabled': True, 'tol': 0.0001, 'max_edge_length': 0.0001, 'max_edge_angle': 30.0, 'ignore_edges_smaller': 1e-05}