jscad / csg.js

DEPRECATED: CSG Library for JSCAD (See the link below)
https://github.com/jscad/OpenJSCAD.org/tree/master/packages/modeling
MIT License
218 stars 56 forks source link

Remove Object Mutators #88

Closed z3dev closed 4 years ago

z3dev commented 6 years ago

The mutator functions for adding functions to the objects is improper, and should be corrected.

https://github.com/jscad/csg.js/blob/e5b922c338f484689549b115d790a4e1a065e75e/csg.js#L178

they are evil because they are done OUTSIDE the object, so that when you directly import the 'original' objects, (CSG) they are actually missing pieces.

z3dev commented 6 years ago

I’m in favor of COPY AND PASTE. This exposes the object API cleanly, and allows specialization if necessary.

kaosat-dev commented 6 years ago

I agree but would go one step further : why add methods when you can use functions ? No need to mutate or expand or inherit !

z3dev commented 6 years ago

Agree. Possibly only those classes that do the math need to have the methods, like Matrix4x4.

z3dev commented 4 years ago

V2 removes objects and mutator methods.

Closing this issue.