@mlightcad/data-model 1.2.22 → 1.2.23
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.js
CHANGED
|
@@ -15636,12 +15636,7 @@ const Aa = class Aa extends Wt {
|
|
|
15636
15636
|
* All vertices are set to the origin.
|
|
15637
15637
|
*/
|
|
15638
15638
|
constructor() {
|
|
15639
|
-
super(), this._vertices = [
|
|
15640
|
-
new Y(),
|
|
15641
|
-
new Y(),
|
|
15642
|
-
new Y(),
|
|
15643
|
-
new Y()
|
|
15644
|
-
], this._edgeInvisibilities = 0;
|
|
15639
|
+
super(), this._vertices = [new Y(), new Y(), new Y()], this._edgeInvisibilities = 0;
|
|
15645
15640
|
}
|
|
15646
15641
|
/**
|
|
15647
15642
|
* Gets the point at the specified index in this face.
|
|
@@ -15660,7 +15655,7 @@ const Aa = class Aa extends Wt {
|
|
|
15660
15655
|
* ```
|
|
15661
15656
|
*/
|
|
15662
15657
|
getVertexAt(e) {
|
|
15663
|
-
return e < 0 ? this._vertices[0] : e >
|
|
15658
|
+
return e < 0 ? this._vertices[0] : e > this._vertices.length ? this._vertices[this._vertices.length - 1] : this._vertices[e];
|
|
15664
15659
|
}
|
|
15665
15660
|
/**
|
|
15666
15661
|
* Sets the point at the specified index in this face.
|
|
@@ -15680,7 +15675,8 @@ const Aa = class Aa extends Wt {
|
|
|
15680
15675
|
* ```
|
|
15681
15676
|
*/
|
|
15682
15677
|
setVertexAt(e, t) {
|
|
15683
|
-
if (e < 0 && this._vertices[0].copy(t), e
|
|
15678
|
+
if (e < 0 && this._vertices[0].copy(t), e >= 3)
|
|
15679
|
+
return this._vertices.length === 3 && this._vertices.push(new Y()), this._vertices[3].copy(t);
|
|
15684
15680
|
this._vertices[e].copy(t);
|
|
15685
15681
|
}
|
|
15686
15682
|
/**
|
|
@@ -15791,10 +15787,10 @@ const Aa = class Aa extends Wt {
|
|
|
15791
15787
|
* ```
|
|
15792
15788
|
*/
|
|
15793
15789
|
draw(e) {
|
|
15794
|
-
const t = new Float32Array(
|
|
15795
|
-
for (let
|
|
15796
|
-
|
|
15797
|
-
return e.lineSegments(
|
|
15790
|
+
const t = this._vertices.length, s = new Float32Array(t * 3), o = new Uint16Array(t * 2);
|
|
15791
|
+
for (let h = 0; h < t; h++)
|
|
15792
|
+
s[h * 3] = this._vertices[h].x, s[h * 3 + 1] = this._vertices[h].y, s[h * 3 + 2] = this._vertices[h].z, this.isEdgeVisibleAt(h) && (o[h * 2] = h, o[h * 2 + 1] = (h + 1) % 4);
|
|
15793
|
+
return e.lineSegments(s, 3, o, this.lineStyle);
|
|
15798
15794
|
}
|
|
15799
15795
|
};
|
|
15800
15796
|
Aa.typeName = "Face";
|
package/lib/entity/AcDbFace.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { AcDbEntity } from './AcDbEntity';
|
|
|
10
10
|
export declare class AcDbFace extends AcDbEntity {
|
|
11
11
|
/** The entity type name */
|
|
12
12
|
static typeName: string;
|
|
13
|
-
/** The four vertices of the face */
|
|
13
|
+
/** The three or four vertices of the face */
|
|
14
14
|
private _vertices;
|
|
15
15
|
/** The invisibility of the edges of the face */
|
|
16
16
|
private _edgeInvisibilities;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcDbFace.d.ts","sourceRoot":"","sources":["../../src/entity/AcDbFace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,WAAW,EACX,aAAa,EACd,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC;;;;;GAKG;AACH,qBAAa,QAAS,SAAQ,UAAU;IACtC,2BAA2B;IAC3B,OAAgB,QAAQ,EAAE,MAAM,CAAS;IAEzC,
|
|
1
|
+
{"version":3,"file":"AcDbFace.d.ts","sourceRoot":"","sources":["../../src/entity/AcDbFace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,WAAW,EACX,aAAa,EACd,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC;;;;;GAKG;AACH,qBAAa,QAAS,SAAQ,UAAU;IACtC,2BAA2B;IAC3B,OAAgB,QAAQ,EAAE,MAAM,CAAS;IAEzC,6CAA6C;IAC7C,OAAO,CAAC,SAAS,CAAe;IAChC,gDAAgD;IAChD,OAAO,CAAC,mBAAmB,CAAQ;IAEnC;;;;;OAKG;;IAOH;;;;;;;;;;;;;;;OAeG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW;IAQvC;;;;;;;;;;;;;;;;OAgBG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa;IAW/C;;;;;;;;;;;;;;OAcG;IACH,qBAAqB,CAAC,cAAc,EAAE,MAAM;IAI5C;;;;;;;;;;;;;;OAcG;IACH,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAOvC;;;;;;;;;;;;;;;OAeG;IACH,mBAAmB,CAAC,KAAK,EAAE,MAAM;IAOjC;;;;;;;;;;OAUG;IACH,IAAI,gBAAgB,IAAI,SAAS,CAEhC;IAED;;;;;;;;;;;;;OAaG;IACH,gBAAgB;IAQhB;;;;;;;;;;;;;OAaG;IACH,IAAI,CAAC,QAAQ,EAAE,YAAY;CAgB5B"}
|
package/lib/entity/AcDbFace.js
CHANGED
|
@@ -31,12 +31,7 @@ var AcDbFace = /** @class */ (function (_super) {
|
|
|
31
31
|
*/
|
|
32
32
|
function AcDbFace() {
|
|
33
33
|
var _this = _super.call(this) || this;
|
|
34
|
-
_this._vertices = [
|
|
35
|
-
new AcGePoint3d(),
|
|
36
|
-
new AcGePoint3d(),
|
|
37
|
-
new AcGePoint3d(),
|
|
38
|
-
new AcGePoint3d()
|
|
39
|
-
];
|
|
34
|
+
_this._vertices = [new AcGePoint3d(), new AcGePoint3d(), new AcGePoint3d()];
|
|
40
35
|
_this._edgeInvisibilities = 0;
|
|
41
36
|
return _this;
|
|
42
37
|
}
|
|
@@ -59,8 +54,9 @@ var AcDbFace = /** @class */ (function (_super) {
|
|
|
59
54
|
AcDbFace.prototype.getVertexAt = function (index) {
|
|
60
55
|
if (index < 0)
|
|
61
56
|
return this._vertices[0];
|
|
62
|
-
if (index >
|
|
63
|
-
return this._vertices[
|
|
57
|
+
if (index > this._vertices.length) {
|
|
58
|
+
return this._vertices[this._vertices.length - 1];
|
|
59
|
+
}
|
|
64
60
|
return this._vertices[index];
|
|
65
61
|
};
|
|
66
62
|
/**
|
|
@@ -83,8 +79,12 @@ var AcDbFace = /** @class */ (function (_super) {
|
|
|
83
79
|
AcDbFace.prototype.setVertexAt = function (index, point) {
|
|
84
80
|
if (index < 0)
|
|
85
81
|
this._vertices[0].copy(point);
|
|
86
|
-
if (index
|
|
82
|
+
if (index >= 3) {
|
|
83
|
+
if (this._vertices.length === 3) {
|
|
84
|
+
this._vertices.push(new AcGePoint3d());
|
|
85
|
+
}
|
|
87
86
|
return this._vertices[3].copy(point);
|
|
87
|
+
}
|
|
88
88
|
this._vertices[index].copy(point);
|
|
89
89
|
};
|
|
90
90
|
/**
|
|
@@ -202,9 +202,10 @@ var AcDbFace = /** @class */ (function (_super) {
|
|
|
202
202
|
* ```
|
|
203
203
|
*/
|
|
204
204
|
AcDbFace.prototype.draw = function (renderer) {
|
|
205
|
-
var
|
|
206
|
-
var
|
|
207
|
-
|
|
205
|
+
var num = this._vertices.length;
|
|
206
|
+
var buffer = new Float32Array(num * 3);
|
|
207
|
+
var indices = new Uint16Array(num * 2);
|
|
208
|
+
for (var i = 0; i < num; i++) {
|
|
208
209
|
buffer[i * 3] = this._vertices[i].x;
|
|
209
210
|
buffer[i * 3 + 1] = this._vertices[i].y;
|
|
210
211
|
buffer[i * 3 + 2] = this._vertices[i].z;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcDbFace.js","sourceRoot":"","sources":["../../src/entity/AcDbFace.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,WAAW,EAEZ,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC;;;;;GAKG;AACH;IAA8B,4BAAU;IAStC;;;;;OAKG;IACH;QACE,YAAA,MAAK,WAAE,SAAA;QACP,KAAI,CAAC,SAAS,GAAG
|
|
1
|
+
{"version":3,"file":"AcDbFace.js","sourceRoot":"","sources":["../../src/entity/AcDbFace.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,WAAW,EAEZ,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC;;;;;GAKG;AACH;IAA8B,4BAAU;IAStC;;;;;OAKG;IACH;QACE,YAAA,MAAK,WAAE,SAAA;QACP,KAAI,CAAC,SAAS,GAAG,CAAC,IAAI,WAAW,EAAE,EAAE,IAAI,WAAW,EAAE,EAAE,IAAI,WAAW,EAAE,CAAC,CAAA;QAC1E,KAAI,CAAC,mBAAmB,GAAG,CAAC,CAAA;;IAC9B,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,8BAAW,GAAX,UAAY,KAAa;QACvB,IAAI,KAAK,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;QACvC,IAAI,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;YAClC,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QAClD,CAAC;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;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,EAAE,CAAC;gBAC5B,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;gBAClB,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;YAClC,CAAC;QACH,CAAC;QACD,OAAO,QAAQ,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;IAClE,CAAC;IA1MD,2BAA2B;IACX,iBAAQ,GAAW,MAAM,CAAA;IA0M3C,eAAC;CAAA,AA5MD,CAA8B,UAAU,GA4MvC;SA5MY,QAAQ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlightcad/data-model",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.23",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"uid": "^2.0.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@mlightcad/common": "1.2.1",
|
|
40
39
|
"@mlightcad/geometry-engine": "3.0.2",
|
|
41
|
-
"@mlightcad/graphic-interface": "3.0.3"
|
|
40
|
+
"@mlightcad/graphic-interface": "3.0.3",
|
|
41
|
+
"@mlightcad/common": "1.2.1"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"analyze": "pnpm run analyze:lib && pnpm run analyze:worker",
|