polyfoammesh.commercial.fault_tolerant
Fault-tolerant (non-watertight) meshing workflow.
Inspired by ANSYS Fluent Meshing Fault-Tolerant Workflow. Handles CAD with gaps, overlaps, missing faces, and small features that prevent traditional watertight meshing.
- Pipeline:
Import geometry (even non-watertight STL with gaps/overlaps)
Gap detection & analysis
Gap closing (snap-merge / MeshFix repair)
meshDict preparation (sizing + boundary layers)
Volume fill (cartesianMesh, BL -> no-BL fallback)
Quality check (checkMesh) — success requires a valid volume mesh
Classes
|
Parameters controlling the fault-tolerant workflow. |
|
|
|
Fault-tolerant meshing for non-watertight geometry. |
|
Information about a detected gap in the geometry. |
- class polyfoammesh.commercial.fault_tolerant.GapInfo(location, gap_size, patch_name='')[source]
Bases:
objectInformation about a detected gap in the geometry.
- class polyfoammesh.commercial.fault_tolerant.FaultTolerantParams(gap_h=0.001, wrap_coarsen=0.5, occlude_internal=True, min_feature_size=0.0005, merge_tolerance=0.0001)[source]
Bases:
objectParameters controlling the fault-tolerant workflow.
- Parameters:
- class polyfoammesh.commercial.fault_tolerant.FaultTolerantResult(success=False, case_dir='', gaps_found=0, min_gap=0.0, cells=0, warnings=<factory>, errors=<factory>, wall_time_seconds=0.0, stage='', gaps_closed=0, quality=None)[source]
Bases:
object- Parameters:
- class polyfoammesh.commercial.fault_tolerant.FaultTolerantWorkflow(of_config=None)[source]
Bases:
objectFault-tolerant meshing for non-watertight geometry.
Usage:
ft = FaultTolerantWorkflow(of_config) ft.set_geometry("path/to/dirty_geometry.stl") ft.set_params(FaultTolerantParams(gap_h=0.002)) result = ft.run()
- Parameters:
of_config (OFConfig | None)
- set_params(params)[source]
- Return type:
- Parameters:
params (FaultTolerantParams)
- run()[source]
Execute the fault-tolerant meshing workflow.
success=Trueis only set once a volume mesh actually exists on disk AND checkMesh confirms it (no fatal error, cells > 0). If checkMesh is unavailable the mesh-on-disk check alone is accepted, with a warning that quality is unverified.- Return type: