Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/shape/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,14 @@ impl Shape for TriMesh {
Real::frac_pi_4()
}

fn feature_normal_at_point(
&self,
feature: FeatureId,
point: &Point<Real>,
) -> Option<Unit<Vector<Real>>> {
self.feature_normal_at_point(feature, point)
}

#[cfg(feature = "std")]
fn as_composite_shape(&self) -> Option<&dyn SimdCompositeShape> {
Some(self as &dyn SimdCompositeShape)
Expand Down
15 changes: 15 additions & 0 deletions src/shape/trimesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,21 @@ impl TriMesh {
)
})
}

#[cfg(feature = "dim3")]
/// Gets the normal of the triangle represented by `feature`.
pub fn feature_normal_at_point(
&self,
feature: FeatureId,
_point: &Point<Real>,
) -> Option<Unit<Vector<Real>>> {
match feature {
FeatureId::Face(i) => self
.triangle(i % self.num_triangles() as u32)
.feature_normal(FeatureId::Face(0)),
_ => None,
}
}
}

impl TriMesh {
Expand Down
Loading