brep-io-kernel 1.0.256 → 1.0.257
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.
package/package.json
CHANGED
|
@@ -2,14 +2,14 @@ function emptyAnnotations() {
|
|
|
2
2
|
return [];
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
function normalizeFeatureDimensionFeatureKey(raw) {
|
|
6
6
|
if (!raw) return '';
|
|
7
7
|
return String(raw).trim().toUpperCase();
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
const FEATURE_DIMENSION_DESCRIPTORS = new Map();
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
function registerFeatureDimensionDescriptor(descriptor = {}) {
|
|
13
13
|
const featureKey = normalizeFeatureDimensionFeatureKey(descriptor.featureKey);
|
|
14
14
|
if (!featureKey) return null;
|
|
15
15
|
|
|
@@ -25,7 +25,7 @@ export function registerFeatureDimensionDescriptor(descriptor = {}) {
|
|
|
25
25
|
return normalized;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
function getFeatureDimensionDescriptor(featureKey) {
|
|
29
29
|
return FEATURE_DIMENSION_DESCRIPTORS.get(normalizeFeatureDimensionFeatureKey(featureKey)) || null;
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import { SelectionFilter } from './SelectionFilter.js';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const REFERENCE_SNAPSHOT_STORE_KEY = 'referenceSnapshots';
|
|
5
5
|
const DEFAULT_FIELD_KEY = '__default';
|
|
6
6
|
const EPS = 1e-12;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
function normalizeReferenceSnapshotFieldKey(raw) {
|
|
9
9
|
const key = String(raw || '').trim();
|
|
10
10
|
return key || DEFAULT_FIELD_KEY;
|
|
11
11
|
}
|
|
@@ -22,7 +22,7 @@ export function normalizeReferenceSnapshotName(obj) {
|
|
|
22
22
|
return `${type}(${x},${y},${z})`;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
function getReferenceSnapshotStore(persistentData) {
|
|
26
26
|
const store = persistentData?.[REFERENCE_SNAPSHOT_STORE_KEY];
|
|
27
27
|
return store && typeof store === 'object' ? store : null;
|
|
28
28
|
}
|
|
@@ -46,7 +46,7 @@ export function getReferenceSnapshotBucket(persistentData, fieldKey) {
|
|
|
46
46
|
return bucket && typeof bucket === 'object' ? bucket : null;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
function setReferenceSnapshot(persistentData, fieldKey, refName, snapshot) {
|
|
50
50
|
const name = String(refName || '').trim();
|
|
51
51
|
if (!name || !snapshot || typeof snapshot !== 'object') return false;
|
|
52
52
|
const bucket = ensureReferenceSnapshotBucket(persistentData, fieldKey);
|
|
@@ -92,7 +92,7 @@ export function extractEdgeWorldPositions(obj) {
|
|
|
92
92
|
return [];
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
function extractFaceEdgePositions(face) {
|
|
96
96
|
if (!face) return [];
|
|
97
97
|
const out = [];
|
|
98
98
|
const addEdge = (edge) => {
|
|
@@ -118,7 +118,7 @@ export function extractFaceEdgePositions(face) {
|
|
|
118
118
|
return out;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
function extractFaceCenterNormal(face, edgePositions = null) {
|
|
122
122
|
if (!face) return null;
|
|
123
123
|
try { face.updateMatrixWorld?.(true); } catch { /* ignore */ }
|
|
124
124
|
|
|
@@ -240,7 +240,7 @@ export function extractFaceCenterNormal(face, edgePositions = null) {
|
|
|
240
240
|
};
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
|
|
243
|
+
function getOwningFeatureIdForSnapshotObject(obj) {
|
|
244
244
|
let cur = obj;
|
|
245
245
|
let guard = 0;
|
|
246
246
|
while (cur && guard < 8) {
|
|
@@ -14,7 +14,7 @@ export function markTransformControlTarget(target) {
|
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
function markTransformControlObject(object) {
|
|
18
18
|
markSceneOverlayObject(object, {
|
|
19
19
|
preserve: true,
|
|
20
20
|
overlayType: 'transformControl',
|
|
@@ -23,7 +23,7 @@ export function markTransformControlObject(object) {
|
|
|
23
23
|
installTransformControlDepthOverlay(object);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
function installTransformControlDepthOverlay(object) {
|
|
27
27
|
if (!object || !object.isObject3D) return;
|
|
28
28
|
const apply = (node) => {
|
|
29
29
|
try {
|