Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let users define their own modules #3

Open
Michael-F-Bryan opened this issue Aug 11, 2022 · 0 comments
Open

Let users define their own modules #3

Michael-F-Bryan opened this issue Aug 11, 2022 · 0 comments

Comments

@Michael-F-Bryan
Copy link
Owner

The goal is for people to write something like example 2 under Object Modules:

module house(roof="flat",paint=[1,0,0]) {
  color(paint)
  if(roof=="flat") { 
    translate([0,-1,0]) cube(); 
  } else if(roof=="pitched") {
    rotate([90,0,0]) linear_extrude(height=1)
    polygon(points=[[0,0],[0,1],[0.5,1.5],[1,1],[1,0]]); 
  } else if(roof=="domical") {
    translate([0,-1,0]) {
      translate([0.5,0.5,1]) sphere(r=0.5,$fn=20); cube(); 
    }
  } 
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant