iTwin / itwinjs-core

Monorepo for iTwin.js Library
https://www.itwinjs.org
MIT License
600 stars 210 forks source link

Add support for polygon with holes to GaphicBuilder #5108

Open mdastous-bentley opened 1 year ago

mdastous-bentley commented 1 year ago

Their should be a way to add a polygon with holes using GraphicBuilder (i.e. by defining a ParityRegion). Ideally that should also be compatible with the existing addPrimitive method.

pmconne commented 1 year ago

The GraphicBuilder enhancement cannot be completed until faceting of parity regions is supported by @itwin/core-geometry.

PolyfaceBuilder.addGeometryQuery invokes GeometryQuery.dispatchToGeometryHandler(this). ParityRegion.dispatchToGeometryHandler invokes handler.handleParityRegion. PolyfaceBuilder extends NullGeometryHandler which implements handleParityRegion as a no-op. So we currently cannot obtain facets from a parity region.

@dassaf4 suggests the approach used for faceting loops could be extended to support parity regions as well.