iTwin / itwinjs-core

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

View clipping error when zooming after moving graphic #6275

Open matthaleky opened 7 months ago

matthaleky commented 7 months ago

Describe the bug In the following video, notice that I can zoom in very close. After moving the graphic it then clips too soon as I zoom in. 2023-12-07_09-30-07 Here is a simpler model that shows the problem with a cylinder and using only iTwinjs Edit Tools. 2023-12-07_13-14-27 If I close that model and open another model or restart the app, zooming is correct again. Turning EditScope off and on again does not help.

To Reproduce cylinder.zip has the bim file in the second example. I placed the cylinder using iTwin Edit Tools. I used the keyin "editor move elements" to move the cylinder.

  1. Open the example bim with an App that has the Edit Tools enabled. I tried in Display-Test-App but it errors with "Key-in Failed to run"
  2. Use the keyin "editor move elements" to move the cylinder to other locations
  3. There is a certain distance from the original location when zooming in close clips too soon.

iTwin.js: 4.3.0-dev.25 iTwinUI: 2.11.10 AppUI: 4.6.1 React: 17.0.2 Node.js: 18.16.1 Electron: 26.0.0 Build Tools Commit: 842412e

pmconne commented 6 months ago

Are you moving the element outside of the initial project extents?

matthaleky commented 6 months ago

It is within the project extents.

matthaleky commented 6 months ago

Notice project extents are displayed. I moved the right cylinder until zoom started clipping too soon. I then placed the right cylinder and recorded. 2023-12-12_08-24-27

markschlosseratbentley commented 6 months ago

How small is your geometry? (meters)

matthaleky commented 6 months ago

About 8' tall with 2.5' radius. 1.6 m high with 0.77 diameter.

markschlosseratbentley commented 5 months ago

About 8' tall with 2.5' radius. 1.6 m high with 0.77 diameter.

I wonder if that is too small of a size for the frustum code. @pmconne what do you think? In the past when very tiny things (and only very tiny things) have been modeled in a .bim (sub-1-meter?), it is a known shortcoming that the the frustum can go bad (in a similar way to what is shown above).

pmconne commented 5 months ago

@pmconne what do you think?

I think @matthaleky described a synchronization problem. He notes the problem begins after making an edit, and is resolved when reloading the iModel. Presumably the frustum is not being adjusted to account for the geometric changes he made to the model.