Polyhedral-net Splines
Loading...
Searching...
No Matches
Patch Building

From a control mesh to a PnS surface represented as Bézier patches. More...

Classes

class  ExtraordinaryPatchConstructor
 Patch constructor for extraordinary patches. See PatchConstructor. More...
class  NGonPatchConstructor
 Patch constructor for n-gon patches. See PatchConstructor. More...
struct  Patch
 A class representing a Bézier patch. More...
class  PatchBuilder
 A builder class for constructing Bézier patches from a mesh. More...
class  PolarPatchConstructor
 Patch constructor for polar patches. See PatchConstructor. More...
class  RegularPatchConstructor
 Patch constructor for regular patches. See PatchConstructor. More...
class  T0PatchConstructor
 Patch constructor for T0 patches. See PatchConstructor. More...
class  T1PatchConstructor
 Patch constructor for T1 patches. See PatchConstructor. More...
class  T2PatchConstructor
 Patch constructor for T2 patches. See PatchConstructor. More...
class  TwoTrianglesTwoQuadsPatchConstructor
 Patch constructor for patches consisting of two triangles and two quads. Designed for patch next to a polar patch. See PatchConstructor. More...
class  PatchConstructorPool
 Pool PnS patch types represented as PatchConstructor subclasses. Each subclass corresponds to a specific PnS patch type. There are two types of patch constructors: vertex-based and face-based. A vertex-based patch constructor checks if a vertex and its neighborhood matches a PnS patch type. A face-based patch constructor checks if a face and its neighborhood matches a PnS patch type. More...

Functions

void process_mesh (MeshType &a_Mesh, PatchConsumer *a_Consumer, const bool a_IsDegRaise)
 Given an OpenMesh PolyMesh, process the mesh to generate the PnS surface in the form of Bézier patches.
std::vector< PatchBuildergetPatchBuilders (MeshType &a_Mesh)
 Given an OpenMesh PolyMesh, retrieve all PatchBuilders for the PnS patches in the mesh.

Detailed Description

From a control mesh to a PnS surface represented as Bézier patches.

process_mesh is the end-to-end entry point: given a mesh, it produces a PnS surface as a set of Bézier patches written to a file. It follows the following pipeline:

Pipeline

  1. Traverse all vertices and faces of the input mesh.
  2. For each vertex/face we find a matching PatchConstructor from PatchConstructorPool (if any) using the PatchConstructorPool::getPatchConstructor fucntion. Each PnS patch type is represnted as a subclass of PatchConstructor.
  3. We identify if a certain vertex/face matches a PnS patch time using the PatchConstructor::isSamePatchType function.
  4. Once we identify a PnS patch type, instead of building a Patch immedietly, we get PatchBuilder using the PatchConstructor::getPatchBuilder function.
  5. PatchBuilder::buildPatches function creates the Bézier patches ( Patch) for the PnS patch type.
  6. For each PatchBuilder, the Patches are built and written to file using a PatchConsumer.
  7. If there are regions of the mesh that do not match any PnS patch type, iterative Subdivision is used to refine the mesh and the process is repeated the process of identifying PnS patches. See Subdivision. Vertices/faces are marked to prevent overlapping patches. See Helper::is_marked.

Why PatchBuilder?

Returning a builder (rather than a Patch) decouples discovery from building. If the underlying mesh changes, patches can be rebuilt efficiently from the saved builders without re-traversing the mesh or re-identifying patch types.

Functions

Classes

  • PatchConstructor — abstract base class; each subclass corresponds to a specific PnS patch type. Responsibilities:
    • decide whether a site matches the patch type; and
    • gather the local neighborhood needed to build the patch.
  • PatchBuilder — stores the data required to construct the resulting Patches via PatchBuilder::buildPatches.
  • PatchConstructorPool — registry that holds all available constructors and finds a match for a vertex/face.
  • PatchConsumer — A consumer receives built patches and writes them to a file or other output.
Note
A vertex/face will be used to create at most one PatchBuilder. However, not all vertices

Function Documentation

◆ getPatchBuilders()

std::vector< PatchBuilder > getPatchBuilders ( MeshType & a_Mesh)

Given an OpenMesh PolyMesh, retrieve all PatchBuilders for the PnS patches in the mesh.

The function traverses the mesh to identify PnS patches and build their corresponding PatchBuilders.

Parameters
a_MeshThe mesh to be processed.
Returns
A vector of PatchBuilders for all identified PnS patches in the mesh.

◆ process_mesh()

void process_mesh ( MeshType & a_Mesh,
PatchConsumer * a_Consumer,
const bool a_IsDegRaise )

Given an OpenMesh PolyMesh, process the mesh to generate the PnS surface in the form of Bézier patches.

The bezier patches are written to file using the provided PatchConsumer.

The function traverses the mesh to identify PnS patches, build the Bézier patches, and write them to file.

Parameters
a_MeshThe mesh to be processed.
a_ConsumerThe PatchConsumer that will receive the extracted patches.
a_IsDegRaiseIf true, raises the degree in direction upto 3 for each patch. If the degree is already 3 or higher in a direction, nothing happens in that direction.