Create the DXF body for an array of measurements (features). Adds polylines/polygons via DXF ENTITY/SEQ blocks.
Each with {coordinates, name, mode}
DXF-encoded body.
Create a single DXF POLYLINE entity (open or closed).
Vertex array.
Layer name.
'polyline' (open) or 'polygon' (closed).
DXF blocks as text.
Construct the DXF header block for a drawing with given bounding extents.
DXF header as string block
Export provided feature data as a plain ASCII DXF string. Optionally localizes coordinates about their centroid.
One or multiple objects, each with {coordinates, name, mode}
Optional
local: boolean = falseIf true, localizes coordinates relative to centroid.
ASCII DXF text
Compute centroid of an array of coordinates.
Array of [x, y, z] coordinates.
The centroid as [x, y, z].
Compute the min/max extent of an array of coordinates.
Array of [x, y, z] arrays.
[minX, maxX, minY, maxY, minZ, maxZ]
Localizes (translates) a coordinate array to be relative to a center point.
Input coordinates.
Center [x, y, z].
Localized coordinates.
DXFExporter – Class for exporting feature coordinates as ASCII-format DXF (AutoCAD Drawing Exchange Format).
Supports exporting both polylines and polygons, with optional local coordinate system. Creates all required DXF header, entity, and vertex blocks for basic 3D geometries.
Example