Skip to main content

Crate deckcraft_geom

Crate deckcraft_geom 

Source
Expand description

DeckCraft geometry: units, shape transforms and preset shape generators.

The document model keeps positions in points (1/72 inch) as f64. Office Open XML stores EMU (English Metric Units, 12 700 per point); emu_to_pt and pt_to_emu convert losslessly for integer EMU values, so files round-trip exactly.

Modules§

morph
Morph between two outlines: one shape turns into another (a circle into a star).
preset
Preset shape geometry.
warp
WordArt text warps (DrawingML a:bodyPr/a:prstTxWarp).

Structs§

Affine
A 2D affine transform.
BezPath
A Bézier path.
Point
A 2D point.
Rect
A rectangle.
Size
A 2D size.
Vec2
A 2D vector.
Xfrm
A shape’s placement on its slide (or in its group’s child space): offset, extent, rotation (degrees clockwise) and flips. Rotation and flips are about the centre.

Enums§

PathEl
The element of a Bézier path.
Unit
Display units for measurements (inches on US English systems, centimetres elsewhere).

Constants§

EMU_PER_CM
EMU per centimetre.
EMU_PER_IN
EMU per inch.
EMU_PER_PT
EMU per point.

Traits§

KurboShape
A generic trait for open and closed shapes.

Functions§

dist_to_segment
Distance from p to the segment a–b.
emu_to_pt
group_child_affine
Maps a group’s child coordinate space (ch_off, ch_ext) onto the group’s own box.
near_path
Is p within tol of the outline of path (flattened)?
preset_flatten
Flatten a path to move/line/close elements (tolerance 0.2).
pt_to_emu
Points to EMU, rounded. Non-finite input becomes 0; huge values saturate.
snap
Snap v to the nearest multiple of step (step <= 0 returns v).