@mlightcad/geometry-engine 1.0.0
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/LICENSE +21 -0
- package/README.md +13 -0
- package/dist/geometry-engine.js +10186 -0
- package/dist/geometry-engine.umd.cjs +4 -0
- package/lib/geometry/AcGeArea2d.d.ts +61 -0
- package/lib/geometry/AcGeArea2d.d.ts.map +1 -0
- package/lib/geometry/AcGeArea2d.js +174 -0
- package/lib/geometry/AcGeArea2d.js.map +1 -0
- package/lib/geometry/AcGeCircArc2d.d.ts +108 -0
- package/lib/geometry/AcGeCircArc2d.d.ts.map +1 -0
- package/lib/geometry/AcGeCircArc2d.js +412 -0
- package/lib/geometry/AcGeCircArc2d.js.map +1 -0
- package/lib/geometry/AcGeCircArc3d.d.ts +138 -0
- package/lib/geometry/AcGeCircArc3d.d.ts.map +1 -0
- package/lib/geometry/AcGeCircArc3d.js +447 -0
- package/lib/geometry/AcGeCircArc3d.js.map +1 -0
- package/lib/geometry/AcGeCurve2d.d.ts +85 -0
- package/lib/geometry/AcGeCurve2d.d.ts.map +1 -0
- package/lib/geometry/AcGeCurve2d.js +213 -0
- package/lib/geometry/AcGeCurve2d.js.map +1 -0
- package/lib/geometry/AcGeCurve3d.d.ts +27 -0
- package/lib/geometry/AcGeCurve3d.d.ts.map +1 -0
- package/lib/geometry/AcGeCurve3d.js +29 -0
- package/lib/geometry/AcGeCurve3d.js.map +1 -0
- package/lib/geometry/AcGeEllipseArc2d.d.ts +105 -0
- package/lib/geometry/AcGeEllipseArc2d.d.ts.map +1 -0
- package/lib/geometry/AcGeEllipseArc2d.js +292 -0
- package/lib/geometry/AcGeEllipseArc2d.js.map +1 -0
- package/lib/geometry/AcGeEllipseArc3d.d.ts +141 -0
- package/lib/geometry/AcGeEllipseArc3d.d.ts.map +1 -0
- package/lib/geometry/AcGeEllipseArc3d.js +442 -0
- package/lib/geometry/AcGeEllipseArc3d.js.map +1 -0
- package/lib/geometry/AcGeLine2d.d.ts +56 -0
- package/lib/geometry/AcGeLine2d.d.ts.map +1 -0
- package/lib/geometry/AcGeLine2d.js +125 -0
- package/lib/geometry/AcGeLine2d.js.map +1 -0
- package/lib/geometry/AcGeLine3d.d.ts +134 -0
- package/lib/geometry/AcGeLine3d.d.ts.map +1 -0
- package/lib/geometry/AcGeLine3d.js +291 -0
- package/lib/geometry/AcGeLine3d.js.map +1 -0
- package/lib/geometry/AcGeLoop2d.d.ts +59 -0
- package/lib/geometry/AcGeLoop2d.d.ts.map +1 -0
- package/lib/geometry/AcGeLoop2d.js +141 -0
- package/lib/geometry/AcGeLoop2d.js.map +1 -0
- package/lib/geometry/AcGePolyline2d.d.ts +90 -0
- package/lib/geometry/AcGePolyline2d.d.ts.map +1 -0
- package/lib/geometry/AcGePolyline2d.js +224 -0
- package/lib/geometry/AcGePolyline2d.js.map +1 -0
- package/lib/geometry/AcGeShape.d.ts +12 -0
- package/lib/geometry/AcGeShape.d.ts.map +1 -0
- package/lib/geometry/AcGeShape.js +22 -0
- package/lib/geometry/AcGeShape.js.map +1 -0
- package/lib/geometry/AcGeShape2d.d.ts +31 -0
- package/lib/geometry/AcGeShape2d.d.ts.map +1 -0
- package/lib/geometry/AcGeShape2d.js +51 -0
- package/lib/geometry/AcGeShape2d.js.map +1 -0
- package/lib/geometry/AcGeShape3d.d.ts +33 -0
- package/lib/geometry/AcGeShape3d.d.ts.map +1 -0
- package/lib/geometry/AcGeShape3d.js +52 -0
- package/lib/geometry/AcGeShape3d.js.map +1 -0
- package/lib/geometry/AcGeSpline3d.d.ts +77 -0
- package/lib/geometry/AcGeSpline3d.d.ts.map +1 -0
- package/lib/geometry/AcGeSpline3d.js +221 -0
- package/lib/geometry/AcGeSpline3d.js.map +1 -0
- package/lib/geometry/index.d.ts +13 -0
- package/lib/geometry/index.d.ts.map +1 -0
- package/lib/geometry/index.js +13 -0
- package/lib/geometry/index.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -0
- package/lib/math/AcGeBox2d.d.ts +173 -0
- package/lib/math/AcGeBox2d.d.ts.map +1 -0
- package/lib/math/AcGeBox2d.js +289 -0
- package/lib/math/AcGeBox2d.js.map +1 -0
- package/lib/math/AcGeBox3d.d.ts +195 -0
- package/lib/math/AcGeBox3d.d.ts.map +1 -0
- package/lib/math/AcGeBox3d.js +378 -0
- package/lib/math/AcGeBox3d.js.map +1 -0
- package/lib/math/AcGeEuler.d.ts +133 -0
- package/lib/math/AcGeEuler.d.ts.map +1 -0
- package/lib/math/AcGeEuler.js +358 -0
- package/lib/math/AcGeEuler.js.map +1 -0
- package/lib/math/AcGeMatrix2d.d.ts +203 -0
- package/lib/math/AcGeMatrix2d.d.ts.map +1 -0
- package/lib/math/AcGeMatrix2d.js +393 -0
- package/lib/math/AcGeMatrix2d.js.map +1 -0
- package/lib/math/AcGeMatrix3d.d.ts +279 -0
- package/lib/math/AcGeMatrix3d.d.ts.map +1 -0
- package/lib/math/AcGeMatrix3d.js +1037 -0
- package/lib/math/AcGeMatrix3d.js.map +1 -0
- package/lib/math/AcGePlane.d.ts +131 -0
- package/lib/math/AcGePlane.d.ts.map +1 -0
- package/lib/math/AcGePlane.js +218 -0
- package/lib/math/AcGePlane.js.map +1 -0
- package/lib/math/AcGePoint.d.ts +4 -0
- package/lib/math/AcGePoint.d.ts.map +1 -0
- package/lib/math/AcGePoint.js +2 -0
- package/lib/math/AcGePoint.js.map +1 -0
- package/lib/math/AcGePoint2d.d.ts +17 -0
- package/lib/math/AcGePoint2d.d.ts.map +1 -0
- package/lib/math/AcGePoint2d.js +40 -0
- package/lib/math/AcGePoint2d.js.map +1 -0
- package/lib/math/AcGePoint3d.d.ts +18 -0
- package/lib/math/AcGePoint3d.d.ts.map +1 -0
- package/lib/math/AcGePoint3d.js +43 -0
- package/lib/math/AcGePoint3d.js.map +1 -0
- package/lib/math/AcGeQuaternion.d.ts +230 -0
- package/lib/math/AcGeQuaternion.d.ts.map +1 -0
- package/lib/math/AcGeQuaternion.js +666 -0
- package/lib/math/AcGeQuaternion.js.map +1 -0
- package/lib/math/AcGeVector.d.ts +9 -0
- package/lib/math/AcGeVector.d.ts.map +1 -0
- package/lib/math/AcGeVector.js +2 -0
- package/lib/math/AcGeVector.js.map +1 -0
- package/lib/math/AcGeVector2d.d.ts +361 -0
- package/lib/math/AcGeVector2d.d.ts.map +1 -0
- package/lib/math/AcGeVector2d.js +622 -0
- package/lib/math/AcGeVector2d.js.map +1 -0
- package/lib/math/AcGeVector3d.d.ts +493 -0
- package/lib/math/AcGeVector3d.d.ts.map +1 -0
- package/lib/math/AcGeVector3d.js +868 -0
- package/lib/math/AcGeVector3d.js.map +1 -0
- package/lib/math/index.d.ts +14 -0
- package/lib/math/index.d.ts.map +1 -0
- package/lib/math/index.js +14 -0
- package/lib/math/index.js.map +1 -0
- package/lib/util/AcGeConstants.d.ts +19 -0
- package/lib/util/AcGeConstants.d.ts.map +1 -0
- package/lib/util/AcGeConstants.js +25 -0
- package/lib/util/AcGeConstants.js.map +1 -0
- package/lib/util/AcGeGeometryUtil.d.ts +16 -0
- package/lib/util/AcGeGeometryUtil.d.ts.map +1 -0
- package/lib/util/AcGeGeometryUtil.js +56 -0
- package/lib/util/AcGeGeometryUtil.js.map +1 -0
- package/lib/util/AcGeMathUtil.d.ts +203 -0
- package/lib/util/AcGeMathUtil.d.ts.map +1 -0
- package/lib/util/AcGeMathUtil.js +585 -0
- package/lib/util/AcGeMathUtil.js.map +1 -0
- package/lib/util/AcGeTol.d.ts +91 -0
- package/lib/util/AcGeTol.d.ts.map +1 -0
- package/lib/util/AcGeTol.js +83 -0
- package/lib/util/AcGeTol.js.map +1 -0
- package/lib/util/index.d.ts +5 -0
- package/lib/util/index.d.ts.map +1 -0
- package/lib/util/index.js +5 -0
- package/lib/util/index.js.map +1 -0
- package/package.json +42 -0
@@ -0,0 +1,83 @@
|
|
1
|
+
import { AcGeVector2d, AcGeVector3d } from '../math';
|
2
|
+
import { FLOAT_TOL } from './AcGeConstants';
|
3
|
+
/**
|
4
|
+
* The class used to store some tolerance values.
|
5
|
+
*/
|
6
|
+
var AcGeTol = /** @class */ (function () {
|
7
|
+
/**
|
8
|
+
* Create tolerance class with default tolerance values
|
9
|
+
*/
|
10
|
+
function AcGeTol() {
|
11
|
+
this.equalPointTol = FLOAT_TOL;
|
12
|
+
this.equalVectorTol = FLOAT_TOL;
|
13
|
+
}
|
14
|
+
/**
|
15
|
+
* Return true if two points are equal with the specified tolerance.
|
16
|
+
* @param p1 Input the first 2d point
|
17
|
+
* @param p2 Input the second 2d point
|
18
|
+
* @returns Return true if two poitns are equal with the specified tolerance.
|
19
|
+
*/
|
20
|
+
AcGeTol.prototype.equalPoint2d = function (p1, p2) {
|
21
|
+
return new AcGeVector2d(p1).sub(p2).length() < this.equalPointTol;
|
22
|
+
};
|
23
|
+
/**
|
24
|
+
* Return true if two points are equal with the specified tolerance.
|
25
|
+
* @param p1 Input the first 2d point
|
26
|
+
* @param p2 Input the second 2d point
|
27
|
+
* @returns Return true if two poitns are equal with the specified tolerance.
|
28
|
+
*/
|
29
|
+
AcGeTol.prototype.equalPoint3d = function (p1, p2) {
|
30
|
+
return new AcGeVector3d(p1).sub(p2).length() < this.equalPointTol;
|
31
|
+
};
|
32
|
+
/**
|
33
|
+
* Return true if the value is equal to zero with the specified tolerance.
|
34
|
+
*/
|
35
|
+
AcGeTol.equalToZero = function (x, tol) {
|
36
|
+
if (tol === void 0) { tol = FLOAT_TOL; }
|
37
|
+
return x < tol && x > -tol;
|
38
|
+
};
|
39
|
+
/**
|
40
|
+
* Return true if two values are equal with the sepcified tolerance.
|
41
|
+
*
|
42
|
+
* @param value1 Input the first value
|
43
|
+
* @param value2 Input the second value
|
44
|
+
* @param tol Input the tolerance value
|
45
|
+
* @returns Return true if two values are equal with the sepcified tolerance
|
46
|
+
*/
|
47
|
+
AcGeTol.equal = function (value1, value2, tol) {
|
48
|
+
if (tol === void 0) { tol = FLOAT_TOL; }
|
49
|
+
return Math.abs(value1 - value2) < tol;
|
50
|
+
};
|
51
|
+
/**
|
52
|
+
* Return true if the first argument are greater than the second argument with the sepcified
|
53
|
+
* tolerance.
|
54
|
+
*
|
55
|
+
* @param value1 Input the first value
|
56
|
+
* @param value2 Input the second value
|
57
|
+
* @param tol Input the tolerance value
|
58
|
+
* @returns Return true if the first argument are greater than the second argument with the
|
59
|
+
* sepcified tolerance.
|
60
|
+
*/
|
61
|
+
AcGeTol.great = function (value1, value2, tol) {
|
62
|
+
if (tol === void 0) { tol = FLOAT_TOL; }
|
63
|
+
return value1 - value2 > tol;
|
64
|
+
};
|
65
|
+
/**
|
66
|
+
* Return true if the first argument less than the second argument with the specified tolerance
|
67
|
+
* value
|
68
|
+
*
|
69
|
+
* @param value1 Input the first value
|
70
|
+
* @param value2 Input the second value
|
71
|
+
* @param tol Input the tolerance value
|
72
|
+
* @returns Return *true* if the first argument less than the second argument with the specified
|
73
|
+
* tolerance value
|
74
|
+
*/
|
75
|
+
AcGeTol.less = function (value1, value2, tol) {
|
76
|
+
if (tol === void 0) { tol = FLOAT_TOL; }
|
77
|
+
return value1 - value2 < tol;
|
78
|
+
};
|
79
|
+
return AcGeTol;
|
80
|
+
}());
|
81
|
+
export { AcGeTol };
|
82
|
+
export var DEFAULT_TOL = new AcGeTol();
|
83
|
+
//# sourceMappingURL=AcGeTol.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AcGeTol.js","sourceRoot":"","sources":["../../src/util/AcGeTol.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EACZ,YAAY,EACb,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C;;GAEG;AACH;IAgCE;;OAEG;IACH;QACE,IAAI,CAAC,aAAa,GAAG,SAAS,CAAA;QAC9B,IAAI,CAAC,cAAc,GAAG,SAAS,CAAA;IACjC,CAAC;IAED;;;;;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ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA"}
|
package/package.json
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
{
|
2
|
+
"name": "@mlightcad/geometry-engine",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"type": "module",
|
5
|
+
"keywords": [
|
6
|
+
"autocad",
|
7
|
+
"cad",
|
8
|
+
"dwg",
|
9
|
+
"dxf",
|
10
|
+
"mlight",
|
11
|
+
"mlightcad",
|
12
|
+
"objecarx",
|
13
|
+
"realdwg"
|
14
|
+
],
|
15
|
+
"files": [
|
16
|
+
"dist",
|
17
|
+
"lib",
|
18
|
+
"README.md",
|
19
|
+
"package.json"
|
20
|
+
],
|
21
|
+
"main": "./dist/geometry-engine.umd.cjs",
|
22
|
+
"module": "./dist/geometry-engine.js",
|
23
|
+
"types": "./lib/index.d.ts",
|
24
|
+
"exports": {
|
25
|
+
"types": "./lib/index.d.ts",
|
26
|
+
"import": "./dist/geometry-engine.js",
|
27
|
+
"require": "./dist/geometry-engine.umd.cjs"
|
28
|
+
},
|
29
|
+
"dependencies": {
|
30
|
+
"verb-nurbs-web": "^2.1.3"
|
31
|
+
},
|
32
|
+
"peerDependencies": {
|
33
|
+
"@mlightcad/common": "0.0.1",
|
34
|
+
"lodash-es": "*"
|
35
|
+
},
|
36
|
+
"scripts": {
|
37
|
+
"clean": "rimraf dist lib tsconfig.tsbuildinfo",
|
38
|
+
"build": "tsc && vite build",
|
39
|
+
"lint": "eslint src/",
|
40
|
+
"lint:fix": "eslint --fix --quiet src/"
|
41
|
+
}
|
42
|
+
}
|