jscad / OpenJSCAD.org

JSCAD is an open source set of modular, browser and command line tools for creating parametric 2D and 3D designs with JavaScript code. It provides a quick, precise and reproducible method for generating 3D models, and is especially useful for 3D printing applications.
https://openjscad.xyz/
MIT License
2.58k stars 505 forks source link

Union of 2D polygon and its mirrorX doesn't work #1301

Closed gilboonet closed 9 months ago

gilboonet commented 9 months ago

Expected Behavior

Have full design from its half.

Actual Behavior

Only have one half of design made from union of a polygon and mirrorX of itself.

Steps to Reproduce the Problem

  let P =  [[0,30],[-16,13],[-10,13],[-23,-3],[-16,-3],[-32,-21],[-16,-21],[-16,-30],[13,-30],[13,-20],[28,-20],[13,-2],[19,-2],[8,13],[13,13]]

  let half2D = polygon({points:P})
  let mirroredHalf2D = mirrorX(half2D)

  let full2D = union(half2D, mirroredHalf2D)

  return full2D

Specifications

z3dev commented 9 months ago

@platypii how about adding the fix to V2? i think there's enough small fixes to V2 now to justify a new version.