Direction constants

bosl2.constants.INCH: float = 25.4

The number of millimeters in an inch.

bosl2.constants.IDENT: list[list[float]] = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]

Identity transformation matrix for three-dimensional transforms. Equal to ident(4).

class bosl2.constants.Vec3(iterable=(), /)[source]

Bases: list

A 3-element list that supports elementwise +/-/* like a vector.

Plain Python lists use + for concatenation and * for repetition, but BOSL2-style code combines direction constants with idioms like anchor=TOP+LEFT expecting elementwise vector addition ([0,0,1]+[-1,0,0] -> [-1,0,1]), not concatenation. Subclassing list (rather than using a plain tuple or a numpy array) keeps every other list behavior – indexing, iteration, equality with plain lists, and crossing the osuse()/PyOpenSCAD FFI boundary – unchanged. (Duplicated from base_bgtk.py’s Vec3 rather than imported, since this package is deliberately independent of base_bgtk.py.)

bosl2.constants.LEFT: Vec3 = [-1, 0, 0]

Left align/anchor the object.

bosl2.constants.RIGHT: Vec3 = [1, 0, 0]

Right align/anchor the object.

bosl2.constants.FRONT: Vec3 = [0, -1, 0]

Front align/anchor the object.

bosl2.constants.FORWARD: Vec3 = [0, -1, 0]

Forward align/anchor the object.

bosl2.constants.BACK: Vec3 = [0, 1, 0]

Back align/anchor the object.

bosl2.constants.BOTTOM: Vec3 = [0, 0, -1]

Bottom align/anchor the object.

bosl2.constants.DOWN: Vec3 = [0, 0, -1]

Down align/anchor the object.

bosl2.constants.TOP: Vec3 = [0, 0, 1]

Top align/anchor the object.

bosl2.constants.UP: Vec3 = [0, 0, 1]

Up align/anchor the object.

bosl2.constants.CENTER: Vec3 = [0, 0, 0]

Center align/anchor the object.

bosl2.constants.SEGMENT: list[bool] = [True, True]

Treat a line as a segment.

bosl2.constants.RAY: list[bool] = [True, False]

Treat a line as a ray, based at the first point.

bosl2.constants.LINE: list[bool] = [False, False]

Treat a line as an unbounded line.