Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ESRI feature geometries as world decorations give degenerated triangles asserts #5467

Closed
mdastous-bentley opened this issue May 1, 2023 · 6 comments · Fixed by #5625

Comments

@mdastous-bentley
Copy link
Contributor

mdastous-bentley commented May 1, 2023

New development is being to display allow ESRI feature to selected. To achieve this, the feature geometry is fetched from the ESRI backend and display as a decoration.

Some geometry will gives asserts, and other will no be displayed at all on screen.

Assert details:
Message:
Programmer Error

Callstack:
assert (Assert.ts:46)
addTriangle (MeshBuilder.ts:246)
addFromPolyfaceVisitor (MeshBuilder.ts:122)
addFromPolyface (MeshBuilder.ts:91)
loadIndexedPolyface (MeshBuilderMap.ts:101)
loadPolyfacePrimitiveList (MeshBuilderMap.ts:83)
loadGeometry (MeshBuilderMap.ts:68)
createFromGeometries (MeshBuilderMap.ts:49)
toMeshBuilderMap (GeometryAccumulator.ts:164)
toMeshes (GeometryAccumulator.ts:171)
saveToGraphicList (GeometryAccumulator.ts:180)
finishGraphic (GeometryListBuilder.ts:175)
finish (GeometryListBuilder.ts:50)
renderGraphics (MapFeatureInfoDecorator.ts:206)
decorate (MapFeatureInfoDecorator.ts:214)
addFromDecorator (ViewContext.ts:187)
addDecorations (Viewport.ts:3322)
renderFrame (Viewport.ts:2490)

Steps to reproduce the behavior:

  1. checkout the 'geo/MapFeatureInfo_hlite' branch.
  2. Open 'philly_area_outline.bim' in dislay-test-app
  3. Open the 'PhillyPolyF_assert1' saved view
  4. Use the temporary 'drop' toolbar icon to enable the selection tool.
  5. Click the highlighted polygon:
    image
  6. An assert will appear.

Sometimes, the polygon get initially displayed, but zoom-in out, will trigger an assert:

  1. Open 'philly_area_outline.bim' in dislay-test-app
  2. Open the 'PhillyPolyF_assert2' saved view
  3. Use the temporary 'drop' toolbar icon to enable the selection tool.
  4. Click the highlighted polygon:
    image
  5. Zoom out.
  6. An assert will appear.

In some rare cases, no polygon is displayed:

  1. checkout the 'geo/MapFeatureInfo_hlite' branch.
  2. Open 'philly_area_outline.bim' in dislay-test-app
  3. Open the 'PhillyPolyF_assert1' saved view
  4. Use the temporary 'drop' toolbar icon to enable the selection tool.
  5. Click the highlighted polygon:
    image
  6. An assert will appear.

Dataset:
philly_area_outline.zip

@pmconne pmconne added bug Something isn't working needs triage display and removed bug Something isn't working labels May 1, 2023
@dassaf4
Copy link
Member

dassaf4 commented May 1, 2023

When I looked at this issue last week, the below input caused MeshBuilder.createTriangle to return a degenerate Triangle.

position: {x: -8370467.98428443, y: 4859292.3676143885, z: 0}, sourceIndex: 0
position: {x: -8370467.93876954, y: 4859292.655171589, z: 0}, sourceIndex: 1
position: {x: -8370466.809313181, y: 4859292.809271909, z: 0}, sourceIndex: 2

And immediately thereafter, this degenerate Triangle trips the assert in MeshBuilder.addTriangle.

@mdastous-bentley
Copy link
Contributor Author

Updated description

@mdastous-bentley
Copy link
Contributor Author

I managed to work around most issues by lowering the geometries resolution output by the ESRI server (i.e maxAllowedOffset).

I still get inconsistent decoration display for some polygons though (Step to reproduce #2). Depending on the view pixel size, the decoration will sometime appear, and sometime not (without throwing any assert)

@mdastous-bentley
Copy link
Contributor Author

@markschlosseratbentley this is blocking PR 5327, does anyone can help understanding why some ESRI geometries cannot be displayed as decorations?

@DStradley
Copy link
Contributor

@mdastous-bentley the reason for the degenerate triangle assert is for triangles that are too small to be visible on the current view (and therefore waste bandwidth all through the system, including gl). The vertices that @dassaf4 listed above are of that category (I can tell just by looking at the numbers in this case, because they are the same to 7 digits and WebGL is single precision). So it makes sense to me that lowering the resolution output would probably get rid of the too tiny triangles, and sounds like it did. (I gather you no longer see any asserts?)

What do you mean by "Step to reproduce #2", do you mean using saved view PhillyPolyF_assert2?
What do you see here, are the decorations that sometimes appear and sometimes not tiny in size (about a pixel)?

@mdastous-bentley
Copy link
Contributor Author

What do you mean by "Step to reproduce #2", do you mean using saved view PhillyPolyF_assert2? What do you see here, are the decorations that sometimes appear and sometimes not tiny in size (about a pixel)?

@DStradley For some reasons, decorations wont display in the view at all (I dont get any error or assert).. interestedly zoom-in one step with the mouse wheel will make the decoration appears.

If you need to reproduce, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants