I noticed today that there's a difference in behavior between Rect::from_points and Box2D::from_points.
Rect::from_points if given a single point will create a 0-sized rect whose origin is the single given point, this is exactly what I would have expected:
Are you open to changing the behavior on Box2D / Box3D? This is very unexpected behavior for me, especially considering a zero volume box can't really sensibly be an error condition (at least in the way it works now):
let p = Point2D::new(1., 2.);
// Box is [(0, 0), (0, 0)]
let b1 = Box2D::from_points([p].iter().copied());
// Box is zero volume box [(1, 2), (1, 2)]
let b2 = Box2D::from_points([p, p].iter().copied());
I noticed today that there's a difference in behavior between
Rect::from_points
andBox2D::from_points
.Rect::from_points
if given a single point will create a 0-sized rect whose origin is the single given point, this is exactly what I would have expected:https://docs.rs/euclid/0.20.6/src/euclid/rect.rs.html#279-311
However,
Box2D::from_points
if given a single point will returnBox2D::zero()
, which is entirely not what I would have expected:https://docs.rs/euclid/0.20.6/src/euclid/box2d.rs.html#284-329
Are you open to changing the behavior on
Box2D
/Box3D
? This is very unexpected behavior for me, especially considering a zero volume box can't really sensibly be an error condition (at least in the way it works now):