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