Converting a Mesh into a Brep: A Comparison of Common Approaches

Converting a Mesh into a Brep: A Comparison of Common ApproachesConverting a Mesh into a Brep: A Comparison of Common Approaches

Shape generation techniques such as topology optimization and implicit function modeling sometimes output results as a mesh. Similarly, in shape measurement methods such as 3D scanning, the acquired shapes are typically treated as point clouds or meshes.

To edit these shapes within existing CAD workflows or reuse them as design data, conversion to Brep may be required.

However, even when converting a Mesh to a Brep, the best method depends on whether you want a shape that is faithful to the original Mesh or a CAD shape that is easier to edit.

This article summarizes the most common methods for converting Mesh to Brep and presents the results of actually trying out several of them.

Purpose of Brepization and required shape

Brep (Boundary Representation) is a shape representation that uses faces, edges, and vertices to represent the boundaries of a three-dimensional object. In general 3D CAD software, Breps that combine planes and NURBS surfaces are widely used to represent design shapes.

On the other hand, Mesh represents shapes using a collection of triangles and quadrilaterals, making it a shape representation that is easy to use for visualizing shapes and 3D printing.

In CAD operations and subsequent processes, Brep can sometimes be easier to use. For example, Brep is more convenient for the following tasks:

  • CAD editing such as fillets and chamfers
  • Dimension change
  • Drawing
  • Creating a CAD model to generate an analysis mesh
  • Data integration with other CAD systems

However, simply being able to convert to Brep is not enough. The required shape will differ depending on the intended use of the converted file.

When editing based on shape characteristics, such as changing dimensions or hole diameters, Breps organized according to the shape characteristics of planes or cylindrical surfaces are easier to handle. On the other hand, for design surfaces or organic shapes, the degree of agreement with the original Mesh and the smoothness of curved surfaces become important.

When used for numerical analysis, Brep is used as the shape from which the analysis mesh is generated. Therefore, it is important not only that the original shape is reproduced accurately, but also that there are no minute gaps or overlapping surfaces, and that the analysis mesh can be generated stably.

Thus, the conversion from Mesh to Brep should be considered not merely as a file format conversion, but as a process of reconstructing the shape to suit the intended use.

Typical approaches to creating Breps from Mesh

There are various methods for creating a Brep from a Mesh, ranging from directly converting the Mesh faces into Breps to recreating the shape as a CAD model while referencing the original shape.

Depending on the method used, the resulting Brep's surface configuration, its relationship to the original Mesh, and the editing methods after conversion will differ.

Below, we will introduce six representative approaches, along with their underlying concepts and practical examples.

1. Convert to primitive Brep.

This method involves detecting simple shapes such as planes, cylinders, spheres, and cones from a mesh and combining them to create a Brep.

The advantage of this method is that Brep is simple and easy to edit in CAD. On the other hand, it is difficult to represent freeform surfaces and complex shapes with only a small number of primitive shapes.

This method is suitable for shapes with many flat or cylindrical surfaces, such as machine parts.

Example

Generally, a common method involves extracting regions such as planes and cylindrical surfaces from a mesh and reconstructing them as primitive CAD surfaces. In this case, to clearly demonstrate the fitting process, we used a fitting method that minimizes the sum of the squared distances between the sampling points on the mesh and the Brep by varying the parameters of the Brep shape.

GIF 1
GIF 2
GIF 3

Mesh

Mesh

Brep

Brep

Mesh
Brep
Mesh
Brep

2. Convert each face of the mesh directly into a NURBS patch.

This method involves Brepping each face of a mesh as a corresponding NURBS face or a trimmed NURBS face.

The implementation is relatively simple, and it achieves a high degree of consistency with the original mesh shape.

On the other hand, the more faces a Mesh has, the more faces a Brep will have, resulting in very large file sizes. Also, since the face configuration is almost the same as the original Mesh, it may not result in a shape that is easy to edit in CAD.

This method is effective when you want to convert to Brep format while largely maintaining the shape, but caution is advised when using it as a model for design editing.

Example

Mesh

Mesh

Brep

Brep

Mesh
Brep

3. Remesh and then apply Brep.

This method involves first remeshing the original mesh into a Quad Mesh or similar, and then converting it to a Brep based on its surface structure.

Compared to the method of converting each face of the mesh directly into a Brep, this method makes it easier to reduce the number of faces and also tidies up the flow of curved surfaces. However, the surface configuration of the resulting Brep is highly dependent on the remeshing result.

Example

Mesh

GIF 1

Finely remeshed

GIF 2

Coarsely remeshed

GIF 3

GIF 1
GIF 2
GIF 3

4. Fit the NURBS surface to the mesh.

This method approximates a smooth NURBS surface by referencing the vertices and faces of a mesh.

If the mesh is properly remeshed and fitted, it may be possible to represent it as a Brep with a smoother surface and fewer faces than the original mesh.

On the other hand, it is necessary to set how to divide the curved surface, how many control points to use, and how much approximation error to allow.

This is suitable for applications where smoothness is important, such as freeform surfaces or decorative surfaces.

Example

Mesh

GIF 1

Brep after remesh

GIF 2

Brep after fitting

GIF 3

GIF 1
GIF 2
GIF 3

5. Convert to Brep via SubD

This method involves first converting the mesh to SubD, and then to Brep.

SubD is a representation method that creates smooth curved surfaces based on polygon shapes. Because it can represent smooth shapes with relatively few control points, it does not directly inherit the detailed surface configuration of Mesh, and is easy to convert to Brep as a streamlined curved surface. CAD software such as Rhinoceros provides functions to convert from Mesh to SubD and from SubD to Brep.

This method is suitable for organic and smooth shapes. However, since it approximates the original mesh, caution is needed if you want to preserve sharp edges or flat surfaces.

Example

The conversion is performed using the Rhinoceros ToSubD and ToNurbs commands.

Mesh

GIF 1

Remesh ⇒ SubD

GIF 2

Brep

GIF 3

GIF 1
GIF 2
GIF 3

6. Reconstruct from the cross-sectional curve.

This method involves extracting cross-sectional curves and feature lines from a mesh and then recreating the Brep using CAD operations such as lofting, sweeping, and extruding.

Rather than directly converting the mesh, this method reconstructs the CAD model while referencing the mesh.

This method is suitable for cases where the shape creation method can be somewhat anticipated, such as pipe shapes, extruded shapes, and rotating bodies. While the resulting Breps are easy to edit, processing is required for each shape.

Example

Mesh

GIF 1

Feature lines

GIF 2

Brep

GIF 3

Characteristics of each approach

As explained above, each method for creating brepes from meshes has its own strengths in terms of shape and finished appearance.

While this example is not a rigorous performance comparison, it summarizes the characteristics and points to note for each approach, serving as a guide when choosing a method.

approach When to Consider It Features and points to note
1. Convert to primitive Brep. When you want to make a shape that can be represented by a plane, cylinder, or sphere into a shape that is easy to change the dimensions of. It's easy to obtain a simple Brep, but it's not suitable for reproducing freeform surfaces.
2. Convert each face of the mesh directly into a NURBS patch. If you want to convert to Brep while maintaining the original mesh shape as much as possible High degree of match with the mesh; large number of faces, tends to result in heavy data.
3. Remesh and then apply Brep. If you want to organize the number of surfaces and surface flow to create a Brep, or if you want to arrange the surface configuration for a later process. The number of faces can be reduced, and the shape may change due to remeshing.
4. Fit the NURBS surface to the mesh. When you want to approximate a freeform surface as a smooth Brep while adjusting the approximation accuracy and surface configuration. Appropriate settings for surface division methods and control points are necessary to smoothly approximate the shape.
5. Convert to Brep via SubD If you want to use the surface configuration of SubD to reconstruct the entire shape as a smooth curved surface and then convert it to Brep: Proper settings are necessary to smoothly approximate shapes while preserving sharp edges and planes.
6. Reconstruct from the cross-sectional curve. When you want to reconstruct shapes such as pipes, extruded shapes, and rotating bodies, where the cross-section and manufacturing method can be anticipated. It is necessary to consider a reconstruction method for each shape, so that it can be reconstructed as an easily editable CAD shape.

Points to note when converting Mesh to Brep

When actually converting a Mesh to a Brep, the quality of the Mesh before conversion is crucial.

If the original mesh contains holes, self-intersections, inverted normals, or non-manifold edges, the Brep conversion may not work correctly.

Therefore, the following modifications may be necessary before applying Brep.

  • Fill in the blanks
  • Removal of duplicate vertices
  • Unification of normal direction
  • Correction of non-manifold edges
  • Correction and removal of extremely elongated triangles
  • Noise smoothing

Furthermore, even if you can convert it to Brep, that doesn't necessarily mean it will be easy to use in CAD.

In particular, if each face of a mesh is directly converted into a Brep, it may look like a Brep, but in reality, it is a collection of a large number of small planar patches. Such data may not be suitable for editing in CAD or for post-processing.

The requirements of "being in Brep format" and "being easy to handle as a CAD model" need to be considered separately.

Summary

Converting from Mesh to Brep involves trade-offs between fidelity to the original shape, smoothness of curves, simplicity of surface configuration, and ease of editing.

If you want to preserve the original mesh as much as possible, you can use Brep on each face. If you want to approximate it as a smooth curved surface, you can use NURBS surface fitting or SubD. If you want to create an easily editable CAD shape, you can reconstruct it from primitives or section curves.

The important thing is not to make the conversion itself the goal, but to choose a method based on what operations you want to perform after the Brep conversion.

Shape-generation methods such as topology optimization and implicit modeling often produce their results as meshes. Similarly, shapes acquired through measurement techniques such as 3D scanning are commonly handled as point clouds or meshes.

To edit these shapes within an existing CAD workflow or reuse them as design data, it may be necessary to convert them into a Brep.

However, there is no single best way to convert a mesh into a Brep. The appropriate method depends on whether the goal is to reproduce the original mesh as accurately as possible or to obtain an editable CAD model.

This article provides an overview of common approaches for converting meshes into Breps and presents the results of applying several of these methods in practice.

Why Convert a Mesh into a Brep?

A Brep, or Boundary Representation, represents the boundary of a solid using faces, edges, and vertices. In general-purpose 3D CAD systems, Breps composed of planar surfaces, NURBS surfaces, and other surface types are widely used to represent design geometry.

A mesh, on the other hand, represents a shape as a collection of triangular or quadrilateral elements. Meshes are well suited to applications such as visualization and 3D printing.

For CAD operations and downstream processes, however, a Brep is often easier to work with. For example, Breps are generally more suitable for:

  • CAD operations such as filleting and chamfering
  • Modifying dimensions
  • Create engineering skills
  • Preparing CAD models for analysis mesh generation
  • Exchanging data with other CAD systems
  • Simply converting a shape into a Brep is not always sufficient. The characteristics required of the converted geometry depend on how it will be used.

    When feature-based editing is required, such as changing dimensions or modifying hole diameters, a Brep organized around geometric features such as planes and cylinders is easier to work with. For styling surfaces and organic shapes, however, fidelity to the original mesh and surface smoothness may be more important.

    When the geometry is used for numerical analysis, the Brep serves as the source geometry for generating an analysis mesh. In this case, it is important not only to reproduce the original shape accurately, but also to avoid small gaps, overlapping faces, and other defects that may prevent stable mesh generation.

    Converting a mesh into a Brep should therefore be regarded not merely as a file-format conversion, but as a process of reconstructing the geometry according to its intended use.

    Common Approaches for Creating a Brep from a Mesh

    There are many ways to create a Brep from a mesh. These range from directly converting individual mesh faces into Brep faces to reconstructing the geometry as a new CAD model while using the original mesh as a reference.

    Each method produces a different face structure, preserves a different relationship with the original mesh, and offers different levels of editability after conversion.

    The following sections introduce six representative approaches, together with their basic concepts and practical examples.

    1. Converting the Mesh into Primitive Brep Geometry

    This approach detects simple geometric shapes such as planes, cylinders, spheres, and cones within the mesh and reconstructs the geometry as a combination of these primitives.

    The main advantage is that the resulting Brep is simple and easy to edit in CAD. However, it is difficult to represent freeform or highly complex geometry using only a small number of primitive surfaces.

    This method is particularly suitable for mechanical components that contain many planar and cylindrical surfaces.

    example

    A common approach is to identify planar, cylindrical, and other geometric regions within the mesh and reconstruct them as primitive CAD surfaces.

    In this example, to clearly visualize the fitting process, the parameters of the Brep geometry were varied to minimize the sum of squared distances between sampled points on the mesh and the Brep.

    GIF 1
    GIF 2
    GIF 3

    Mesh

    Mesh

    Brep

    Brep

    Mesh
    Brep
    Mesh
    Brep

    2. Converting Each Mesh Face into a NURBS Patch/h3>
    This method converts each mesh face into a corresponding NURBS surface or trimmed NURBS surface within a Brep.

    The implementation is relatively straightforward, and the resulting Brep closely matches the original mesh geometry.

    However, as the number of mesh faces increases, the number of Brep faces also increases, which can make the data extremely large and computationally expensive. Because the face structure remains almost identical to that of the original mesh, the resulting geometry is not necessarily easy to edit in CAD.

    This approach is useful when the primary objective is to preserve the original geometry while converting it into the Brep format. However, care is required when the model is intended for design editing.

    example

    Mesh

    Mesh

    Brep

    Brep

    Mesh
    Brep

    3. Remeshing before Converting to a Brep

    In this approach, the original mesh is first remeshed, for example as a quad mesh, and then converted into a Brep based on the new face structure.

    Compared with directly converting every face of the original mesh, this approach makes it easier to reduce the strongly number of faces and organize the surface flow. However, the face structure of the resulting Brep depends on the remeshing result.

    example

    Mesh

    GIF 1

    Fine remeshing

    GIF 2

    Coarse remeshing

    GIF 3

    GIF 1
    GIF 2
    GIF 3

    4. Fitting NURBS Surfaces to the Mesh

    This method uses the vertices or faces of the mesh as reference data and fits smooth NURBS surfaces to them.

    When the mesh is appropriately remeshed and fitted, the geometry can sometimes be represented as a smoother Brep with fewer faces than the original mesh.

    However, several parameters must be determined, including how the surface should be divided, how many control points should be used, and how much approximation error is acceptable.

    This approach is suitable for freeform and styling surfaces where smoothness is a primary concern.

    example

    Mesh

    GIF 1

    Brep after remeshing

    GIF 2

    Brepjust fitting

    GIF 3

    GIF 1
    GIF 2
    GIF 3

    5. Converting through SubD

    This method first converts the mesh into a SubD model and then converts the SubD geometry into a Brep.

    SubD is a representation that generates smooth surfaces from polygonal control geometry. Because it can describe smooth shapes using relatively few control points, it is useful for reconstructing a mesh as an organized surface model without directly preserving every small mesh face.

    CAD software such as Rhinoceros provides functions for converting a mesh into SubD geometry and then converting the SubD model into a Brep.

    This approach is suitable for smooth, organic shapes. However, because the resulting geometry is an approximation of the original mesh, care is required when sharp edges or planar surfaces must be preserved.

    example

    The geometry was converted using the ToSubD and ToNURBS commands in Rhinoceros.

    Mesh

    GIF 1

    Remeshing → SubD

    GIF 2

    Brep

    GIF 3

    GIF 1
    GIF 2
    GIF 3

    6. Reconstructing the Geometry from Section Curves

    This approach extracts section curves or feature lines from the mesh and reconstructs the Brep using CAD operations such as lofting, sweeping, and extrusion.

    Rather than directly converting the mesh, this method uses the mesh as a reference for rebuilding the CAD model.

    It is suitable for geometries whose construction method can be inferred, such as pipes, extruded shapes, and solids of revolution. The resulting Brep is generally easy to edit, but a reconstruction strategy must be developed for each type of geometry.

    example

    Mesh

    GIF 1

    Feature lines

    GIF 2

    Brep

    GIF 3

    Characteristics of Each Approach

    As discussed above, each method for creating a Brep from a mesh is suited to different types of geometry and produces different results.

    The examples presented in this article are not intended as a rigorous performance comparison. However, the following table summarizes the main characteristics and considerations of each approach as a practical guide for selecting a method.

    Approach When to Consider It Characteristics and considerations
    1.Convert to primitive Brep geometry When the shape can be represented using planes, cylinders, spheres, and other primitives, and dimensional editability is required Produces a relatively simple Brep; not suitable for accurately reproducing freeform surfaces
    2. Convert each mesh face into a NURBS patch When the original mesh geometry should be preserved as closely as possible High geometric fidelity; the large number of faces can make the model heavy and difficult to edit
    3. Remesh before converting to a Brep When the number and flow of faces should be reorganized before conversion or downstream processing Can reduce the number of faces; remeshing may alter the original geometry
    4.Fit NURBS surfaces to the mesh When a freeform shape should be approximated as a smooth Brep while controlling approximation accuracy and surface structure Can produce a smooth approximation; requires appropriate surface segmentation and control-point settings
    5. Convert through SubD When the overall shape should be reconstructed as a smooth surface using a SubD-based face structure/td>

    Can produce a smooth approximation; preserving sharp edges and planar regions requires appropriate settings
    6. Reconstruct from section curves When the geometry can be described using sections or known construction methods, such as pipes, extrusions, or revolved shapes Produces an editable CAD model; the reconstruction procedure must be designed for each geometry

    Considerations When Converting a Mesh into a Brep

    The quality of the input mesh is important when converting it into a Brep.

    If the original mesh contains holes, self-intersections, flipped normals, non-manifold edges, or other defects, the conversion may fail or produce invalid geometry.

    The following preprocessing operations may therefore be required before conversion:

  • Filling holes
  • Removing duper vertices
  • Unifying face-normal directions
  • Repairing non-manifold edges
  • Repairing or removing extremely thin triangles
  • Smoothing noise
  • Even when a mesh can be successfully converted into a Brep, the result is not necessarily easy to use in CAD.

    In particular, when every mesh face is directly converted into a Brep face, the model may technically be a Brep while effectively remaining a collection of numerous small planar patches. Such data may not be suitable for CAD editing or downstream processing.

    It is therefore important to distinguish between geometry that is merely stored in the Brep format and geometry that is practical to use as a CAD model.

    Conclusion

    When converting a mesh into a Brep, there are trade-offs between fidelity to the original geometry, surface smoothness, simplicity of the face structure, and ease of editing.

    If preserving the original mesh as closely as possible is the main objective, directly converting individual mesh faces may be appropriate. If a smooth surface approximation is required, NURBS surface fitting or a SubD-based workflow may be more suitable. If the goal is to obtain an editable CAD model, reconstruction using primitive geometry or section curves may be the better option.

    The key is not to treat conversion itself as the objective, but to select the method based on the operations that need to be performed after the geometry has been converted into a Brep.

    Author