mesh.Mesh.intersection_with_plane#
- Mesh.intersection_with_plane(p, n, atol=1e-05, sort='number')#
Return the intersection lines with plane (p,n).
Parameters#
- parray_like of shape (3,)
A point lying on the cutting plane.
- narray_like of shape (3,)
The normal vector defining the cutting plane.
- atol: float
Tolerance value to consider points lying in the plane. A small positive value is recommended in order to include triangle edges that happen to fall exactly in the cutting plane.
- sort: ‘number’ | ‘distance’
The sorting method for the connected components in the output Mesh. The default ‘number’ sorts in decreasing number of elements in the component. Setting to ‘distance’ will sort the parts according to increasing distance from the point p.
Returns#
- Mesh
The intersection of the triangulated surface with the plane. This is a Mesh of eltype ‘line2’. The line segments in the Mesh are ordered in a way to form continuous lines. The Mesh has property numbers such that all segments forming a single continuous part have the same property value. The parts are assigned property numbers according to their sort order.
Notes#
Currently only available for meshes with
eltype='tri3'.The split_prop() method can be used to get a list of separate Meshes.
Examples#
>>> cube = Mesh(eltype='hex8').border_mesh().convert('tri3') >>> inter = cube.intersection_with_plane([0.5, 0.0, 0.0], [1.0, 0.0, 0.0]) >>> print(inter) Mesh: n_nodes: 8, n_elems: 8, plexitude: 2, level: 1, eltype: line2 BBox: [0.5 0. 0. ], [0.5 1. 1. ] Size: [0. 1. 1.] Length: 4.0