jscad / scad-api

DEPRECATED: OpenSCAD like API for JSCAD (See the link below)
https://github.com/jscad/OpenJSCAD.org/tree/V2/packages
MIT License
14 stars 8 forks source link

Incoherent API between rectangular_extrude and other extrusions #34

Closed kaosat-dev closed 2 years ago

kaosat-dev commented 6 years ago

Currently linear & rotate extrude take params first, 2d shapes second, whilerectangular_extrude takes params second ! This is very confusing and incoherent , and needs to be changed (yes, BREAKING CHANGE !) We want good, coherent and not confusing APIs, right @z3dev ;) ?

z3dev commented 6 years ago

Agreed. The current API is totally confusing to anyone new.

I think you will find more as you start to create a new standard.

FYI, I'm not sure what is the "correct" API but this inconsistency has to be corrected.

I prefer an API that doesn't require an order to the arguments, which is why I prefer the CSG style of passing aguments as a attribute of an anonymous object. But I'll try to be flexible....

kaosat-dev commented 6 years ago

There are a few bad things, but still not quite as horrible as I feared (except for a few function where there are so many ways to specify params it is just frightening).

what do you mean by

CSG style of passing aguments as a attribute of an anonymous object

do you mean passing options like this ?

{length: 10, round: true}
z3dev commented 6 years ago

Correct. By the way, I believe both CSG and SCAPAPI are inconsistent in the use of aguements, so the new API will be far better.

kaosat-dev commented 6 years ago

I really like object options like the above as well so we are good :) Yeah the api can only get better !

z3dev commented 2 years ago

V2 modeling passes options via anonymous objects.

These changes will not be supported as part of the SCAD compatibility layer.