drafting

drafting

0.1.0 2026-08-18

Planar geometry primitives, ASCII DXF reading and writing, and a format-agnostic technical drawing model with DXF and TikZ backends. Provides the drafting layer for engineering design packages.

Select Category:

Geometry primitives

geom.signedarea Signed area of a simple polygon.
geom.bbox Axis-aligned bounding box of a set of points.
geom.centroid Area centroid of a simple polygon.
geom.transform Apply a planar transformation to a set of points.
geom.isrectilinear True when every edge of a polygon is parallel to an axis.
geom.offset Offset a rectilinear polygon inward or outward.
geom.largestrect Largest axis-aligned rectangle inscribed in a rectilinear polygon.
geom.triangulate Triangulate a polygon, optionally one with holes.
geom.hatchlines The line segments that fill a boundary with a hatch pattern.

Curve geometry

geom.curvature Signed curvature of a sampled planar curve.
geom.curvesample Sample a parametric curve to a stated chordal tolerance.
geom.curveoffset Equidistant offset of a smooth sampled curve.
geom.selfintersects Test whether a sampled curve crosses itself.
geom.arclength Length along a sampled curve.
geom.resample Respace the points of a curve evenly along its length.
geom.simplify Remove the points of a curve that carry no shape, within a tolerance.

Construction geometry

geom.intersectlines Where two lines cross.
geom.intersectcircle Where a line meets a circle.
geom.intersectcircles Where two circles meet.
geom.tangentpoints Where the tangents from a point touch a circle.
geom.fillet The arc of a given radius tangent to two lines.

DXF input and output

dxf.read Read geometry from an ASCII DXF file.
dxf.write Write drawing entities to an ASCII DXF file.

STL output

stl.write Write a section stack to a binary STL file.

Sheet composition

draw.titleblock A sheet frame with a title block in its corner.
draw.coordtable A table of point coordinates, for a shape that cannot be dimensioned.
draw.symbol The code that stands for a drawing symbol in a text string.

Line types and colours

draw.linetype Dash patterns of the standard line types.
draw.colour Convert between colour names, drawing colour numbers and RGB.

Drawing model

draw.Drawing A two-dimensional drawing in model space.
draw.fromentities Build a drawing from an entity list, as read from a file.