hobart¶
-
hobart.
faces_intersecting_plane
(vertices, faces, plane)[source]¶ Efficiently compute which of the given faces intersect the given plane.
Parameters: - vertices (np.ndarray) – The vertices, as a nx3 array.
- faces (np.ndarray) – The face indices, as a kx3 array.
- plane (polliwog.Plane) – The plane of interest.
Returns: - A boolean mask indicating the faces which intersect
the given plane.
Return type: np.ndarray
-
hobart.
intersect_mesh_with_plane
(vertices, faces, plane, neighborhood=None, ret_pointcloud=False)[source]¶ Takes a cross section of planar point cloud with a Mesh object. Ignore those points which intersect at a vertex - the probability of this event is small, and accounting for it complicates the algorithm.
When a plane may intersect the mesh more than once, provide a neighborhood, which is a set of points. The cross section closest to this list of points is returned (using a kd-tree).
Parameters: - vertices (np.ndarray) – The vertices, as a nx3 array.
- faces (np.ndarray) – The face indices, as a kx3 array.
- plane (polliwog.Plane) – The plane of interest.
- neighborhood (np.ndarray) – One or more points of interest, used to select the desired cross section when a plane may intersect more than once.
- ret_pointcloud (bool) – When True, return an unstructured point cloud instead of a list of polylines. This is useful when you aren’t specifying a neighborhood and you only care about e.g. some apex of the intersection.
Returns: A list of polliwog.Polyline instances.
Return type: list