OpenJSCAD.org icon indicating copy to clipboard operation
OpenJSCAD.org copied to clipboard

invalid 2D geometries after contract

Open z3dev opened this issue 5 years ago • 1 comments

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

1

Steps to Reproduce the Problem

  1. Run the given example in V2

Specifications

  • Version: V2
  • Platform: All
  • Environment: All

z3dev avatar Mar 31 '21 07:03 z3dev

FYI, V1 is worse. Here's the results of the same example.

2

z3dev avatar Mar 31 '21 07:03 z3dev