shapes#

This module provides convenience functions for constructing Mesh objects representing common geometric primitives, such as line segments, arcs, circles, rectangles, cuboids, spheres, and cylinders. Most functions offer options for subdivision and element type, making these shapes suitable as building blocks for more complex geometries or for quick prototyping.

1D/2D shapes#

These shapes are 1D line or 2D surface meshes. Some shapes like a circle can be represented both as a line (i.e. contour of the circle) and as a surface mesh (e.g. circle filled with triangles).

line_segment

Create a line segment between two points.

polyline

Create a polyline.

spline

Create a cubic Bezier spline through given points.

arc

Create a polygonal arc in the xy-plane.

circle

Create a polygonal circle in the xy-plane.

rectangle

Create a rectangle mesh in the xy-plane.

plane

Create a plane in 3D space.

3D primitives#

These are solid primitives that are at minimum 2D surfaces, but some can also be represented as full 3D volumetric meshes (e.g. with hex elements).

cuboid

Create a cuboid.

sphere

Create a triangular mesh approximating a sphere.

cylinder

Create a triangular mesh approximating a cylinder.