Skip to content

Conversation

@asmith26
Copy link
Contributor

@asmith26 asmith26 commented Nov 24, 2025

Please see comments in #818 for main functionality added - this PR includes the ability to toggle on/off the measurement feature.

Original comment:

Fixes #124

  • On selection of an edge or object, XYZ sizes are shown on those axes:
measure1.mp4
  • Can select multiple objects, which results in the total dimensions being shown:
measure2.mp4

(This highlights the dimensions are actually represented with a dashed line - we can see this by removing a selected object:

measure3.mp4

I have noticed that when transforming a shape the dimension labels don't move with it, but deselecting and re-selecting it correctly updates the location (but I could try and get the labels to move with it if you think this is possible and would prefer it):

measure4.mp4

Very much welcome any thoughts: I did wonder if would we like to have a button to toggle measurements, instead of always showing them whenever an object is selected (I think this might also fix the broken snapshot UI tests)? Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Nov 24, 2025

Preview PR at appsharing.space

@github-actions
Copy link
Contributor

github-actions bot commented Nov 24, 2025

Integration tests report: appsharing.space

@asmith26 asmith26 mentioned this pull request Nov 24, 2025
@trungleduc trungleduc requested a review from arjxn-py November 24, 2025 17:19
@arjxn-py arjxn-py added the enhancement New Feature or improvement label Nov 25, 2025
Copy link
Member

@arjxn-py arjxn-py left a comment

Choose a reason for hiding this comment

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

Thanks @asmith26, this is awesome work.
However i have some minor comments that can be addressed before merging.

Other than that I notice that when we select an edge - it's a 2D plane instead of a bounding box and any of the x, y or z value is 0. Should we hide that label whichever value is 0?

Refer to this image:

Screenshot 2025-11-25 at 16 59 45

Comment on lines 113 to 123
const material = new THREE.LineDashedMaterial({
color: 0x000000,
linewidth: 1,
scale: 1,
dashSize: 0.1,
gapSize: 0.1
});
const geometry = new THREE.BufferGeometry().setFromPoints([start, end]);
const line = new THREE.Line(geometry, material);
line.computeLineDistances();
this._group.add(line);
Copy link
Member

Choose a reason for hiding this comment

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

What is the significance of these dashed lines? I ask because I see the measurements working similarly without these too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've found these helpful when measuring multiple objects, e.g.

image

or between objects (e.g. selecting the 2 edges):

image

Of course happy to remove if preferable?

Copy link
Member

Choose a reason for hiding this comment

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

I like the dash lines, actually I like them so much that I think they are not visible enough 😄 Could we make them more visible when measuring one object?

Copy link
Member

Choose a reason for hiding this comment

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

+1 on keeping the lines. I haven't been able to properly notice them before as they aren't visible enough. Thank You for the justification :)

Copy link
Contributor Author

@asmith26 asmith26 Nov 26, 2025

Choose a reason for hiding this comment

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

Thanks for the feedback, what do think of 9329bbe

image

@arjxn-py
Copy link
Member

About the UI tests, they just seem a bit flaky to me after i inspected the snapshots.

@asmith26
Copy link
Contributor Author

About the UI tests, they just seem a bit flaky to me after i inspected the snapshots.

I've tried to fix the failing ones, and they seem to be passing now.

@asmith26
Copy link
Contributor Author

Other than that I notice that when we select an edge - it's a 2D plane instead of a bounding box and any of the x, y or z value is 0. Should we hide that label whichever value is 0?

Great thought thanks, I like this idea as it could help to keep the UI cleaner. Will have a go at implementing this (hopefully) tomorrow!

@asmith26 asmith26 force-pushed the measures_support_ruler branch from 2c94c46 to cae7af3 Compare November 26, 2025 00:16
@arjxn-py
Copy link
Member

In the latest version, I notice that you have also managed to fix:

I have noticed that when transforming a shape the dimension labels don't move with it, but deselecting and re-selecting it correctly updates the location (but I could try and get the labels to move with it if you think this is possible and would prefer it)

Cheers 🎉

@arjxn-py
Copy link
Member

One thing that I noticed while testing the PR:

When an object is aligned to the xyz axes, there is no issue:

76381

However when the object is tilted using the transform controls, the dashed lines are no longer aligned with the bounding box of the selected object:

83024

We discussed this a bit internally, we think that the dashed lines should be aligned with the bounding box of the object only when measuring a single object. However, since this PR adds also adds support for multi object measurement - the dashed lines should be aligned with the world axes in other cases.

Sorry if this sounds like a lot, we would be happy to help at any point.

@asmith26
Copy link
Contributor Author

asmith26 commented Nov 26, 2025

We discussed this a bit internally, we think that the dashed lines should be aligned with the bounding box of the object only when measuring a single object. However, since this PR adds also adds support for multi object measurement - the dashed lines should be aligned with the world axes in other cases.

Great idea, added in 4abf570

Sorry if this sounds like a lot, we would be happy to help at any point.

No problem at all, I'm happy to help with this amazing project in anyway that I can!

@asmith26
Copy link
Contributor Author

Other than that I notice that when we select an edge - it's a 2D plane instead of a bounding box and any of the x, y or z value is 0. Should we hide that label whichever value is 0?

Added in 56fdfca

@asmith26
Copy link
Contributor Author

Thanks very much for all the feedback, I think I've implemented everything, although I'm unsure as to why the JupyterLite tests are now failing?

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

Labels

enhancement New Feature or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Measures support

3 participants