Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Playing with mirror() method
- */
- vectorsize = "two"; // ["two","thr","for","fiv","six"]
- allthree=[2,2,2]; // [-5,1,5]
- /* [Hidden] */
- $fs=0.5;$fa=1.0;
- if( vectorsize == "two" ) {
- color("green")
- %cube();
- color("red") mirror([2,2]) cube();
- }
- else if( vectorsize == "thr" ) {
- color("green") cube();
- color("red") mirror(allthree) cube();
- }
- else if( vectorsize == "for" ) {
- color("green") translate([4,0]) cube();
- color("red") mirror( v=[1,0]) translate([4,0]) cube();
- }
- else if( vectorsize == "fiv" ) {
- color("green") translate([4,0,-2]) cube();
- color("red") mirror( v=allthree) translate([4,0,-2]) cube();
- }
- else {
- color("green")
- union() {
- cube([2,4,1]);
- translate([1,1,0])cube([4,2,1]);
- }
- color("red")
- mirror(allthree)
- union() {
- cube([2,4,1]);
- translate([1,1,0])cube([4,2,1]);
- }
- }
- /*
- Written by Jeff Hayes <vulcan_at_mac_com>
- To the extent possible under law, the author(s) have dedicated all
- copyright and related and neighboring rights to this software to the
- public domain worldwide. This software is distributed without any
- warranty.
- You should have received a copy of the CC0 Public Domain
- Dedication along with this software.
- If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
- */
Advertisement
Add Comment
Please, Sign In to add comment