begin-rawclj

do-record

end-raw

begin-rawclj

Arguments
[renderer filename]
Docstring
Enables the creation of vectors from 3D data. Requires
corresponding end-raw command. These commands will grab the shape
data just before it is rendered to the screen. At this stage, your
entire scene is nothing but a long list of individual lines and
triangles. This means that a shape created with sphere method will
be made up of hundreds of triangles, rather than a single object. Or
that a multi-segment line shape (such as a curve) will be rendered
as individual segments.
Works only inside sketch functions?
Yes
Original Processing method
beginRaw()
Example
clojure specific
  • (q/begin-raw :dxf "generated/dxf.txt")
    (q/camera 150 150 150 0 0 0 0 0 1)
    (q/box 100)
    (q/end-raw)

do-record

Arguments
[graphics & body]
Docstring
Macro for drawing on graphics which saves result in the file at the end.
Similar to 'with-graphics' macro. do-record assumed to be used with :pdf
graphics. Example:

(q/do-record (q/create-graphics 200 200 :pdf "output.pdf")
  (q/fill 250 0 0)
  (q/ellipse 100 100 150 150))
Works only inside sketch functions?
Yes
Original Processing method
None. It is present only in Quil.
Example
clojure specific
  • (doseq [type [:svg :pdf]
            i (range 3)]
      (let [file (str "generated/record_" i "." (name type))]
        (q/do-record (q/create-graphics 200 200 type file)
                     (q/fill 255 0 0)
                     (q/ellipse 100 100 (+ 50 (* 50 i)) (+ 50 (* 50 i))))
        (is (pos? (.length (clojure.java.io/file file))))))

end-raw

Arguments
[]
Docstring
Complement to begin-raw; they must always be used together. See
the begin-raw docstring for details.
Works only inside sketch functions?
Yes
Original Processing method
endRaw()
Example
clojure specific
  • (q/begin-raw :dxf "generated/dxf.txt")
    (q/camera 150 150 150 0 0 0 0 0 1)
    (q/box 100)
    (q/end-raw)