drafting

drafting

0.2.3 2026-10-17

Planar geometry, technical drawing and solid modelling: polylines, splines, paths and regions with booleans, offsets and hulls; a technical drawing model plotted, printed to scale, set in TikZ and written to DXF; DXF read and written from R12 to R2018; triangle meshes in STL, OBJ, PLY and 3MF; and exact solids through Open CASCADE with holes, fillets, sections and projections, assemblies in STEP and 3MF, and a viewer. Provides the drafting layer for engineering design packages.

Select Category:

Polylines and regions

geom.Polyline A polyline of straight segments and circular arcs, lying in a plane.
geom.Spline A smooth curve: a NURBS, drawn through points or given by its control points.
geom.Region A closed area of a plane, an outline with holes in it.
geom.Path A path of straight segments, circular arcs and splines in three dimensions.
geom.UCS A user coordinate system: an origin, an x axis and a normal, defining a plane with coordinates of its own.
geom.text The outlines of text, as regions.

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.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

geom.read Read geom objects from an ASCII DXF file.
geom.write Write several geom objects to one DXF file.
draw.read Read a drawing from an ASCII DXF file.

Meshes

polymesh.Mesh A triangle mesh in millimetres.
polymesh.read Read a triangle mesh from an STL, OBJ, PLY or 3MF 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.

Solid modelling

solid.Shape A solid in millimetres, modelled through Open CASCADE.
solid.box A rectangular block.
solid.wedge A wedge: a block whose top is smaller than its base.
solid.cylinder A right circular cylinder.
solid.cone A right circular cone or truncated cone.
solid.sphere A sphere.
solid.ellipsoid An ellipsoid.
solid.torus A torus, the solid of a ring.
solid.polyhedron A solid bounded by a closed triangle mesh.
solid.surface A solid made of a smooth surface through a grid of points.
solid.extrude A solid extruded from a region.
solid.revolve A solid of revolution, turned from a region about its own axis.
solid.loft A solid passing through regions.
solid.sweep A solid swept by a region along a path.
solid.helix A coil, swept by a region turning about its own axis as it rises.
solid.read Read a solid from a STEP file.
solid.threadspec The dimensions of a metric screw thread, read from its name.
solid.holespec The dimensions of the hole for a metric screw, read from its thread.

Assemblies and viewing

model.Assembly Named parts placed together.
model.read Read an assembly from a STEP or 3MF file.
model.Viewer A window showing a solid, a triangle mesh or an assembly, in which edges, faces, solids and coordinate systems can be picked, and solids hidden or shown through.