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

Visualization of length measurement #147

Closed
5 tasks done
RASRC opened this issue Oct 18, 2023 · 14 comments · Fixed by #268
Closed
5 tasks done

Visualization of length measurement #147

RASRC opened this issue Oct 18, 2023 · 14 comments · Fixed by #268
Assignees
Labels
bug Something isn't working

Comments

@RASRC
Copy link

RASRC commented Oct 18, 2023

Describe the bug 📝

  1. The background color of the label seems to be missing

Cap01

  1. When you disable the measurement, it hides only the dimension line. The pointers and the labels are still in the scene.

Cap02
Cap03

Thanks!

Reproduction ▶️

No response

Steps to reproduce 🔢

  1. Creating a dimension element

const dimensions = new OBC.LengthMeasurement(this.components)
dimensions.create()

  1. Disabling o hiding a dimension element

dimensions.enabled = false;
dimensions.visible = false;

System Info 💻

openbim-components

Used Package Manager 📦

npm

Error Trace/Logs 📃

No response

Validations ✅

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a IFC.js components issue and not a framework-specific issue. For example, if it's a THREE.js related bug, it should likely be reported to mrdoob/threejs instead.
  • Check that this is a concrete bug. For Q&A join our Community.
  • The provided reproduction is a minimal reproducible example of the bug.
@RASRC RASRC added the bug Something isn't working label Oct 18, 2023
@agviegas
Copy link
Contributor

agviegas commented Nov 3, 2023

Hi @RASRC,

  1. Are you importing the CSS styles of the viewer?
  2. I'll take a look!

@agviegas agviegas self-assigned this Nov 3, 2023
@RASRC
Copy link
Author

RASRC commented Nov 5, 2023

Hi @agviegas. I put the styles that are shown in the documentation inside the main .css file of the app:

Cap

About the background color, in the community forum Juan mentioned that could be a color class that was probably deleted in the development process.

I'll be attending to the news. Thanks!

@HoyosJuan HoyosJuan assigned HoyosJuan and unassigned agviegas Nov 28, 2023
@HoyosJuan
Copy link
Member

Hi @RASRC! Hope you're fine 🙂

I'm following up this issue. A couple of things:

  1. The styles that are referenced in the documentation are not applicable anymore (docs need to be updated about this).
  2. The reason why the background wasn't visible, is because the class that gives its color was missing from the resources/styles.css file just as you said in the previous message.
  3. Actually, the fact the measurements still visible is intended (the weird thing is the line hiding when deactivating the tool). In other words, enabling/disabling the tool is not going to hide them, just turn on/off the ability to be created. However, the visibility property does hide them, so we could add another button that works as a visibility toggle. Would that work for you? In fact, I guess it would be a great idea to complement the UI to add a list of current measurements.

The question is: when you toggle dimensions.visible, does the dimensions get showed/hidden? If that's the case, then I would close this issue and create a feature issue talking about the button and dimensions window.

Let me know!

@RASRC
Copy link
Author

RASRC commented Dec 3, 2023

Hello @HoyosJuan !

The app is designed following the IFC.js advance course criteria, but perhaps I'm missing some step in the way:

  1. Defining the dimension tool in the constructor of the BuildingScene class:

image

  1. Defining a method that set the values of the properties of the dimension tool following the value of a boolean parameter

image

Thanks!

@HoyosJuan
Copy link
Member

Hi @RASRC!

And are you using the built-in UI? Things have changed quite a lot since the IFC.js advance course, and I'm not aware about the BuildingScene class and what exact code should we find there. But, just in case, our conversation means the bug is solved?

@RASRC
Copy link
Author

RASRC commented Jan 13, 2024

Hi @HoyosJuan! Sorry for the late response. I'm starting over the viewer following the Master classes with the latest version of the library.
The appearance now it's ok, but I'm continue having troubles with the visibility when you disable the tool (the labels are still in the scene and not following the scale of the camera’s zoom).

Thanks.

image

@shahbaziparisa
Copy link

ass and w

Excuse me how did you use the code? Would you please share?
I follow documentation but labels and points are not visible to me. And snapping rectangle is not available.

@agviegas
Copy link
Contributor

agviegas commented Jun 3, 2024

Hey @shahbaziparisa are you using the library @thatopen/components? It should be solved there!

@shahbaziparisa
Copy link

Hey @shahbaziparisa are you using the library @thatopen/components? It should be solved there!

Yes
Recently I update my project.
Snapping does not work.Do you have sample code?

@agviegas
Copy link
Contributor

agviegas commented Jun 4, 2024

I don't know if you mean A) "I want to use snapping, and I don't know how" or B) "Snapping doesn't work when using a specific measurement component".

For A), we don't have a specific component for snapping, but you can see how we use it in the source code of the library.
For B), it should work. You can find an example here and the deployed app here.

We are currently updating the documentation. Hopefully later today you will be able to find all the updated tutorials for measurement components as well.

@shahbaziparisa
Copy link

I don't know if you mean A) "I want to use snapping, and I don't know how" or B) "Snapping doesn't work when using a specific measurement component".

For A), we don't have a specific component for snapping, but you can see how we use it in the source code of the library. For B), it should work. You can find an example here and the deployed app here.

We are currently updating the documentation. Hopefully later today you will be able to find all the updated tutorials for measurement components as well.

Thanks. I need such snapping to corner on .ifc models . I load ifc model and use the same code but magnetic snapping to corners is not available. For me, a red rectangle appear but never snapped to corners

@agviegas
Copy link
Contributor

agviegas commented Jun 5, 2024

You are right, snapping is not working for IFC models. I'll fix this today!

@shahbaziparisa
Copy link

You are right, snapping is not working for IFC models. I'll fix this today!

Hi
Is it fixed now?

@agviegas
Copy link
Contributor

agviegas commented Jun 7, 2024

Yes, it should be fixed in the latest patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants