Skip to content

Instantly share code, notes, and snippets.

@angerman
Created March 15, 2011 11:39
Show Gist options
  • Save angerman/870623 to your computer and use it in GitHub Desktop.
Save angerman/870623 to your computer and use it in GitHub Desktop.
(defrecord Node [id x y])
(defrecord Point [node depth])
(defrecord Edge [node-a node-b depth-a depth-b])
(defrecord Face [nodes depths])
(defprotocol TikZRenderer
(render [_] "TikZ representation."))
(extend-protocol TikZRenderer
Node
(render [n] (format "\\coordinate (node-%d) at (%+2.4f,%+2.4f);\n" (:id n) (:x n) (:y n))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment