itwinjs-core icon indicating copy to clipboard operation
itwinjs-core copied to clipboard

View clipping error when zooming after moving graphic

Open matthaleky opened this issue 1 year ago • 7 comments

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

matthaleky avatar Dec 07 '23 18:12 matthaleky

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

pmconne avatar Dec 12 '23 13:12 pmconne

It is within the project extents.

matthaleky avatar Dec 12 '23 13:12 matthaleky

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

matthaleky avatar Dec 12 '23 13:12 matthaleky

How small is your geometry? (meters)

markschlosseratbentley avatar Dec 12 '23 14:12 markschlosseratbentley

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

matthaleky avatar Dec 12 '23 14:12 matthaleky

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).

markschlosseratbentley avatar Jan 10 '24 13:01 markschlosseratbentley

@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.

pmconne avatar Jan 10 '24 15:01 pmconne

@matthaleky I cannot reproduce this currently with a move command that I implemented in DisplayTestApp. Does this problem still occur in whatever App you were using?

MarcNeely avatar Aug 07 '24 21:08 MarcNeely

Sounds promising, we are currently using version 4.7.0. What version are you using?

matthaleky avatar Aug 07 '24 22:08 matthaleky

@MarcNeely, I cannot run any editing commands in display-test-app.(except for "projectLocationTool"). Please tell me how to run the move command in the display-test-app. Also, please send me the imodel you are using.

matthaleky avatar Aug 08 '24 12:08 matthaleky

https://github.com/user-attachments/assets/7ed7c33a-e76f-4aa8-a525-f020d7812288

In the video, I am using the Editing Studio-App, I can give you the steps to use it, if needed. I placed the two circles, moved the one on the right and now it disappears before the other circle when zooming in like the previous videos above. In the background are normal sized real world geometry and I am well within the project extents. Perhaps it looks subtle in this video, i only did one simple move, after doing more moves, the effect becomes more dramatic.

matthaleky avatar Aug 09 '24 03:08 matthaleky

@matthaleky As @pmconne mentioned separately, this is actively being investigated by @MarcNeely, which included work creating this PR (https://github.com/iTwin/itwinjs-core/pull/7060) in order to add a move ability to display-test-app in order to attempt to reproduce.

markschlosseratbentley avatar Aug 09 '24 12:08 markschlosseratbentley

OK, I think that I've been able to reproduce this in display-test-app now. When you do the zooming in, are you still in edit mode?

MarcNeely avatar Aug 09 '24 19:08 MarcNeely

Yes, if "edit mode" = "edit scope".

matthaleky avatar Aug 09 '24 19:08 matthaleky

OK, I think that I have tracked this down. It looks to me like the bounding ranges are all OK, but the bounding sphere of the temporary tiles is not getting updated, so it's throwing the tile out if the un-updated bounding sphere is not in the view. I'll look at updating the bounding sphere properly as the ranges are updated.

MarcNeely avatar Aug 14 '24 18:08 MarcNeely

Thank you for the update.

matthaleky avatar Aug 14 '24 18:08 matthaleky