Skip to content

Instantly share code, notes, and snippets.

@angerman
Created March 14, 2011 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angerman/869449 to your computer and use it in GitHub Desktop.
Save angerman/869449 to your computer and use it in GitHub Desktop.
(ns geometry.shapes.cube
(:use [geometry :only (create-geometry with-geometry add-vertex add-face generate-edges-from-faces)] ))
(defn create []
(let [shape (create-geometry)]
(with-geometry shape
(let [a (add-vertex 0 0 0)
b (add-vertex 3 0 0)
c (add-vertex 3 3 0)
d (add-vertex 0 3 0)
e (add-vertex 0 0 3)
f (add-vertex 3 0 3)
g (add-vertex 3 3 3)
h (add-vertex 0 3 3)]
(add-face a b c d)
(add-face h g f e)
(add-face a e f b)
(add-face b f g c)
(add-face c g h d)
(add-face d h e a)
(generate-edges-from-faces)))
shape))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment