three-cad-viewer 5.0.0 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -22,6 +22,7 @@ interface EdgeData {
|
|
|
22
22
|
edges: Float32Array | number[][];
|
|
23
23
|
segments_per_edge?: number[] | Uint32Array;
|
|
24
24
|
obj_vertices?: Float32Array | number[];
|
|
25
|
+
edge_types?: number[] | Uint8Array | Uint32Array;
|
|
25
26
|
}
|
|
26
27
|
interface VertexData {
|
|
27
28
|
obj_vertices: Float32Array | number[];
|
|
@@ -87606,11 +87606,14 @@ class NestedGroup {
|
|
|
87606
87606
|
// widen + recolor the flagged segment in-shader (Option A).
|
|
87607
87607
|
this.highlight?.patchEdgeMaterial(edges.material);
|
|
87608
87608
|
// Internal measurement backend: record the standalone edge node's geometry
|
|
87609
|
-
// (obj_vertices lets the hover status resolve a picked corner's coords
|
|
87609
|
+
// (obj_vertices lets the hover status resolve a picked corner's coords,
|
|
87610
|
+
// edge_types the exact curve type — without it every edge reads as "other"
|
|
87611
|
+
// and a circle/arc loses its center + radius readout).
|
|
87610
87612
|
this.meshGeometry.register(path, {
|
|
87611
87613
|
edges: edgeData.edges,
|
|
87612
87614
|
segments_per_edge: edgeData.segments_per_edge,
|
|
87613
87615
|
obj_vertices: edgeData.obj_vertices,
|
|
87616
|
+
edge_types: edgeData.edge_types,
|
|
87614
87617
|
}, group, null);
|
|
87615
87618
|
}
|
|
87616
87619
|
group.setEdges(edges);
|
|
@@ -95342,6 +95345,14 @@ class CADTrackballControls extends TrackballControls {
|
|
|
95342
95345
|
_quaternion.setFromAxisAngle(_axis, finalAngle);
|
|
95343
95346
|
// Apply rotation via premultiplication (world-space rotation)
|
|
95344
95347
|
this.object.quaternion.premultiply(_quaternion);
|
|
95348
|
+
// Renormalize: holroyd mode skips the lookAt() that renormalizes stock
|
|
95349
|
+
// TrackballControls every frame, so the accumulated premultiply()s would
|
|
95350
|
+
// otherwise let the quaternion norm drift below 1. A sub-unit quaternion
|
|
95351
|
+
// makes line above's `_axis.applyQuaternion(this.object.quaternion)` scale
|
|
95352
|
+
// the axis by |q|^2 < 1, which shrinks the norm further next frame — a
|
|
95353
|
+
// positive-feedback loop that, after enough dragging, erupts into ~180deg
|
|
95354
|
+
// single-frame view flips. One normalize() per rotation keeps it unit.
|
|
95355
|
+
this.object.quaternion.normalize();
|
|
95345
95356
|
this._eye.applyQuaternion(_quaternion);
|
|
95346
95357
|
}
|
|
95347
95358
|
// Update start to end for next frame
|
|
@@ -97300,7 +97311,7 @@ class Tools {
|
|
|
97300
97311
|
}
|
|
97301
97312
|
}
|
|
97302
97313
|
|
|
97303
|
-
const version = "5.0.
|
|
97314
|
+
const version = "5.0.2";
|
|
97304
97315
|
|
|
97305
97316
|
/**
|
|
97306
97317
|
* `PickedComponent` over a GPU id-pick result. Drives the shader
|