farrellm / scad-clj

OpenSCAD DSL in Clojure
Eclipse Public License 1.0
318 stars 51 forks source link

Center control for primitives. #18

Closed EricGebhart closed 10 years ago

EricGebhart commented 10 years ago

A default of center=true on all primitives can make it very difficult to build complex objects. It is much better to have the choice. This would break backward compatibility, as the default is false, as it is in Scad. I have thought about how to get around breaking backward compatibility, but I find all the solutions I have come up with distasteful. Looking through lots of code, I see that center=true is far less common than the default of false.

farrellm commented 10 years ago

I'd be fine with adding the option as long as we leave the default true.

EricGebhart commented 10 years ago

I added an atom and a function to set the center default which is true to start. This allows for anyone to change the default to what they want with a function call. (centering false). I don't want to have to add :center false to my function calls any more than you want to add :center true to yours. :-)

farrellm commented 10 years ago

Sure, though centering should have a bang, either centering! or set-centering!. Also, looks like a bit of extra whitespace sneaked in on scad.clj, line 81

EricGebhart commented 10 years ago

I agree. Sleep well.

farrellm commented 10 years ago

Merged, thanks!