Incorrect shape with holes, when one area eclosed by another

Description of the problem

Problem description:
I have a svg path with holes and i want to extrude geometry from it, everything is fine except usecase where i have a isolated inner figure in source svg path

here is a fiddle with example of problem

dev-branch fiddle

at top of the scene: is the final result of extruding

at bottom: separated subshapes, one hole related to another polygon

edit: i dig into three.js code and figured out that is a bug of ShapePath.toShapes method.
the part of code with detection of correct hole target is bugged. case when one area enclosed my another (countour hierarchy) is not handled properly

Three.js version
  • Dev
  • r91
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, …)
  • any

Author: Fantashit

1 thought on “Incorrect shape with holes, when one area eclosed by another

  1. input paths should be clockwise, holes counterclockwise. Users have to ensure that their data corresponds to this standard.

    I would call it an SVG option, set by the SVG fill-rule property.

    It is a three.js standard, however — subject to the value of the toShapes() argument isCCW.

    Note that three.js fills by triangulation, while SVG fills per pixel.

Comments are closed.