OpenJSCAD.org
OpenJSCAD.org copied to clipboard
invalid 2D geometries after contract
Expected Behavior
The following example should contract, and produce a valid 2D geometry.
const { primitives, expansions, colors } = require('@jscad/modeling')
const { polygon } = primitives
const { colorize } = colors
const { expand } = expansions
const main = () => {
// like an M
let shape1 = polygon({ points: [[-5, -5], [5, -5], [5, 5], [0, -2], [-5, 5]] })
shape1 = colorize([1, 0, 0], shape1)
let shape2 = expand({delta: -2, corners: 'edge'}, shape1)
shape2 = colorize([0, 0, 1], shape2)
return [shape1, shape2]
}
module.exports = { main }
Actual Behavior

Steps to Reproduce the Problem
- Run the given example in V2
Specifications
- Version: V2
- Platform: All
- Environment: All
FYI, V1 is worse. Here's the results of the same example.
