Skip to content

feat: support length units in extra-model offset#5180

Merged
diegoteran merged 1 commit into
google:masterfrom
Frank3K:feat/extra-model-offset-units
Jun 18, 2026
Merged

feat: support length units in extra-model offset#5180
diegoteran merged 1 commit into
google:masterfrom
Frank3K:feat/extra-model-offset-units

Conversation

@Frank3K

@Frank3K Frank3K commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Description

updateModelTransforms parsed <extra-model offset="..."> with a plain split/Number, so only unitless numbers (meters) worked. Parse the value with parseExpressions/normalizeUnit instead, mirroring the orientation handling, so each component may carry a length unit (m/cm/mm) while bare numbers continue to be treated as meters (e.g. offset="-2.0 0 0" and offset="-200cm 0 0" are equivalent).

Document offset unit support and the existing roll/pitch/yaw orientation convention on the multimodel example, and update the property JSDoc.

Add a test covering unit-suffixed offsets and that bare numbers stay in meters.

@google-cla

google-cla Bot commented Jun 16, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

`updateModelTransforms` parsed `<extra-model offset="...">` with a plain
`split`/`Number`, so only unitless numbers (meters) worked. Parse the
value with `parseExpressions`/`normalizeUnit` instead, mirroring the
`orientation` handling, so each component may carry a length unit
(`m`/`cm`/`mm`) while bare numbers continue to be treated as meters
(e.g. `offset="-2.0 0 0"` and `offset="-200cm 0 0"` are equivalent).

Document offset unit support and the existing roll/pitch/yaw orientation
convention on the multimodel example, and update the property JSDoc.

Add a test covering unit-suffixed offsets and that bare numbers stay in
meters.
@Frank3K Frank3K force-pushed the feat/extra-model-offset-units branch from 68f4f2c to 538cd0f Compare June 16, 2026 20:09

@diegoteran diegoteran left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thank you

@diegoteran diegoteran merged commit d8721e5 into google:master Jun 18, 2026
7 checks passed
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.

2 participants