Geometry¶
LibLathe uses a simplified geometry representation which consists of a single type; the segment. This geometry is used throughout LibLathe to hold the part and path representations.
The Segment¶
The segment is the fundamental representation of LibLathe geometry. The segment can represent one of two basic forms; A line segment or an arc segment.
Grouping the geometry into a single type is possible as both lines and arcs can be defined by three components:
- Start Point
- End Point
- Bulge
This method of segment representation is inspired by a technical paper titled An offset algorithm for polyline curves by Xu-Zheng Liu et al, ISBN: 0166-3615
Line Segments¶
Line segments are represented by two points; a start point and an end point, the buldge value is always equal to zero for line segments.
The Segment Group¶
The segment group is a container object that holds a collection of segments, usually representing a ‘pass’. The segment group can perform a set of operations on the segments such as:
- Offsetting
- Converting to gcode
- Analysis for use with a selected tool