Haskell-Things / Haskell-Things/ImplicitCAD
Add point and line segment primitives
- Dominant language
- JavaScript
- Stars
- 1.6k
- Forks
- 148
- PR merge metrics
- No merged PRs in 30d
Description
While trying to fix some issues with degenerate objects like cube with zero size, it occurred to me that the result of these shouldn't be an `emptySpace` we currently have but a 2D or 1D primitive.
That would allow us to have 1D in core which some backends could render properly (i.e. SVG, PNG, GCode can represent points and line segments) while STL could just ignore these (possibly with a warning).
Some examples
- `circle 0` (or `sphere 0`) would collapse into a `point`
- `square (V2 0 10)` would collapse into `lineSegment`
- `cube (V3 0 10 10)` should already collapse into `square`, this one we can do without additional prims.
Ideally things would play nicely together when going between dimensions using extrude and slice
- slicing a cube we get a square, slicing square we get line segment, slicing line segment we get a point, extruding reverses the operation.
4D (.. or ND?) subsystem also seems to make sense :upside_down_face:
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.