@mlightcad/data-model 1.10.3 → 1.10.5
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/dist/data-model.cjs +12 -10
- package/lib/acis/AcDbAcisDecode.d.ts +23 -0
- package/lib/acis/AcDbAcisDecode.d.ts.map +1 -0
- package/lib/acis/AcDbAcisDecode.js +95 -0
- package/lib/acis/AcDbAcisDecode.js.map +1 -0
- package/lib/acis/AcDbAcisEntities.d.ts +41 -0
- package/lib/acis/AcDbAcisEntities.d.ts.map +1 -0
- package/lib/acis/AcDbAcisEntities.js +116 -0
- package/lib/acis/AcDbAcisEntities.js.map +1 -0
- package/lib/acis/AcDbAcisGeometry.d.ts +264 -0
- package/lib/acis/AcDbAcisGeometry.d.ts.map +1 -0
- package/lib/acis/AcDbAcisGeometry.js +409 -0
- package/lib/acis/AcDbAcisGeometry.js.map +1 -0
- package/lib/acis/AcDbAcisSab.d.ts +101 -0
- package/lib/acis/AcDbAcisSab.d.ts.map +1 -0
- package/lib/acis/AcDbAcisSab.js +250 -0
- package/lib/acis/AcDbAcisSab.js.map +1 -0
- package/lib/acis/AcDbAcisSatWireframe.d.ts +13 -0
- package/lib/acis/AcDbAcisSatWireframe.d.ts.map +1 -0
- package/lib/acis/AcDbAcisSatWireframe.js +142 -0
- package/lib/acis/AcDbAcisSatWireframe.js.map +1 -0
- package/lib/acis/AcDbAcisWireframe.d.ts +20 -0
- package/lib/acis/AcDbAcisWireframe.d.ts.map +1 -0
- package/lib/acis/AcDbAcisWireframe.js +133 -0
- package/lib/acis/AcDbAcisWireframe.js.map +1 -0
- package/lib/acis/index.d.ts +15 -0
- package/lib/acis/index.d.ts.map +1 -0
- package/lib/acis/index.js +12 -0
- package/lib/acis/index.js.map +1 -0
- package/lib/database/AcDbViewportTableRecord.d.ts +11 -1
- package/lib/database/AcDbViewportTableRecord.d.ts.map +1 -1
- package/lib/database/AcDbViewportTableRecord.js +33 -5
- package/lib/database/AcDbViewportTableRecord.js.map +1 -1
- package/lib/entity/AcDb3dSolid.d.ts +42 -27
- package/lib/entity/AcDb3dSolid.d.ts.map +1 -1
- package/lib/entity/AcDb3dSolid.js +150 -54
- package/lib/entity/AcDb3dSolid.js.map +1 -1
- package/lib/entity/AcDbFcf.d.ts.map +1 -1
- package/lib/entity/AcDbFcf.js +2 -3
- package/lib/entity/AcDbFcf.js.map +1 -1
- package/lib/entity/AcDbTextExtentsHelpers.d.ts +12 -0
- package/lib/entity/AcDbTextExtentsHelpers.d.ts.map +1 -1
- package/lib/entity/AcDbTextExtentsHelpers.js +34 -0
- package/lib/entity/AcDbTextExtentsHelpers.js.map +1 -1
- package/lib/entity/index.d.ts +1 -1
- package/lib/entity/index.d.ts.map +1 -1
- package/lib/entity/index.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/misc/AcDbMemoryEstimator.d.ts +115 -0
- package/lib/misc/AcDbMemoryEstimator.d.ts.map +1 -0
- package/lib/misc/AcDbMemoryEstimator.js +753 -0
- package/lib/misc/AcDbMemoryEstimator.js.map +1 -0
- package/lib/misc/index.d.ts +2 -0
- package/lib/misc/index.d.ts.map +1 -1
- package/lib/misc/index.js +1 -0
- package/lib/misc/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AcDbAcisModel } from './AcDbAcisEntities';
|
|
2
|
+
/**
|
|
3
|
+
* Finds the byte offset of an ACIS/ASM binary signature within `data`.
|
|
4
|
+
*
|
|
5
|
+
* @param data - Raw SAB/ASM byte payload.
|
|
6
|
+
* @returns Zero-based offset, or `-1` when no known signature is found.
|
|
7
|
+
*/
|
|
8
|
+
export declare function findAcDbAcisSabSignatureOffset(data: Uint8Array): number;
|
|
9
|
+
/**
|
|
10
|
+
* Returns true when `data` begins with (or contains) an ACIS/ASM binary signature.
|
|
11
|
+
*
|
|
12
|
+
* @param data - Raw SAB/ASM byte payload.
|
|
13
|
+
*/
|
|
14
|
+
export declare function isAcDbAcisSabPayload(data: Uint8Array): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Decode an ACIS/ASM SAB byte stream into a resolved B-rep model graph.
|
|
17
|
+
*
|
|
18
|
+
* @param data - Raw SAB/ASM byte payload (may include leading non-ACIS bytes).
|
|
19
|
+
* @returns Resolved model graph, or `null` for empty payloads, missing signatures,
|
|
20
|
+
* or malformed streams.
|
|
21
|
+
*/
|
|
22
|
+
export declare function decodeAcDbAcisModel(data: Uint8Array): AcDbAcisModel | null;
|
|
23
|
+
//# sourceMappingURL=AcDbAcisDecode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcDbAcisDecode.d.ts","sourceRoot":"","sources":["../../src/acis/AcDbAcisDecode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AA+BvD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAMvE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAE9D;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,GAAG,aAAa,GAAG,IAAI,CAS1E"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
var __values = (this && this.__values) || function(o) {
|
|
2
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
3
|
+
if (m) return m.call(o);
|
|
4
|
+
if (o && typeof o.length === "number") return {
|
|
5
|
+
next: function () {
|
|
6
|
+
if (o && i >= o.length) o = void 0;
|
|
7
|
+
return { value: o && o[i++], done: !o };
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
11
|
+
};
|
|
12
|
+
import { buildAcDbAcisModel } from './AcDbAcisEntities';
|
|
13
|
+
import { parseAcDbAcisSab } from './AcDbAcisSab';
|
|
14
|
+
/** Known ACIS/ASM binary file signature strings searched in raw byte payloads. */
|
|
15
|
+
var SAB_SIGNATURES = ['ACIS BinaryFile', 'ASM BinaryFile', 'ASM BinaryFile4'];
|
|
16
|
+
/**
|
|
17
|
+
* Finds the first byte offset of an ASCII substring within `data`.
|
|
18
|
+
*
|
|
19
|
+
* @param data - Byte buffer to search.
|
|
20
|
+
* @param needle - ASCII string to locate.
|
|
21
|
+
* @returns Zero-based offset, or `-1` when not found.
|
|
22
|
+
*/
|
|
23
|
+
function findAscii(data, needle) {
|
|
24
|
+
if (needle.length === 0 || data.length < needle.length)
|
|
25
|
+
return -1;
|
|
26
|
+
var first = needle.charCodeAt(0);
|
|
27
|
+
for (var i = 0; i <= data.length - needle.length; i++) {
|
|
28
|
+
if (data[i] !== first)
|
|
29
|
+
continue;
|
|
30
|
+
var matched = true;
|
|
31
|
+
for (var j = 1; j < needle.length; j++) {
|
|
32
|
+
if (data[i + j] !== needle.charCodeAt(j)) {
|
|
33
|
+
matched = false;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (matched)
|
|
38
|
+
return i;
|
|
39
|
+
}
|
|
40
|
+
return -1;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Finds the byte offset of an ACIS/ASM binary signature within `data`.
|
|
44
|
+
*
|
|
45
|
+
* @param data - Raw SAB/ASM byte payload.
|
|
46
|
+
* @returns Zero-based offset, or `-1` when no known signature is found.
|
|
47
|
+
*/
|
|
48
|
+
export function findAcDbAcisSabSignatureOffset(data) {
|
|
49
|
+
var e_1, _a;
|
|
50
|
+
try {
|
|
51
|
+
for (var SAB_SIGNATURES_1 = __values(SAB_SIGNATURES), SAB_SIGNATURES_1_1 = SAB_SIGNATURES_1.next(); !SAB_SIGNATURES_1_1.done; SAB_SIGNATURES_1_1 = SAB_SIGNATURES_1.next()) {
|
|
52
|
+
var signature = SAB_SIGNATURES_1_1.value;
|
|
53
|
+
var offset = findAscii(data, signature);
|
|
54
|
+
if (offset >= 0)
|
|
55
|
+
return offset;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
59
|
+
finally {
|
|
60
|
+
try {
|
|
61
|
+
if (SAB_SIGNATURES_1_1 && !SAB_SIGNATURES_1_1.done && (_a = SAB_SIGNATURES_1.return)) _a.call(SAB_SIGNATURES_1);
|
|
62
|
+
}
|
|
63
|
+
finally { if (e_1) throw e_1.error; }
|
|
64
|
+
}
|
|
65
|
+
return -1;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Returns true when `data` begins with (or contains) an ACIS/ASM binary signature.
|
|
69
|
+
*
|
|
70
|
+
* @param data - Raw SAB/ASM byte payload.
|
|
71
|
+
*/
|
|
72
|
+
export function isAcDbAcisSabPayload(data) {
|
|
73
|
+
return findAcDbAcisSabSignatureOffset(data) >= 0;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Decode an ACIS/ASM SAB byte stream into a resolved B-rep model graph.
|
|
77
|
+
*
|
|
78
|
+
* @param data - Raw SAB/ASM byte payload (may include leading non-ACIS bytes).
|
|
79
|
+
* @returns Resolved model graph, or `null` for empty payloads, missing signatures,
|
|
80
|
+
* or malformed streams.
|
|
81
|
+
*/
|
|
82
|
+
export function decodeAcDbAcisModel(data) {
|
|
83
|
+
if (data.length === 0)
|
|
84
|
+
return null;
|
|
85
|
+
var offset = findAcDbAcisSabSignatureOffset(data);
|
|
86
|
+
if (offset < 0)
|
|
87
|
+
return null;
|
|
88
|
+
try {
|
|
89
|
+
return buildAcDbAcisModel(parseAcDbAcisSab(data.subarray(offset)));
|
|
90
|
+
}
|
|
91
|
+
catch (_a) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=AcDbAcis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7D,KAAwB,IAAA,mBAAA,SAAA,cAAc,CAAA,8CAAA,0EAAE,CAAC;YAApC,IAAM,SAAS,2BAAA;YAClB,IAAM,MAAM,GAAG,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;YACzC,IAAI,MAAM,IAAI,CAAC;gBAAE,OAAO,MAAM,CAAA;QAChC,CAAC;;;;;;;;;IACD,OAAO,CAAC,CAAC,CAAA;AACX,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAgB;IACnD,OAAO,8BAA8B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAClD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAgB;IAClD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IAClC,IAAM,MAAM,GAAG,8BAA8B,CAAC,IAAI,CAAC,CAAA;IACnD,IAAI,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAA;IAC3B,IAAI,CAAC;QACH,OAAO,kBAAkB,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IACpE,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { AcDbAcisSabData, AcDbAcisSabHeader, AcDbAcisSabRecord, AcDbAcisSabVector } from './AcDbAcisSab';
|
|
2
|
+
/**
|
|
3
|
+
* One node in the resolved ACIS B-rep entity DAG.
|
|
4
|
+
* Pointers in the source record are resolved to references to other nodes.
|
|
5
|
+
*/
|
|
6
|
+
export interface AcDbAcisNode {
|
|
7
|
+
/** Zero-based index of this node in the model's record list. */
|
|
8
|
+
readonly index: number;
|
|
9
|
+
/** ACIS entity type name, e.g. `"body"`, `"edge"`, `"plane-surface"`. */
|
|
10
|
+
readonly type: string;
|
|
11
|
+
/** Raw SAB record backing this node. */
|
|
12
|
+
readonly record: AcDbAcisSabRecord;
|
|
13
|
+
/** Resolved pointer targets from this record's tokens. */
|
|
14
|
+
readonly refs: readonly (AcDbAcisNode | null)[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Resolved ACIS/ASM B-rep model graph built from parsed SAB data.
|
|
18
|
+
*/
|
|
19
|
+
export interface AcDbAcisModel {
|
|
20
|
+
/** Parsed SAB file header metadata. */
|
|
21
|
+
readonly header: AcDbAcisSabHeader;
|
|
22
|
+
/** All resolved entity nodes in record order. */
|
|
23
|
+
readonly nodes: readonly AcDbAcisNode[];
|
|
24
|
+
/** Top-level `body` entity nodes. */
|
|
25
|
+
readonly bodies: readonly AcDbAcisNode[];
|
|
26
|
+
/** Count of nodes per entity type name. */
|
|
27
|
+
readonly typeCounts: ReadonlyMap<string, number>;
|
|
28
|
+
/** Returns all nodes whose entity type matches `type`. */
|
|
29
|
+
nodesOfType(type: string): readonly AcDbAcisNode[];
|
|
30
|
+
/** Collects 3D locations from all `point` entity records. */
|
|
31
|
+
pointLocations(): readonly AcDbAcisSabVector[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Builds a resolved B-rep DAG from parsed SAB data by wiring pointer tokens
|
|
35
|
+
* between records.
|
|
36
|
+
*
|
|
37
|
+
* @param sab - Parsed SAB header and record list from {@link parseAcDbAcisSab}.
|
|
38
|
+
* @returns Resolved model graph with indexed nodes and type-based lookups.
|
|
39
|
+
*/
|
|
40
|
+
export declare function buildAcDbAcisModel(sab: AcDbAcisSabData): AcDbAcisModel;
|
|
41
|
+
//# sourceMappingURL=AcDbAcisEntities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcDbAcisEntities.d.ts","sourceRoot":"","sources":["../../src/acis/AcDbAcisEntities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,eAAe,CAAA;AAGtB;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,yEAAyE;IACzE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,wCAAwC;IACxC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAA;IAClC,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,EAAE,CAAA;CAChD;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,uCAAuC;IACvC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAA;IAClC,iDAAiD;IACjD,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAA;IACvC,qCAAqC;IACrC,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAA;IACxC,2CAA2C;IAC3C,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChD,0DAA0D;IAC1D,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,YAAY,EAAE,CAAA;IAClD,6DAA6D;IAC7D,cAAc,IAAI,SAAS,iBAAiB,EAAE,CAAA;CAC/C;AAeD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,eAAe,GAAG,aAAa,CAgDtE"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
var __values = (this && this.__values) || function(o) {
|
|
2
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
3
|
+
if (m) return m.call(o);
|
|
4
|
+
if (o && typeof o.length === "number") return {
|
|
5
|
+
next: function () {
|
|
6
|
+
if (o && i >= o.length) o = void 0;
|
|
7
|
+
return { value: o && o[i++], done: !o };
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
11
|
+
};
|
|
12
|
+
import { AcDbAcisSabTag } from './AcDbAcisSab';
|
|
13
|
+
var END_MARKERS = new Set([
|
|
14
|
+
'End-of-ACIS-data',
|
|
15
|
+
'End-of-ASM-data',
|
|
16
|
+
'End-of-ACIS-History-data',
|
|
17
|
+
]);
|
|
18
|
+
/**
|
|
19
|
+
* Builds a resolved B-rep DAG from parsed SAB data by wiring pointer tokens
|
|
20
|
+
* between records.
|
|
21
|
+
*
|
|
22
|
+
* @param sab - Parsed SAB header and record list from {@link parseAcDbAcisSab}.
|
|
23
|
+
* @returns Resolved model graph with indexed nodes and type-based lookups.
|
|
24
|
+
*/
|
|
25
|
+
export function buildAcDbAcisModel(sab) {
|
|
26
|
+
var e_1, _a, e_2, _b, e_3, _c;
|
|
27
|
+
var _d, _e;
|
|
28
|
+
var records = sab.records;
|
|
29
|
+
var nodes = records.map(function (record, index) { return ({
|
|
30
|
+
index: index,
|
|
31
|
+
type: record.type,
|
|
32
|
+
record: record,
|
|
33
|
+
refs: [],
|
|
34
|
+
}); });
|
|
35
|
+
try {
|
|
36
|
+
for (var nodes_1 = __values(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {
|
|
37
|
+
var node = nodes_1_1.value;
|
|
38
|
+
try {
|
|
39
|
+
for (var _f = (e_2 = void 0, __values(node.record.tokens)), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
40
|
+
var token = _g.value;
|
|
41
|
+
if (token.tag !== AcDbAcisSabTag.Pointer)
|
|
42
|
+
continue;
|
|
43
|
+
var target = token.value;
|
|
44
|
+
node.refs.push(target >= 0 && target < nodes.length ? nodes[target] : null);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
48
|
+
finally {
|
|
49
|
+
try {
|
|
50
|
+
if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
|
|
51
|
+
}
|
|
52
|
+
finally { if (e_2) throw e_2.error; }
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
57
|
+
finally {
|
|
58
|
+
try {
|
|
59
|
+
if (nodes_1_1 && !nodes_1_1.done && (_a = nodes_1.return)) _a.call(nodes_1);
|
|
60
|
+
}
|
|
61
|
+
finally { if (e_1) throw e_1.error; }
|
|
62
|
+
}
|
|
63
|
+
var frozen = nodes;
|
|
64
|
+
var byType = new Map();
|
|
65
|
+
var typeCounts = new Map();
|
|
66
|
+
try {
|
|
67
|
+
for (var frozen_1 = __values(frozen), frozen_1_1 = frozen_1.next(); !frozen_1_1.done; frozen_1_1 = frozen_1.next()) {
|
|
68
|
+
var node = frozen_1_1.value;
|
|
69
|
+
if (END_MARKERS.has(node.type))
|
|
70
|
+
continue;
|
|
71
|
+
var bucket = byType.get(node.type);
|
|
72
|
+
if (bucket === undefined) {
|
|
73
|
+
bucket = [];
|
|
74
|
+
byType.set(node.type, bucket);
|
|
75
|
+
}
|
|
76
|
+
bucket.push(node);
|
|
77
|
+
typeCounts.set(node.type, ((_d = typeCounts.get(node.type)) !== null && _d !== void 0 ? _d : 0) + 1);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
81
|
+
finally {
|
|
82
|
+
try {
|
|
83
|
+
if (frozen_1_1 && !frozen_1_1.done && (_c = frozen_1.return)) _c.call(frozen_1);
|
|
84
|
+
}
|
|
85
|
+
finally { if (e_3) throw e_3.error; }
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
header: sab.header,
|
|
89
|
+
nodes: frozen,
|
|
90
|
+
bodies: (_e = byType.get('body')) !== null && _e !== void 0 ? _e : [],
|
|
91
|
+
typeCounts: typeCounts,
|
|
92
|
+
nodesOfType: function (type) { var _a; return (_a = byType.get(type)) !== null && _a !== void 0 ? _a : []; },
|
|
93
|
+
pointLocations: function () {
|
|
94
|
+
var e_4, _a;
|
|
95
|
+
var _b;
|
|
96
|
+
var out = [];
|
|
97
|
+
try {
|
|
98
|
+
for (var _c = __values((_b = byType.get('point')) !== null && _b !== void 0 ? _b : []), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
99
|
+
var node = _d.value;
|
|
100
|
+
var vec = node.record.tokens.find(function (t) { return t.tag === AcDbAcisSabTag.LocationVec; });
|
|
101
|
+
if (vec !== undefined)
|
|
102
|
+
out.push(vec.value);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
106
|
+
finally {
|
|
107
|
+
try {
|
|
108
|
+
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
109
|
+
}
|
|
110
|
+
finally { if (e_4) throw e_4.error; }
|
|
111
|
+
}
|
|
112
|
+
return out;
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=AcDbAcisEntities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcDbAcisEntities.js","sourceRoot":"","sources":["../../src/acis/AcDbAcisEntities.ts"],"names":[],"mappings":";;;;;;;;;;;AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAmC9C,IAAM,WAAW,GAAG,IAAI,GAAG,CAAC;IAC1B,kBAAkB;IAClB,iBAAiB;IACjB,0BAA0B;CAC3B,CAAC,CAAA;AASF;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAoB;;;IACrD,IAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAA;IAC3B,IAAM,KAAK,GAA0B,OAAO,CAAC,GAAG,CAAC,UAAC,MAAM,EAAE,KAAK,IAAK,OAAA,CAAC;QACnE,KAAK,OAAA;QACL,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,MAAM,QAAA;QACN,IAAI,EAAE,EAAE;KACT,CAAC,EALkE,CAKlE,CAAC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,IAAI,CAAC,IAAI,CAAC,mCAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;QACjE,CAAC;;;;;;;;;IAED,OAAO;QACL,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAA,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,mCAAI,EAAE;QAChC,UAAU,YAAA;QACV,WAAW,EAAE,UAAC,IAAY,YAAK,OAAA,MAAA,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,mCAAI,EAAE,CAAA,EAAA;QACrD,cAAc;;;YACZ,IAAM,GAAG,GAAwB,EAAE,CAAA;;gBACnC,KAAmB,IAAA,KAAA,SAAA,MAAA,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,mCAAI,EAAE,CAAA,gBAAA,4BAAE,CAAC;oBAA1C,IAAM,IAAI,WAAA;oBACb,IAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,GAAG,KAAK,cAAc,CAAC,WAAW,EAApC,CAAoC,CAAC,CAAA;oBAC9E,IAAI,GAAG,KAAK,SAAS;wBAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAA0B,CAAC,CAAA;gBACjE,CAAC;;;;;;;;;YACD,OAAO,GAAG,CAAA;QACZ,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import type { AcDbAcisModel, AcDbAcisNode } from './AcDbAcisEntities';
|
|
2
|
+
import type { AcDbAcisSabVector } from './AcDbAcisSab';
|
|
3
|
+
/** 3D position or direction vector `[x, y, z]`. */
|
|
4
|
+
export type AcDbAcisVec3 = AcDbAcisSabVector;
|
|
5
|
+
/** Known analytic curve kinds extracted from ACIS edge geometry. */
|
|
6
|
+
export type AcDbAcisCurveKind = 'straight' | 'ellipse' | 'intcurve' | 'unknown';
|
|
7
|
+
/** Known analytic surface kinds extracted from ACIS face geometry. */
|
|
8
|
+
export type AcDbAcisSurfaceKind = 'plane' | 'cone' | 'torus' | 'sphere' | 'spline' | 'unknown';
|
|
9
|
+
/** Parameters for a straight (line) ACIS curve. */
|
|
10
|
+
export interface AcDbAcisStraightCurveParams {
|
|
11
|
+
readonly kind: 'straight';
|
|
12
|
+
/** Line origin in model space. */
|
|
13
|
+
readonly origin: AcDbAcisVec3;
|
|
14
|
+
/** Unit direction vector along the line. */
|
|
15
|
+
readonly direction: AcDbAcisVec3;
|
|
16
|
+
}
|
|
17
|
+
/** Parameters for an ellipse (or circular arc) ACIS curve. */
|
|
18
|
+
export interface AcDbAcisEllipseCurveParams {
|
|
19
|
+
readonly kind: 'ellipse';
|
|
20
|
+
/** Ellipse center in model space. */
|
|
21
|
+
readonly center: AcDbAcisVec3;
|
|
22
|
+
/** Plane normal of the ellipse. */
|
|
23
|
+
readonly normal: AcDbAcisVec3;
|
|
24
|
+
/** Major-axis vector (length defines semi-major axis). */
|
|
25
|
+
readonly majorAxis: AcDbAcisVec3;
|
|
26
|
+
/** Ratio of minor to major axis length. */
|
|
27
|
+
readonly ratio: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* An interpolated/intersection spline curve. `controlPoints` is the `nubs`/`nurbs`
|
|
31
|
+
* B-spline control polygon extracted from the record's subtype block — a usable
|
|
32
|
+
* polyline approximation of the curve (the first/last control point coincide with
|
|
33
|
+
* the edge's start/end vertices). Empty when the subtype is a `nullbs` placeholder
|
|
34
|
+
* or the control polygon could not be read. Full NURBS evaluation is out of scope.
|
|
35
|
+
*/
|
|
36
|
+
export interface AcDbAcisIntCurveParams {
|
|
37
|
+
readonly kind: 'intcurve';
|
|
38
|
+
/** B-spline control polygon used as a polyline wireframe approximation. */
|
|
39
|
+
readonly controlPoints: readonly AcDbAcisVec3[];
|
|
40
|
+
}
|
|
41
|
+
/** Discriminated union of parsed ACIS curve parameters. */
|
|
42
|
+
export type AcDbAcisCurveParams = AcDbAcisStraightCurveParams | AcDbAcisEllipseCurveParams | AcDbAcisIntCurveParams | {
|
|
43
|
+
readonly kind: 'unknown';
|
|
44
|
+
};
|
|
45
|
+
/** Parameters for a plane ACIS surface. */
|
|
46
|
+
export interface AcDbAcisPlaneParams {
|
|
47
|
+
readonly kind: 'plane';
|
|
48
|
+
/** Point on the plane. */
|
|
49
|
+
readonly origin: AcDbAcisVec3;
|
|
50
|
+
/** Outward plane normal. */
|
|
51
|
+
readonly normal: AcDbAcisVec3;
|
|
52
|
+
/** Optional in-plane U direction. */
|
|
53
|
+
readonly uDir?: AcDbAcisVec3;
|
|
54
|
+
}
|
|
55
|
+
/** Parameters for a cone (or cylinder) ACIS surface. */
|
|
56
|
+
export interface AcDbAcisConeParams {
|
|
57
|
+
readonly kind: 'cone';
|
|
58
|
+
/** Apex or base reference point. */
|
|
59
|
+
readonly origin: AcDbAcisVec3;
|
|
60
|
+
/** Axis direction. */
|
|
61
|
+
readonly axis: AcDbAcisVec3;
|
|
62
|
+
/** Major-axis vector in the base plane. */
|
|
63
|
+
readonly majorAxis: AcDbAcisVec3;
|
|
64
|
+
/** Ratio of minor to major axis in the base ellipse. */
|
|
65
|
+
readonly ratio: number;
|
|
66
|
+
/** Sine of the half-angle between axis and surface generator. */
|
|
67
|
+
readonly sineAngle: number;
|
|
68
|
+
/** Cosine of the half-angle between axis and surface generator. */
|
|
69
|
+
readonly cosineAngle: number;
|
|
70
|
+
}
|
|
71
|
+
/** Parameters for a torus ACIS surface. */
|
|
72
|
+
export interface AcDbAcisTorusParams {
|
|
73
|
+
readonly kind: 'torus';
|
|
74
|
+
/** Torus center in model space. */
|
|
75
|
+
readonly center: AcDbAcisVec3;
|
|
76
|
+
/** Revolution axis direction. */
|
|
77
|
+
readonly axis: AcDbAcisVec3;
|
|
78
|
+
/** Distance from center to tube centerline. */
|
|
79
|
+
readonly majorRadius: number;
|
|
80
|
+
/** Tube radius. */
|
|
81
|
+
readonly minorRadius: number;
|
|
82
|
+
}
|
|
83
|
+
/** Parameters for a sphere ACIS surface. */
|
|
84
|
+
export interface AcDbAcisSphereParams {
|
|
85
|
+
readonly kind: 'sphere';
|
|
86
|
+
/** Sphere center in model space. */
|
|
87
|
+
readonly center: AcDbAcisVec3;
|
|
88
|
+
/** Sphere radius. */
|
|
89
|
+
readonly radius: number;
|
|
90
|
+
/** Reference U direction on the sphere. */
|
|
91
|
+
readonly uDir: AcDbAcisVec3;
|
|
92
|
+
/** Pole axis direction. */
|
|
93
|
+
readonly poleAxis: AcDbAcisVec3;
|
|
94
|
+
}
|
|
95
|
+
/** Discriminated union of parsed ACIS surface parameters. */
|
|
96
|
+
export type AcDbAcisSurfaceParams = AcDbAcisPlaneParams | AcDbAcisConeParams | AcDbAcisTorusParams | AcDbAcisSphereParams | {
|
|
97
|
+
readonly kind: 'unknown';
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* A B-rep vertex with its resolved 3D point location.
|
|
101
|
+
*/
|
|
102
|
+
export interface AcDbAcisVertex {
|
|
103
|
+
/** Index of the source `vertex` node in the model graph. */
|
|
104
|
+
readonly nodeIndex: number;
|
|
105
|
+
/** Resolved 3D point location, or `null` when the pointer chain is broken. */
|
|
106
|
+
readonly point: AcDbAcisVec3 | null;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* A B-rep edge with resolved endpoint locations and optional curve parameters.
|
|
110
|
+
*/
|
|
111
|
+
export interface AcDbAcisEdge {
|
|
112
|
+
/** Index of the source `edge` node in the model graph. */
|
|
113
|
+
readonly nodeIndex: number;
|
|
114
|
+
/** Resolved start vertex location. */
|
|
115
|
+
readonly start: AcDbAcisVec3 | null;
|
|
116
|
+
/** Resolved end vertex location. */
|
|
117
|
+
readonly end: AcDbAcisVec3 | null;
|
|
118
|
+
/** Parsed analytic curve kind. */
|
|
119
|
+
readonly curveType: AcDbAcisCurveKind;
|
|
120
|
+
/** Parsed curve parameters when the subtype is recognized. */
|
|
121
|
+
readonly curve?: AcDbAcisCurveParams;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* One boundary loop on a B-rep face.
|
|
125
|
+
*/
|
|
126
|
+
export interface AcDbAcisFaceLoop {
|
|
127
|
+
/** Index of the source `loop` node in the model graph. */
|
|
128
|
+
readonly nodeIndex: number;
|
|
129
|
+
/** Number of coedges in the loop ring. */
|
|
130
|
+
readonly coedgeCount: number;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* A B-rep face with surface type/parameters and boundary loop structure.
|
|
134
|
+
*/
|
|
135
|
+
export interface AcDbAcisFace {
|
|
136
|
+
/** Index of the source `face` node in the model graph. */
|
|
137
|
+
readonly nodeIndex: number;
|
|
138
|
+
/** Parsed analytic surface kind. */
|
|
139
|
+
readonly surfaceType: AcDbAcisSurfaceKind;
|
|
140
|
+
/** Parsed surface parameters when the subtype is recognized. */
|
|
141
|
+
readonly surface?: AcDbAcisSurfaceParams;
|
|
142
|
+
/** Ordered boundary loops on this face. */
|
|
143
|
+
readonly loops: readonly AcDbAcisFaceLoop[];
|
|
144
|
+
}
|
|
145
|
+
/** Axis-aligned bounding box over a set of 3D points. */
|
|
146
|
+
export interface AcDbAcisBBox {
|
|
147
|
+
/** Minimum corner `[x, y, z]`. */
|
|
148
|
+
readonly min: AcDbAcisVec3;
|
|
149
|
+
/** Maximum corner `[x, y, z]`. */
|
|
150
|
+
readonly max: AcDbAcisVec3;
|
|
151
|
+
}
|
|
152
|
+
/** An indexed triangle mesh for one face: shared `positions` + `triangles` (index triples). */
|
|
153
|
+
export interface AcDbAcisTriangleMesh {
|
|
154
|
+
/** Source surface kind for this mesh. */
|
|
155
|
+
readonly surfaceType: AcDbAcisSurfaceKind;
|
|
156
|
+
/** Shared vertex positions referenced by `triangles`. */
|
|
157
|
+
readonly positions: readonly AcDbAcisVec3[];
|
|
158
|
+
/** Triangle index triples into `positions`. */
|
|
159
|
+
readonly triangles: readonly (readonly [number, number, number])[];
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Tessellation of a body's faces.
|
|
163
|
+
*
|
|
164
|
+
* - `faces`: legacy flat-polygon rings — one ordered ring per plane-surface face
|
|
165
|
+
* bounded entirely by straight edges (kept for existing consumers).
|
|
166
|
+
* - `triangles`: indexed triangle meshes covering plane faces (fan-triangulated)
|
|
167
|
+
* **and** the analytic curved faces — `cone` (incl. cylinders) and `torus`,
|
|
168
|
+
* meshed as full surfaces of revolution with the v-range taken from each
|
|
169
|
+
* face's loops. Correct for full-revolution faces (the common case);
|
|
170
|
+
* u-partial curved faces are approximated (flagged in `diagnostics`).
|
|
171
|
+
* sphere/spline surfaces are not meshed.
|
|
172
|
+
*/
|
|
173
|
+
export interface AcDbAcisMesh {
|
|
174
|
+
/** Legacy flat polygon rings for plane faces bounded by straight edges. */
|
|
175
|
+
readonly faces: readonly (readonly AcDbAcisVec3[])[];
|
|
176
|
+
/** Indexed triangle meshes for plane and selected curved faces. */
|
|
177
|
+
readonly triangles: readonly AcDbAcisTriangleMesh[];
|
|
178
|
+
/** Best-effort tessellation notes and approximations. */
|
|
179
|
+
readonly diagnostics: readonly string[];
|
|
180
|
+
}
|
|
181
|
+
/** Options for {@link tessellateAcDbAcisGeometry}. */
|
|
182
|
+
export interface AcDbAcisTessellationOptions {
|
|
183
|
+
/** Samples per full revolution for curved faces (≥3). Default 32. */
|
|
184
|
+
readonly segments?: number;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Extracted B-rep geometry from a decoded ACIS model.
|
|
188
|
+
*/
|
|
189
|
+
export interface AcDbAcisGeometry {
|
|
190
|
+
/** Resolved B-rep vertices. */
|
|
191
|
+
readonly vertices: readonly AcDbAcisVertex[];
|
|
192
|
+
/** Resolved B-rep edges with optional curve parameters. */
|
|
193
|
+
readonly edges: readonly AcDbAcisEdge[];
|
|
194
|
+
/** Resolved B-rep faces with optional surface parameters. */
|
|
195
|
+
readonly faces: readonly AcDbAcisFace[];
|
|
196
|
+
/** Wireframe bounding box over resolved vertex points, or null when none resolve. */
|
|
197
|
+
readonly bbox: AcDbAcisBBox | null;
|
|
198
|
+
/** Best-effort notes: dangling pointers, degenerate edges, unhandled subtypes. */
|
|
199
|
+
readonly diagnostics: readonly string[];
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Summary statistics over extracted ACIS geometry.
|
|
203
|
+
*/
|
|
204
|
+
export interface AcDbAcisGeometrySummary {
|
|
205
|
+
/** Number of resolved vertices. */
|
|
206
|
+
readonly vertexCount: number;
|
|
207
|
+
/** Number of resolved edges. */
|
|
208
|
+
readonly edgeCount: number;
|
|
209
|
+
/** Number of resolved faces. */
|
|
210
|
+
readonly faceCount: number;
|
|
211
|
+
/** Total boundary loops across all faces. */
|
|
212
|
+
readonly loopCount: number;
|
|
213
|
+
/** Histogram of parsed curve kinds. */
|
|
214
|
+
readonly curveTypes: Readonly<Record<AcDbAcisCurveKind, number>>;
|
|
215
|
+
/** Histogram of parsed surface kinds. */
|
|
216
|
+
readonly surfaceTypes: Readonly<Record<AcDbAcisSurfaceKind, number>>;
|
|
217
|
+
/** Bounding box over resolved vertices, if any. */
|
|
218
|
+
readonly bbox: AcDbAcisBBox | null;
|
|
219
|
+
/** Number of diagnostic messages. */
|
|
220
|
+
readonly diagnosticCount: number;
|
|
221
|
+
/** Diagnostic messages from geometry extraction. */
|
|
222
|
+
readonly diagnostics: readonly string[];
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Parses analytic surface parameters from a `-surface` ACIS node.
|
|
226
|
+
*
|
|
227
|
+
* @param surface - Resolved surface node from an ACIS model graph.
|
|
228
|
+
* @returns Discriminated surface parameters, or `{ kind: 'unknown' }`.
|
|
229
|
+
*/
|
|
230
|
+
export declare function acDbAcisParseSurfaceParams(surface: AcDbAcisNode): AcDbAcisSurfaceParams;
|
|
231
|
+
/**
|
|
232
|
+
* Extract the B-rep geometry from a decoded ACIS model. Never throws; unresolved
|
|
233
|
+
* topology/geometry is reported via `diagnostics` and `'unknown'` type labels.
|
|
234
|
+
*
|
|
235
|
+
* @param model - Resolved ACIS model graph.
|
|
236
|
+
* @returns Extracted vertices, edges, faces, bounding box, and diagnostics.
|
|
237
|
+
*/
|
|
238
|
+
export declare function extractAcDbAcisGeometry(model: AcDbAcisModel): AcDbAcisGeometry;
|
|
239
|
+
/**
|
|
240
|
+
* Reads the curve parameter interval carried on an `edge` record (first two doubles).
|
|
241
|
+
*
|
|
242
|
+
* @param edge - Resolved `edge` node from an ACIS model graph.
|
|
243
|
+
* @returns Parameter interval `[t0, t1]`, or `null` when unavailable.
|
|
244
|
+
*/
|
|
245
|
+
export declare function acDbAcisEdgeParamBounds(edge: AcDbAcisNode): [number, number] | null;
|
|
246
|
+
/**
|
|
247
|
+
* Sample an ellipse-curve arc over its parameter interval.
|
|
248
|
+
*
|
|
249
|
+
* @param params - Parsed ellipse curve parameters.
|
|
250
|
+
* @param t0 - Start parameter in radians.
|
|
251
|
+
* @param t1 - End parameter in radians.
|
|
252
|
+
* @param samples - Number of interior segments (≥1).
|
|
253
|
+
* @returns Sampled points along the arc, including both endpoints.
|
|
254
|
+
*/
|
|
255
|
+
export declare function sampleAcDbAcisEllipseArc(params: AcDbAcisEllipseCurveParams, t0: number, t1: number, samples: number): AcDbAcisVec3[];
|
|
256
|
+
/**
|
|
257
|
+
* Sample wireframe circles for a sphere surface (latitude/longitude-style rings).
|
|
258
|
+
*
|
|
259
|
+
* @param params - Parsed sphere surface parameters.
|
|
260
|
+
* @param segments - Approximate number of samples per full ring (default 16).
|
|
261
|
+
* @returns Closed polylines forming a sphere wireframe scaffold.
|
|
262
|
+
*/
|
|
263
|
+
export declare function sampleAcDbAcisSphereWireframe(params: AcDbAcisSphereParams, segments?: number): AcDbAcisVec3[][];
|
|
264
|
+
//# sourceMappingURL=AcDbAcisGeometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcDbAcisGeometry.d.ts","sourceRoot":"","sources":["../../src/acis/AcDbAcisGeometry.ts"],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