geom

GeomDash

Inherits: Resource

Assign one to a shape's dash slot to dash it; leave the slot empty for a solid shape.

Drawing it

The code behind the picture above, where vp is the picture's size, c is its centre, r is 30% of its height.

GeomDraw.dashed = true
GeomDraw.dash_space = Geom.DASH_FIXED_COUNT
GeomDraw.dash_size = 11.0
GeomDraw.dash_spacing = 0.45
GeomDraw.thickness = vp.y * 0.075
GeomDraw.ring_2d_colored(c, r, AMBER)
GeomDraw.dashed = false

Properties

DashType dash_type Geom.DASH_BASIC
float modifier 0.0
float offset 0.0
float size 1.0
DashSnap snap Geom.SNAP_TILING
DashSpace space Geom.DASH_RELATIVE
float spacing 1.0

Enumerations

enum Geom.DashSpace

Geom.DASH_METERS = 0
Dash size and spacing are lengths in the shape's own units.
Geom.DASH_RELATIVE = 1
Dash size and spacing are multiples of the wall thickness.
Geom.DASH_FIXED_COUNT = 2
Dash size is a repeat count; spacing is the empty fraction of a period.

enum Geom.DashSnap

Geom.SNAP_OFF = 0
Use the dash period as given.
Geom.SNAP_TILING = 1
Round to a whole number of periods so the pattern tiles seamlessly.
Geom.SNAP_END_TO_END = 2
Round so a dash lands at each end of the shape.

enum Geom.DashType

Geom.DASH_BASIC = 0
Square dash ends.
Geom.DASH_ANGLED = 1
Dash ends sheared into a parallelogram. The shear is 0 by default, which looks exactly like DASH_BASIC; set dash_modifier on GeomDraw, or modifier on GeomDash.
Geom.DASH_ROUNDED = 2
Rounded dash ends.

Property descriptions

DashType dash_type = Geom.DASH_BASIC

The shape of each dash: Basic square ends, Angled, or Rounded.

float modifier = 0.0

Shear amount for angled dashes, -1 to 1.

float offset = 0.0

Shifts the pattern by whole periods; integers look identical.

float size = 1.0

Length of one dash, read in space — which defaults to Relative, where it is a multiple of the wall's thickness and not a length. A length in Meters; a repeat count in FixedCount.

DashSnap snap = Geom.SNAP_TILING

Whether the pattern is stretched to fit the shape it runs along.

DashSpace space = Geom.DASH_RELATIVE

How size and spacing are read: the shape's own units, multiples of the wall's thickness, or a count of repeats around the shape.

float spacing = 1.0

Gap between dashes, read the same way as size: multiples of the wall in Relative, a length in Meters, the empty fraction of each period in FixedCount.