dimforge / dimforge/parry

Not all Shapes implement PartialEq<Self>

Open
#51 2 comments 0 reactions 0 assignees View on GitHub
C-User experience D-Medium P-Medium
Dominant language
Rust
Stars
867
Forks
157
Avg merge
7d 13h
Merged PRs (30d)
2

Description

As of the 0.7 release:

2D Shapes that implement PartialEq:
- Ball
- Cuboid
- Segment
- Triangle
- HalfSpace

2D Shapes that don't implement PartialEq:
- Capsule
- TriMesh
- Polyline
- HeightField
- Compound
- ConvexPolygon
- RoundCuboid
- RoundTriangle
- RoundConvexPolygon

3D Shapes that implement PartialEq:
- Ball
- Cuboid
- Segment
- Triangle
- HalfSpace
- ConvexPolyhedron
- Cylinder
- Cone

3D Shapes that don't implement PartialEq:
- Capsule
- TriMesh
- Polyline
- HeightField
- Compound
- RoundCuboid
- RoundTriangle
- RoundCylinder
- RoundCone
- RoundConvexPolyhedron

I don't understand why some of these shapes don't implement `PartialEq`. Is there any particular reason for this?

Compound would be harder because of SharedShape, but the rest mostly seem like they could derive it.

RoundShape could implement it with the following:
```rust
impl PartialEq for RoundShape {
fn eq(&self, other: &Self) -> bool {
self.border_radius == other.border_radius && self.base_shape == other.base_shape
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.