From 7ae9145618a672492c89d0c3c4ef6c6b798f44db Mon Sep 17 00:00:00 2001 From: Dragos Daian Date: Mon, 14 Oct 2024 17:34:46 +0200 Subject: [PATCH] Update shared_shape.rs --- src/shape/shared_shape.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/shape/shared_shape.rs b/src/shape/shared_shape.rs index eb2beeff..78f88589 100644 --- a/src/shape/shared_shape.rs +++ b/src/shape/shared_shape.rs @@ -307,6 +307,15 @@ impl SharedShape { ConvexPolygon::from_convex_polyline(points).map(|ch| SharedShape(Arc::new(ch))) } + /// Creates a new shared shape that is a convex polygon formed by the + /// given set of points assumed to form a convex polyline (no convex-hull will be automatically + /// computed and no points will be removed). + /// Does not remove any points. + #[cfg(feature = "dim2")] + pub fn convex_polyline_from_points_raw(points: Vec>) -> Option { + ConvexPolygon::from_points(points).map(|ch| SharedShape(Arc::new(ch))) + } + /// Creates a new shared shape that is a convex polyhedron formed by the /// given set of points assumed to form a convex mesh (no convex-hull will be automatically /// computed).