Alexander Lonin, Head of the Polygonal Modeling Team, C3D Labs, talks about the available functionality and prospects of the C3D PolyShaper module. He shares how polygonal objects are created and edited, introduce new stitching algorithms and triangulation improvements, as well as mesh diagnostics and healing tools. Alexander also discusses reverse engineering for organic shapes, handling implicit surfaces, and Boolean operations for non-manifold geometry.
This year, we consolidated all polygonal modeling projects, which resulted in C3D PolyShaper, a new module within C3D Toolkit. The new module is officially registered in the National Software Registry. It includes classes and functions for handling polygonal objects and topology. Let’s look at the module’s current functionality and development plans.
A polygonal object with a defined topology can be constructed in multiple ways: conversion from an existing MbMesh object; reading from JT, STL, and OBJ files; creation from a parametric shell; or manual construction. When reading data from a file, we need to restore the topology definition, or, in other words, to stitch the model together. We have improved the stitching algorithm. Now it can handle identical triangles commonly found in building models.
Let’s consider an example (Fig. 1): two parametric cubes have a shared face. After linearization and saving as STL, the cubes turn into a set of triangles, some of which are identical. The updated stitching algorithm handles such situations perfectly. It recognizes identical triangles and creates two polygonal objects with correct topology.
Creating polygonal objects from parametric shells has long been used for visualization of solids (Fig. 2). For this, we create a MbMesh object and then convert it into an object with defined topology. However, this approach has certain limitations: subsequent operations with the mesh (e.g., triangulation refinement) may need to map the segmentation edges to the original parametric model. Standard conversion discards this information, which complicates accurate mesh refinement.
Second, conventional shell triangulation often leads to such defects as folds, unconnected regions, and inconsistent topology. Such a defective mesh may be acceptable for visualization, but it becomes unusable at later stages - for example, engineering analysis or geometry editing. To avoid subsequent healing of the mesh, we have implemented an alternative algorithm that generates the topology directly from the parametric shell. The new approach prevents typical defects at the mesh generation phase.
This typical example shows the capabilities of the algorithm applied to a shell. Although the shell is geometrically correct (Fig. 3, a), the surface contains areas with noticeable mismatch between the isolines (Fig. 3, b). Take a look at the top and side edges. Note the differences in the number and distribution of the isolines between the adjacent surfaces (Fig. 3, c, d). The results of the two algorithms are clearly comparable. The former method creates folds and dents at stitch joints, while the new one does not, due to better consideration of geometric features (Fig. 3, e, f).
Once the object and its topology are constructed, many low-level mesh operations become available. This includes adding or removing facets, cutting or merging edges, modifying vertices, selecting and editing sections, and various kinds of segmentation. These tools are fine control over the model structure, allowing customization for specific tasks.
Other algorithms are also available. For example, we can construct (Fig. 4), measure the curvature (Fig. 5), and perform pre-segmentation by geometric features with the detection of flat, cylindrical and other characteristic areas. This is especially important in reverse engineering workflows.
Another feature allows trimming polygonal objects with an arbitrary plane (Fig. 6). Another function is fitting various types of surfaces, including NURBS surfaces, analytical primitives (e.g., a cone), surfaces of rotation, and surfaces of extrusion. With a suitable underlying geometry, closed NURBS surfaces can be automatically constructed (Fig. 7). The user specifies the direction of parameterization (U/V coordinates), which controls the shape of the inscribed surfaces (Fig. 8).
For better quality of the geometry, there are smoothing algorithms (Fig. 9, a-c). Different methods give different results: one preserves the general shape of the object, while the other is better at removing local irregularities. Select the method most suitable for your task.
Some additional features are automatic gap closing, including partial closing for correction of the boundary edges, and stitching several meshes into a single one (Fig. 10). It is also possible to generate a closed triangulation along an arbitrary 3D contour, for example, to create surfaces of minimal tension like a soap film (Fig. 11).
Finally, polylines can be projected onto a mesh (Fig. 12). New lines are added to the existing triangulation, and then the local topology is analyzed, including possible self-intersections. Such an operation is particularly useful for subsequent mesh trimming or local refinement.
Here is an example: we have scanned geometry and a rough red polyline (Fig. 13). The user can preserve either the outer or the inner part of the contour. Let’s suppose we preserve the inner part. Further, it can be used, for instance, to slice sections with a set of parallel planes (Fig. 14). This is used to construct a loft surface for reverse engineering.
Remeshing can be uniform or curvature-adaptive. The approaches above apply both to individual meshes and meshes with a parametric underlying geometry.
Fig. 15, left shows the original shell. In the middle is the result of uniform remeshing with edge preservation. The right image shows curvature-adaptive remeshing, which merges tangent-continuous faces.
We’ve also focused on drapability analysis. We’ve added new options, such as defining priority areas (e.g., the green area in Fig. 16, right). Our analysis showed that this approach provides a better drapability, especially in the lower part of the model.
The user now has more control over the flattening results. A comparison of the original shell and its flat pattern shows there may be fabric overlaps in the corners of the cutouts (Fig. 17). This allows us to correct the cutout geometry and avoid such defects.
We are expanding the mesh diagnosis and healing capabilities. Our primary task is fold detection. Fold cross-sections are visualized for a better understanding of their structure (Fig. 18). We’ve also implemented the detection of so-called gaps in triangulated meshes (Fig. 19). Unlike holes, which can be patched by adding more triangles, gaps are eliminated by modifying the existing geometry.
We’ve greatly improved Boolean operations for meshes. Their performance has been significantly improved (Fig. 20). Two identical triangulated meshes, shifted relative to each other, produce a complex intersection line. The new algorithm performs Boolean subtraction of two such meshes (2 million triangles each) in less than 10 seconds. With a more accurate topology handling, we now correctly handle cases that previously led to failures (Fig. 21).
Boolean operations can now be applied to non-closed shells. Example: if the original objects have partially trimmed surfaces, the result of the Boolean operation is identical to that for the full geometry, provided the intersection regions are also identical (Fig. 22-23).
Another new feature is the detection of self-intersections within a single object. This is particularly useful for detecting self-intersections in shells.
We’ve also experimented with real-time Boolean operations. They are used, for example, in machining simulation applications. However, this functionality is still being finalized.
Our further development plans include reverse engineering of organic shapes, enhancements to mesh diagnostics and healing, new algorithms for implicit surfaces, the Marching Cubes and Dual Contouring methods, and many other related problems. We will also focus on handling non-manifold geometry, since it is a logical extension of Boolean operations for meshes. These plans may evolve in response to customer requests and internal requirements.

Alexander Lonin,
Head of the Polygonal Modeling Team,
C3D Labs



































