Style Enumerations

viren2d.LineCap

Enumeration specifying how to render the endpoints of a line/dash stroke.

viren2d.LineJoin

Enumeration specifying how to render the junction of two lines/segments.

viren2d.Marker

Enumeration specifying the marker shape.

Line Cap

class viren2d.LineCap

Enumeration specifying how to render the endpoints of a line/dash stroke.

Explicit instantiation:
>>> cap = viren2d.LineCap.Round
Implicit conversion:
>>> style = viren2d.LineStyle()
>>> style.cap = 'round'

Line Cap Styles

Corresponding C++ API: viren2d::LineCap.

Members:

Butt :

Start/stop the line exactly at the start/end point.

Round :

Round ending, center of the circle is the end point.

Square :

Square ending, center of the square is the end point.

Line Join

class viren2d.LineJoin

Enumeration specifying how to render the junction of two lines/segments.

Explicit instantiation:
>>> join = viren2d.LineJoin.Round
Implicit conversion:
>>> style = viren2d.LineStyle()
>>> style.join = 'round'

Line Join Styles

Corresponding C++ API: viren2d::LineJoin.

Members:

Miter :

Sharp (angled) corner.

Bevel :

The join is cut off at half the line width from the joint point.

Round :

Rounded join, where the center of the circle is the joint point.

Marker Shapes

class viren2d.Marker

Enumeration specifying the marker shape.

Explicit instantiation:
>>> marker = viren2d.Marker.Star
Implicit conversion:
>>> style = viren2d.MarkerStyle()
>>> style.marker = '*'

All supported marker shapes are shown below and can also be listed via list_all().

Available Marker Shapes

Corresponding C++ API: viren2d::Marker.

Members:

Point :

Point, i.e. a filled circle, char representation: '.'.

Circle :

A circle (not filled), char representation: 'o'.

Plus :

Plus sign, char representation: '+'.

Cross :

Cross marker, char representation: 'x'.

Square :

Square marker, char representation: 's'.

RotatedSquare :

Rotated square (a thick diamond), char representation: 'S'.

Diamond :

Diamond marker, char representation: 'd'.

Reticle :

A plus with a \(\text{thickness} \times \text{thickness}\) hole in the middle, char representation: 'r'. The hole will always be at least \(4 \times 4\) pixels.

RotatedReticle :

A cross with a \(\text{thickness} \times \text{thickness}\) hole in the middle, char representation: 'R'. The hole will always be at least \(4 \times 4\) pixels.

Star :

Five-pointed star (Asterisk), char representation: '*'.

Pentagon :

Five-sided polygon, char representation: 'p'.

Pentagram :

Five-pointed star, char representation: '5'.

Hexagon :

Six-sided polygon, char representation: 'h'.

Hexagram :

Six-pointed star, char representation: '6'.

Heptagon :

Seven-sided polygon, char representation: 'H'.

Heptagram :

Seven-pointed star, char representation: '7'.

Octagon :

Eight-sided polygon, char representation: '0' (i.e. zero).

Octagram :

Eight-pointed star, char representation: '8'.

Enneagon :

Nine-sided polygon (Nonagon), char representation: 'n'.

Enneagram :

Nine-pointed star, char representation: '9'.

TriangleUp :

Upward-pointing triangle marker, char representation: '^'.

TriangleDown :

Downward-pointing triangle marker, char representation: 'v'.

TriangleLeft :

Left-pointing triangle marker, char representation: '<'.

TriangleRight :

Right-pointing triangle marker, char representation: '>'.

static list_all() List[viren2d.Marker]

Returns all Marker values.

Convenience utility to easily iterate all enumeration values.

Corresponding C++ API: viren2d::ListMarkers.