Created
March 15, 2011 11:39
-
-
Save angerman/870623 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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