OpenCascadeLink`
OpenCascadeLink`

OpenCascadeShapeSurfaceMeshToBoundaryMesh

OpenCascadeShapeSurfaceMeshToBoundaryMesh[i]

converts an OpenCascadeShapeExpression i to a boundary ElementMesh.

Details and Options

  • OpenCascadeShapeSurfaceMeshToBoundaryMesh[r] generates an ElementMesh object that approximates an OpenCascade region instance i.
  • The specification for regions instances i is described in Using OpenCascadeLink.
  • OpenCascadeShapeSurfaceMeshToBoundaryMesh has the following options:
  • "ElementMeshOptions"Automaticspecify options for ElementMesh
    "MarkerMethod" Automaticspecify the method for adding markers
    "ShapeSurfaceMeshOptions"Automaticspecify options for OpenCascadeShapeSurfaceMesh
  • All options for ElementMesh can be specified through the "ElementMeshOptions".
  • For "MarkerMethod" the following Methods can be specified:
  • "OpenCascade"OpenCascade provides markers
    "ElementMesh"ElementMesh provides markers
    Noneno markers are added
  • The default "MarkerMethod" is "OpenCascade".
  • OpenCascadeShapeSurfaceMeshToBoundaryMesh has the following options:
  • "AngularDeflection"Automaticspecify the maximum deflection angle
    "ComputeInParallel"Automaticparallel surface discretization
    "LinearDeflection"Automaticspecify the maximum deflection
    "Rediscretization"Automaticreuse a discretization
    "RelativeDeflection"Automaticspecify if deflection is relative or absolute
  • The default "AngularDeflection" is set to 0.5 degrees.
  • "ComputeInParallel" specifies if the surface discretization should be performed on multiple CPU cores. The Automatic default is set to False.
  • The default "LinearDeflection" is set to 0.01 units of the relative size of the shape.
  • "Rediscretization" specifies if one of the input shapes already as a discretization attached to it if that discretization is to be reused. The Automatic default is set to False.
  • "RelativeDeflection" specifies if the deflection is relative or absolute to the size of the geometry. The Automatic default is set to True.

Examples

open allclose all

Basic Examples  (1)

Load the package:

Generate a boundary element mesh for a Ball:

Visualize the boundary element mesh wireframe:

Options  (4)

"AngularDeflection"  (1)

Create an OpenCascade shape:

Discretize and visualize the boundary discretization:

Extract a boundary ElementMesh from the OpenCascade shape with a refined surface mesh:

Visualize the boundary ElementMesh extracted from the OpenCascade shape:

"LinearDeflection"  (1)

Create an OpenCascade shape:

Discretize and visualize the boundary discretization:

Extract a boundary ElementMesh from the OpenCascade shape with a refined surface mesh:

Visualize the boundary ElementMesh extracted from the OpenCascade shape:

"MarkerMethod"  (1)

The "MarkerMethod" option allows to specify if markers should be added and how they should be computed. The default is to use "OpenCascade". Other options are "ElementMesh" and None to switch off markers entirely. Using "ElementMesh" as a "MarkerMethod" option can be useful if the generated surface consists of many single surface elements. In that case the "OpenCascade" method would attribute each element a unique marker which may be undesirable. With the method "ElementMesh", however, the markers are added based on their face normals and if those deviate by a certain amount. The ToBoundaryMesh reference page has more information on this topic.

Import a STL file:

Extract the boundary mesh:

Visualize the boundary ElementMesh:

Note that an import of a STL file with OpenCascadeShapeImport will result in a boundary mesh that has unique markers assigned to each surface element. Inspect the boundary element markers:

This may not be wanted. To avoid that the options "MarkerMethod""ElementMesh" or "MarkerMethod"None may be specified. Extract the boundary mesh and have the markers computed in the Wolfram language:

Inspect the boundary element markers:

Visualize the boundary ElementMesh with markers highlighted:

Create a shape and do not insert markers at all:

"Rediscretization"  (1)

This functionality is useful to have different levels of discretization on different parts in a multi material object. An example is given in the section Internal boundaries refinement by sewing.

Create a shape and a fine discretization:

When "Rediscretization" is set to False a possibly existing discretization is made use of regardless of the requested coarsens:

Compare to a discretization that re-discretizes the geometry:

Properties & Relations  (1)

The default length unit for shapes generated with OpenCascade is millimeter:

Wolfram Research (2020), OpenCascadeShapeSurfaceMeshToBoundaryMesh, Wolfram Language function, https://reference.wolfram.com/language/OpenCascadeLink/ref/OpenCascadeShapeSurfaceMeshToBoundaryMesh.html.

Text

Wolfram Research (2020), OpenCascadeShapeSurfaceMeshToBoundaryMesh, Wolfram Language function, https://reference.wolfram.com/language/OpenCascadeLink/ref/OpenCascadeShapeSurfaceMeshToBoundaryMesh.html.

CMS

Wolfram Language. 2020. "OpenCascadeShapeSurfaceMeshToBoundaryMesh." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/OpenCascadeLink/ref/OpenCascadeShapeSurfaceMeshToBoundaryMesh.html.

APA

Wolfram Language. (2020). OpenCascadeShapeSurfaceMeshToBoundaryMesh. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/OpenCascadeLink/ref/OpenCascadeShapeSurfaceMeshToBoundaryMesh.html

BibTeX

@misc{reference.wolfram_2025_opencascadeshapesurfacemeshtoboundarymesh, author="Wolfram Research", title="{OpenCascadeShapeSurfaceMeshToBoundaryMesh}", year="2020", howpublished="\url{https://reference.wolfram.com/language/OpenCascadeLink/ref/OpenCascadeShapeSurfaceMeshToBoundaryMesh.html}", note=[Accessed: 18-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_opencascadeshapesurfacemeshtoboundarymesh, organization={Wolfram Research}, title={OpenCascadeShapeSurfaceMeshToBoundaryMesh}, year={2020}, url={https://reference.wolfram.com/language/OpenCascadeLink/ref/OpenCascadeShapeSurfaceMeshToBoundaryMesh.html}, note=[Accessed: 18-March-2025 ]}