metafizzy / zdog

Flat, round, designer-friendly pseudo-3D engine for canvas & SVG
https://zzz.dog
10.36k stars 393 forks source link

Constructive solid geometry - union, intersection, difference #12

Open drewbt opened 5 years ago

drewbt commented 5 years ago

It would be good to be able to set each shape as union, intersection or difference, for modelling complex shapes. Here is a more in depth explanation - https://en.wikipedia.org/wiki/Constructive_solid_geometry

Also handy are extrusions - https://www.sciencedirect.com/topics/engineering/path-extrusion

desandro commented 5 years ago

Thank you for this feature request. Add a 👍 reaction to this issue if you would like to see this feature added. Do not add +1 comments — They will be deleted.

Given the 2D nature of Zdog's underlying pseudo-3D math, I don't think constructive solid geometry is actually feasible. The primitives are 2D and don't have 3D volume with which to use for construction. But I'm a 3D graphics newbie, so maybe there's a technique I'm not aware of.

Extrusion, however, could be done.