Expand description
Generate hatching and dotted patterns in a path.
§Example
ⓘ
// Generate a path representing a hatching of the original path.
let mut hatches = Path::builder();
let mut hatcher = Hatcher::new();
hatcher.hatch_path(
original_path.iter(),
&HatchingOptions::DEFAULT,
&mut RegularHatchingPattern {
interval: 1.0,
callback: &mut|segment: &HatchSegment| {
hatches.add_line_segment(&LineSegment {
from: segment.a.position,
to: segment.b.position,
});
},
},
);
let hatched_path = hatches.build();
Structs§
- Dot
- DotOptions
- Parameters for generating dot patterns.
- Hatch
Endpoint - Hatch
Segment - Hatcher
- A context object that can fill a path with a hatching or dot pattern.
- Hatching
Options - Parameters for the hatcher.
- Regular
DotPattern - A
DotBuilder
implementation for dot patterns with constant intervals. - Regular
Hatching Pattern - A
HatchBuilder
implementation for hatching patterns with constant intervals.
Traits§
- DotBuilder
- The output of
Hatcher::dot_path
. - Hatch
Builder - The output of
Hatcher::hatch_path
.