Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I also reach for OpenSCAD first when designing something for a 3d print, for a couple reasons:

1. I also didn't really have any actual 3d "design" experience before using OpenSCAD, except for in the 90s/00s when I played around with POVRay as a hobby, but OpenSCAD definitely feels a lot like writing POVRay scenes.

2. My first exposure to graphics programming was in OpenGL, and the OpenSCAD language's focus on transformations applying to children "rhymes" with that very well (they're just like a C-style if/for/while block, where you can either nest several things inside { } or else just have a single statement following the control structure and the transform applies only to that one thing, so

  cube(1);
  translate([1,1,1])cube(1);
  translate([2,2,2])cube(1);
is equivalent to

  cube(1);
  translate([1,1,1]){
    cube(1);
    translate([1,1,1]){
      cube(1);
    }
  }
which is in turn equivalent to

  module cubechain(n) {
    if (n > 0) {
      cube(1);
      translate([1,1,1])cubechain(n - 1);
    }
  }
  cubechain(3);
and you can indeed make neat L-systems and such out of primitives and recursion.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: