Pure-math 2D CAD and DXF geometry utilities: polyline length, shoelace polygon area, bounding boxes, DPI-to-mm calibration, architectural scale conversion, Ramer-Douglas-Peucker simplification, and ASCII DXF export.
Pure-math 2D CAD and DXF geometry utilities: polyline length, shoelace polygon area, bounding boxes, DPI-to-mm calibration, architectural scale conversion, Ramer-Douglas-Peucker simplification, and ASCII DXF export.
(bounding-box pts)Returns {:min-x :min-y :max-x :max-y :width :height} or nil when empty.
Returns {:min-x :min-y :max-x :max-y :width :height} or nil when empty.
(distance [x1 y1] [x2 y2])Euclidean distance between 2D points [x1 y1] and [x2 y2].
Euclidean distance between 2D points [x1 y1] and [x2 y2].
(format-dxf-polyline pts)(format-dxf-polyline pts layer closed?)Formats a 2D polyline as a minimal ASCII DXF LWPOLYLINE entity block.
Formats a 2D polyline as a minimal ASCII DXF LWPOLYLINE entity block.
(paper->model-scale paper-length scale-denominator)Converts a paper-space length using a 1:scale-denominator architectural scale.
Converts a paper-space length using a 1:scale-denominator architectural scale.
(pixels->mm pixels dpi)Converts a raster pixel length at the given DPI to millimeters.
Converts a raster pixel length at the given DPI to millimeters.
(polygon-area pts)Unsigned area of a simple polygon using the shoelace formula.
Unsigned area of a simple polygon using the shoelace formula.
(polyline-length pts)(polyline-length pts closed?)Total length of an open or closed 2D polyline.
Total length of an open or closed 2D polyline.
(simplify-rdp pts epsilon)Simplifies a 2D polyline using the Ramer-Douglas-Peucker algorithm.
Simplifies a 2D polyline using the Ramer-Douglas-Peucker algorithm.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |