From a9d5afdcbd7f55a7478a2461c0756f3c200d9d88 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 11 Oct 2022 14:53:24 +0200 Subject: [PATCH] Document convenient syntax for `fj::Sketch` --- crates/fj/src/shape_2d.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crates/fj/src/shape_2d.rs b/crates/fj/src/shape_2d.rs index b632c2fa2..eace76646 100644 --- a/crates/fj/src/shape_2d.rs +++ b/crates/fj/src/shape_2d.rs @@ -84,6 +84,17 @@ impl From for Shape2d { /// Nothing about these edges is checked right now, but algorithms might assume /// that the edges are non-overlapping. If you create a `Sketch` with /// overlapping edges, you're on your own. +/// +/// # Examples +/// +/// Convenient syntax for this operation is available through [`crate::syntax`]. +/// +/// ``` rust +/// use fj::syntax::*; +/// +/// // `a` and `b` can be anything that converts to `fj::Shape` +/// let sketch = [[0., 0.], [1., 0.], [0., 1.]].sketch(); +/// ``` #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[repr(C)]