Polygonica provides a number of very powerful methods to make meshes watertight. These include:
- PFSolidClose: Performs a variety of sub-operations depending on the errors encountered. For example: stitching small gaps between adjacent faces; adding new faces to fill larger holes; removing duplicate faces; fixing overlapping faces; fixing inconsistently oriented faces. The result is a topologically closed body. PFSolidClose is generally most useful when the designer intended the mesh to represent a closed solid body.
- PFSolidCreateShrinkWrap: Finds a continuous external surface by shrinking the surface of a sphere onto the mesh creating a closed solid homeomorphic to a sphere. This is often very useful for closing ‘triangle soup’ models where the designer or modelling tool never attempted to create consistent, closed, watertight geometry in the first place. Typical examples are building models used for architectural visualisations.
- PFSolidFillHoles: Fills large holes whilst respecting surrounding curvature and meshing. Can be used in automatic and user-guided workflows. Ideal for healing real world scan data but also useful for repairing gaps left by removing features e.g. for defeaturing in CAE/FEA/CFD workflows.
However there are cases where these functions can struggle to deliver a result that is suitable for downstream processing.
For example a mesh reconstructed from a laser or optical scan of a body with many deep pockets will have many large gap regions due to scanner occlusion. Quite often these gaps are very close together – separated by the thickness of the walls between the pockets. If the walls are very thin, then the chance that PFSolidClose or PFSolidFillHoles will join open edges belonging to 'different holes’ is increased. This can create bridging material that shouldn’t be there.
Similarly, whilst PFSolidShrinkWrap can wrap inside pockets, holes and tunnels, it must stop somewhere or it ceases to be a shrinkwrap, and the benefits of the shrinkwrap technique for closing very badly defined models are lost.
The new API PFSolidCloseUsingReferenceSolid solves these problems by using a reference solid to guide the closing process, to give a result that is likely to be a more accurate representation of the scanned part.
In summary it closes open regions of the target mesh by transferring regions of geometry from the reference mesh and merging them with the target mesh to create a watertight solid. Of course, that’s something of an oversimplification – it’s a lot more complicated than that.
Similar to large hole-closing, the algorithm is “inventing” large regions of the surface – so these regions cannot be taken to represent the real world.
However it does provide an automated way to create a usable solid model from a scan with many large, open regions that lie close together – typically due to scanner occlusions in deep pockets.
A typical use might be during repair of a worn part. The workflow might be:
- The surface to be repaired is scanned very accurately.
- Due to scanner occlusion there are large gaps in the rest of the model.
- The software engine that will generate a toolpath, either to add material, or to subtract (CNC machine) away added material to get a good surface finish, requires a closed, watertight mesh.
- To prevent unnecessary ‘air cutting’ at slow speeds, the algorithm that closes the mesh must be absolutely reliable in terms of not generating artefacts that might protrude outside the real part.
So in order to generate accurate toolpaths in the region that has been well scanned, the large open regions must be filled in a way that is most likely to represent the geometry of the material the scanner couldn’t reach. In many cases this is represented by the original CAD model, so PFSolidCloseUsingReferenceSolid selectively merges regions from the CAD model into regions from the badly scanned model.
The example part shown is one we've faked ourselves, as we aren't allowed to share the real parts we've been testing this technique on. It's based on a small AEC model, but in the images at the top of the blog I've oriented it vertically, to suggest that the top surface is the one to be machined, whilst the part below that is not so important to the machining process, but must still be reasonably correct to prevent unecessary air cutting.
PFSolidCloseUsingReferenceSolid was introduced in Polygonica 3.2 Patch 4.
You can see a more detailed explanation, including a live demo, on the Polygonica youtube channel: