mesh.Mesh.cut_with_plane#

Mesh.cut_with_plane(p, n, side='+', closed=False)#

Cut a Mesh with a plane.

This method delegates to hybridmesh.HybridMesh.cut_with_plane(). See that method for full documentation.

See Also#

  • clip_with_plane(): Similar operation, but only keeps complete elements on one side of the plane without modifying or generating new ones.

Examples#

>>> cube = Mesh(eltype='hex8').border_mesh().convert('tri3')
>>> half = cube.cut_with_plane([0.5, 0.0, 0.0], [1.0, 0.0, 0.0])
>>> print(half)
Mesh: n_nodes: 12, n_elems: 14, plexitude: 3, level: 2, eltype: tri3
  BBox: [0.5 0.  0. ], [1. 1. 1.]
  Size: [0.5 1.  1. ]
  Length: 4.0  Area: 3.0
>>> half_closed = cube.cut_with_plane([0.5, 0.0, 0.0],
...                                   [1.0, 0.0, 0.0],
...                                   side='-',
...                                   closed=True)
>>> print(half_closed)
Mesh: n_nodes: 12, n_elems: 20, plexitude: 3, level: 2, eltype: tri3
  BBox: [0. 0. 0.], [0.5 1.  1. ]
  Size: [0.5 1.  1. ]
  Length: 0.0  Area: 4.0