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

Implement section caps through sceneModelEntity:capMaterial #1775

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ijlal99
Copy link
Collaborator

@ijlal99 ijlal99 commented Jan 14, 2025

Please give this branch a test and let me know if you see any bugs so that we can fix it before merging into main.

@paireks
Copy link
Member

paireks commented Jan 14, 2025

Ok, I will give it a try :)

examples/slicing/SectionCaps.html Dismissed Show dismissed Hide dismissed
examples/slicing/SectionPlanesPlugin_Duplex_SectionCaps.html Dismissed Show dismissed Hide dismissed
Copy link
Member

@paireks paireks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey guys, I'm testing it on various different models, it works better than I thought. It runs quite fast and gets quite good results. But also it has some limitations:

  • models have to have all meshes closed (solids). But in reality many models have none of them closed or only some of them closed, which results in only partial caps / no caps.
  • for huge models (such as WestRiverSideHospital) it crashes my browser.
  • it doesn't work once I set the position of the model (it doesn't cap then)
  • I think it would be good to check the model far from origin, but I can't remember which one was it. Do you remember @xeolabs?

Because of the above I'm thinking if maybe it would be better to add this functionality more as an example rather than a xeokit-sdk functionality? What do you guys think?

@ijlal99
Copy link
Collaborator Author

ijlal99 commented Jan 16, 2025

Hi @paireks!

Thank you for trying out this feature and your valuable feedback.

  1. For the capping of only solid objects, this is not really a limitation but actually a requirement that we only hatch solid objects.
    if (isSolid && object.capMaterial) {
  2. For huge models like WestRiverSideHospital, I checked and the browser crashes even when the SectionCaps are disabled.
  3. We currently do not have any event in xeokit that informs us that the position of an object has been changed. We plan to handle this situation later.
  4. Our first implementation of this feature was a plugin and then we switched and made it a part of xeokit sdk with the agreement of @MichalDybizbanskiCreoox and @xeolabs.

@MichalDybizbanskiCreoox
Copy link
Collaborator

MichalDybizbanskiCreoox commented Jan 17, 2025

2. For huge models like WestRiverSideHospital, I checked and the browser crashes even when the SectionCaps are disabled.

I've added a section plane and capMaterials to the xkt_dtx_WestRiverSideHospital.html example (also calling Viewer constructor with the readableGeometryEnabled: true flag needed for hatching).
The example works for me in Chrome on macOS just fine:
https://github.com/user-attachments/assets/9dfe8b42-c5a3-4c7e-baa5-ecc133d5355b

src/viewer/scene/sectionCaps/SectionCaps.js Outdated Show resolved Hide resolved
src/viewer/scene/sectionCaps/SectionCaps.js Outdated Show resolved Hide resolved
src/viewer/scene/sectionCaps/SectionCaps.js Outdated Show resolved Hide resolved
@ijlal99 ijlal99 force-pushed the feature/hatching-with-triangles branch from d324265 to 01c0856 Compare January 21, 2025 15:17
@ijlal99 ijlal99 force-pushed the feature/hatching-with-triangles branch from 01c0856 to a722993 Compare January 27, 2025 16:57
@ijlal99 ijlal99 marked this pull request as ready for review January 27, 2025 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants