jscad / csg.js

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

Reorganization of Extrusions and Expansions (TO BE REMOVED) #172

Closed z3dev closed 5 years ago

z3dev commented 5 years ago

WORK IN PROGRESS, DO NOT MERGE

This pull request adds the extrusion and the expansion functions as seperate modules. The goals are:

Expansions:

expand

Fixes #66

offset

Fixes #75 Fixes #131 Fixes OpenJSCAD #351

Extrusions:

extrudeFromSlices (renamed soldFromSlices)

Fixes #67

extrudeLinear

extrudeRectangular

Fixes OpenJSCAD.org #404

extrudeRotate

Fixes #118

z3dev commented 5 years ago

Extrusions could use a little rework as there are basically two patterns being followed to build walls.

extrudeFromSlices (open issues #67)

extrudeRotate (open issues #118)

z3dev commented 5 years ago

@fischman It seems like the new functionality of repartitionSides() could fit well into the new V2 version of expandLinear. Maybe the API could be something like...

extrudeLinear(options, geometry1, geometry2)

if provided with both geometry1 and geometry2 then the extrude is between different shapes

fischman commented 5 years ago

@z3dev I assume you're talking about merging the change from #111, in which case, sure that seems like it'll work (AFAICT this pull request doesn't materially affect the code that #111 edits). Sorry I don't really grok the zen of v2 so not sure if you're asking me a deeper question or looking for more information.

z3dev commented 5 years ago

I assume you're talking about merging the change from #111, in which case, sure that seems like it'll work

@fischman Correct. Any insights are welcome.

I think the way forward is...

And of course, utility functions to convert from polygon to 3D sides, as well as geom2 to 3D sides. And probably a few extra utility functions to apply transforms easily. (UG Is this defining a new geometry?)

@kaosat-dev Thoughts?

z3dev commented 5 years ago

HUGE REWRITE OF EXTRUSIONS

@fischman @kaosat-dev please clone and checkout this branch. there are major changes which need to be discussed.

@fischman see extrudeWalls.js for those cool functions. :)

@kaosat-dev you will probably HATE 'slice' so review solidFromSlices.js for how slice is used. i'm flexible and would like a better solution as well.

z3dev commented 5 years ago

This has been slept into two pull requests; expansions and extrusions