Last active
June 25, 2020 18:23
-
-
Save gzmask/a84211db6f805f3c7be018a259cba03f to your computer and use it in GitHub Desktop.
3d model csg
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
{:entities | |
[{:type union | |
:entities [{:type :sphere | |
:diameter 6 | |
:transformations {:translate {:x 6} | |
:rotate-x 1}} | |
{:type :cube | |
:width 10 | |
:length 10 | |
:transformations {:scale {:size 0.5}}}]} | |
]} |
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
(def union | |
(let [sphere* (.transformed sphere (.. Transform | |
(unity) | |
(translateX 3))) | |
cps (.transformed cube-plus-sphere (.. Transform | |
(unity) | |
(translateX 6))) | |
cms (.transformed cube-minus-sphere (.. Transform | |
(unity) | |
(translateX 9))) | |
cis (.transformed cube-intersect-sphere (.. Transform | |
(unity) | |
(translateX 12))) | |
cpf (.transformed cube-plus-figure (.. Transform | |
(unity) | |
(translateX 15)))] | |
(.. cube | |
(union sphere*) | |
(union cms) | |
(union cis) | |
(union cpf) | |
(union cps)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment