dessin
dessin is library aimed at building complex drawings, combine them, move them and export them as PDF or SVG.
Details about the [macro][crate::macros].
Example
use *;
use ;
Components
[Base components][crate::shapes] are defined in the shapes module.
[Components using base ones][crate::contrib] are defined in the contrib module.
In dessin, a component is just a struct/enum that can be converted to a [Shape][crate::shapes::Shape],
and implements the [Default][std::default::Default] trait.
This means that a component can be as simple as:
use *;
Since the [dessin!][dessin_macros::dessin] macro is only syntactic sugar for creating a [Shape][crate::shapes::Shape],
all parameters are simply rust function with the following signature: fn (&mut self, argument_value: ArgumentType) {...}.
It can be tedious to create these function for all parameters, so the derive macro [Shape][dessin_macro::shape]
is here to do exactly that.
So
becomes
To be precise, all functions generated by this derive macro, return &mut Self to chain function together.
Generated functions have the same name as their corresponding field.
This derive macro also generate corresponding with_xxxx, taking self instead of &mut self and returning Self.
One still does need to implement From<MyComponent> for Shape { ... } manually.
Implement own export format.
Documentation can be found in the [export] module.
License: MIT