parry3d/transformation/mesh_intersection/
mesh_intersection_error.rs

1use crate::shape::TriMeshBuilderError;
2
3#[cfg(doc)]
4use crate::shape::{TriMesh, TriMeshFlags};
5
6/// Error indicating that a query is not supported between certain shapes
7#[derive(thiserror::Error, Debug, Copy, Clone, Eq, PartialEq)]
8pub enum MeshIntersectionError {
9    /// At least one of the meshes is missing its topology information. Ensure that the [`TriMeshFlags::ORIENTED`] flag is enabled on both meshes.
10    #[error("at least one of the meshes is missing its topology information. Ensure that the `TriMeshFlags::ORIENTED` flag is enabled on both meshes.")]
11    MissingTopology,
12    /// At least one of the meshes is missing its pseudo-normals. Ensure that the [`TriMeshFlags::ORIENTED`] flag is enabled on both meshes.
13    #[error("at least one of the meshes is missing its pseudo-normals. Ensure that the `TriMeshFlags::ORIENTED` flag is enabled on both meshes.")]
14    MissingPseudoNormals,
15    /// Internal failure while intersecting two triangles
16    #[error("internal failure while intersecting two triangles")]
17    TriTriError,
18    /// Internal failure while merging faces resulting from intersections
19    #[error("internal failure while merging faces resulting from intersections")]
20    DuplicateVertices,
21    /// Internal failure while triangulating an intersection face
22    #[error("internal failure while triangulating an intersection face")]
23    TriangulationError,
24    /// See [`TriMeshBuilderError`]
25    #[error("TriMeshBuilderError: {0}")]
26    TriMeshBuilderError(TriMeshBuilderError),
27}
28
29impl From<TriMeshBuilderError> for MeshIntersectionError {
30    fn from(value: TriMeshBuilderError) -> Self {
31        MeshIntersectionError::TriMeshBuilderError(value)
32    }
33}