Skip to content

v2.1.0-beta.4

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 09 Jun 13:50
· 2 commits to main since this release
af2f5fa

Minor Changes

  • 9982b33: Unify the coordinate frame: the Three.js scene is now Rhino's frame (Z-up), end to end.

    Previously the display pipeline rotated Rhino Z-up geometry into Three's native Y-up
    ((x, y, z) → (x, z, −y)) during mesh decompression and display-item parsing. That hidden
    rotation meant every feature producing or consuming positions — measurements, mesh metadata,
    label anchors, picking, the new camera presets/grid — had to round-trip through it or silently
    land in the wrong frame.

    The rotation is removed everywhere. A Rhino point (x, y, z) is now the Three point (x, y, z):

    • rhinoToThree is the identity (kept, deprecated, for call-site compatibility).
    • The int16/float32 vertex paths in webdisplay/batch-parser.ts pass vertices through unrotated.
    • initThree orients the camera, default iso position, sunlight, floor, and reference grid to the
      scene up axis (Z-up by default); the camera controller's presets are likewise up-derived.

    Breaking: any consumer that assumed viewer geometry was Y-up (e.g. reading mesh vertex
    positions, placing objects, or computing directions in Three space) must drop the
    (x, z, −y) conversion — Three space now equals Rhino space. The applyTransforms option is
    retained but no longer rotates; it will be removed in a future release.

Patch Changes

  • 9982b33: Make the measurement tool easier to read and aim, and report per-axis deltas.

    • Distance labels now carry a default style (dark translucent pill, light text) so they stay
      legible on any background instead of inheriting the page color (previously invisible white-on-white).
      Passing labelClassName still opts out of all default styling.
    • The tool previews the snap point: a ghost marker follows the cursor and jumps to the vertex a
      click would lock onto, so you can aim before committing. MeasureTool gains handleMove(event),
      which initThree wires to canvas mousemove.
    • Orbiting/panning no longer disturbs a measurement: the click a drag fires on release is ignored
      (pointer moved past a small slop threshold), so in-progress points and finished measurements survive
      rotation instead of being cleared or mis-placed.
    • The default label now shows the per-axis breakdown (Δx/Δy/Δz) under the total distance. The
      format callback signature widens to (distance, delta) => string; existing (distance) => string
      callbacks remain valid.
  • 9982b33: Make the viewer's camera controller, presets, and grid respect the scene up axis.

    The CAD tooling assumed Three's native Y-up, but Selva scenes are Z-up. initThree set
    scene.up to Z yet never set camera.up, so OrbitControls orbited as if Y-up and the
    preset views (top/front/…) framed the wrong faces; the grid also defaulted to the
    horizontal Y-up plane.

    • initThree now sets camera.up to the configured sceneUp before constructing
      OrbitControls and the camera controller (both capture the orbit/preset basis from up).
    • The camera controller derives its preset view directions, iso angle, and orthographic
      camera up from the up axis instead of a hardcoded Y-up table, via a new optional up
      dependency (defaults to the perspective camera's up).
    • The grid's default plane is derived from the up axis (Z-up → plane: 'z'), so the grid
      lies under the model without callers passing plane explicitly. An explicit plane
      still wins.

    No API changes; behavior is corrected for non-Y-up scenes and unchanged for Y-up.