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

Rewrites of functions to remove reliance on tags #126

Closed z3dev closed 5 years ago

z3dev commented 6 years ago

WORK IN PROGRESS

SHAPE2

outlineToPaths

toCompactBinary (Changes to be completed with rewrite of fromCompactBinary)

SHAPE3

expand

fixTJunctions

retessellate (requires FuzzyFactory3d, see below)

transform

toCompactBinary (Changes to be completed with rewrite of fromCompactBinary)

OPS CNC

getTransformationAndInverseTransformationToFlatLying

overCutInsideCorners

GEOMETRY FuzzyFactory3

getPolygon

z3dev commented 6 years ago

This is still incomplete but the logic is now using shape2 data structure for sides. The logic is easier to understand with the new data structures.

z3dev commented 5 years ago

I have a few questions about shape2 outlineToPaths...

pentacular commented 5 years ago

One request :)

This is something that the original doesn't do, but might be easy to add at this point.

Could we maintain the path directions, such that the exteriors are CW, but holes are CCW?

This will allow a transformation from shape2 to paths to shape2, and should make conversion to winding depending outputs like svg easier to do.

It will also allow path-wise transformations of shape2.

If this isn't easy to do now, then I can follow up on it later.