Fix docstrings and remove unused namespaces

This commit is contained in:
arne 2022-12-08 13:03:11 +01:00
commit a136529e0d

View file

@ -2,9 +2,7 @@
"Provides functions to move from geometry types provided by thi.ng to gcode
so you can plot them."
(:require [thi.ng.geom.core :as g]
[clojure.string :as str]
[thi.ng.geom.circle :as c]
[thi.ng.geom.rect :as r]))
[clojure.string :as str]))
;; scroll down for a rich comment with usage examples
@ -30,13 +28,10 @@
(g/vertices geom))))))
(def gcode-seq
"Convert thi.ng.geom types into a sequence of G-Code to plot them. The G-Code
instructions are given as a sequence of vectors, where each vector is given
as [x y z].
"Convert thi.ng.geom types into a sequence of G-Code to plot them.
Returns G01 movements on the x, y, and z axis. Z is constantly 1000 in the
current implementation, but this might change in the future. The optional
parameter `r` can be used to adjust the resolution."
An optional parameter `{:r 10}` can be used to adjust the sampling resolution
for the shape."
(comp gcode-verts->gcode-seq ->gcode-verts))
(defn- geom? [x]
@ -45,12 +40,9 @@
;; (pr-str (c/circle 20)) ;; => "#thi.ng.geom.types.Circle2{:p [0.0 0.0], :r 20.0}"
(defn scene->gcode-seq
"Converts a scene into a sequence of gcode instructions. A scene is an
arbitrarily nested vector of geom instances.
A scene is hiccup like in that each object can be followed by a map of
attributes, which can provide addition information about the preceding
object."
"Converts a scene into a sequence of G-Code instructions. A scene is an
arbitrarily nested vector of geom instances and hiccup-like in that each
object can be followed by a map of attributes. The map is currently ignored."
([scene] (scene->gcode-seq scene {}))
([scene {:keys [r] :as opts}]
(loop [[el & rs] scene