top of page

Offset triangular mesh

  • Peter Mortier
  • Mar 8
  • 1 min read

Updated: 2 days ago

Offsetting a triangular mesh refers to a 3D geometric operation where a secondary mesh is created at a uniform distance from the original triangular mesh. This offset is commonly used in 3D printing to generate thickness and to create hollow structures The offset process involves shifting each vertex along its normal direction while maintaining the connectivity of the triangular elements,


In this example, we will illustrate how to offset a triangular mesh with HelloTriangle, For this, we first create a sphere consisting of triangular elements, We create a kind of egg shape by scaling along the X direction. We then create a second triangular mesh (= outer) by offsetting the first one (= inner). Both meshes are then connected, resulting in prism elements. This mesh is subsequently clipped with a plane, so we can look inside the 3D model. For more information, please check the dedicated example on mesh clipping.


If you are interested to learn more about other tools to edit and analyse triangulated surfaces, please our post The online stl editor that redefines triangle mesh editing.


from hellotriangle import shapes

# create sphere and scale
inner = shapes.sphere(nx=72, ny=36).scale([2.0, 1.0, 1.0])

# offset sphere
outer = inner.offset(distance=0.1)

# create prism elements, by connecting inner and outer triangle mesh
prism = inner.connect(outer, div=1)

# clip mesh and draw
prismClipped = prism.clipAtPlane(p=[0.01 ,0.0 ,0.0], n=[1.0 ,0.0 ,0.0])

# draw
draw(prismClipped, color = "#2BB786")

Offset triangular mesh
Figure: Mesh obtained through offsetting a triangle mesh.

Subscribe to our newsletter

Join our email list and get updates about HelloTriangle. Unsubscribe anytime.

Thanks for submitting!

© 2024 by HelloTriangle

  • LinkedIn
bottom of page