开发:导出Circle
This commit is contained in:
parent
473b7011cb
commit
465e6ec04a
67
.gitignore
vendored
Normal file
67
.gitignore
vendored
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
.history
|
||||||
|
|
||||||
|
# Runtime data
|
||||||
|
pids
|
||||||
|
*.pid
|
||||||
|
*.seed
|
||||||
|
*.pid.lock
|
||||||
|
|
||||||
|
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||||
|
lib-cov
|
||||||
|
|
||||||
|
# Coverage directory used by tools like istanbul
|
||||||
|
coverage
|
||||||
|
|
||||||
|
# nyc test coverage
|
||||||
|
.nyc_output
|
||||||
|
|
||||||
|
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||||
|
.grunt
|
||||||
|
|
||||||
|
# Bower dependency directory (https://bower.io/)
|
||||||
|
bower_components
|
||||||
|
|
||||||
|
# node-waf configuration
|
||||||
|
.lock-wscript
|
||||||
|
|
||||||
|
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||||
|
build/Release
|
||||||
|
|
||||||
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# Typescript v1 declaration files
|
||||||
|
typings/
|
||||||
|
|
||||||
|
# Optional npm cache directory
|
||||||
|
.npm
|
||||||
|
|
||||||
|
# Optional eslint cache
|
||||||
|
.eslintcache
|
||||||
|
|
||||||
|
# Optional REPL history
|
||||||
|
.node_repl_history
|
||||||
|
|
||||||
|
# Output of 'npm pack'
|
||||||
|
*.tgz
|
||||||
|
|
||||||
|
# Yarn Integrity file
|
||||||
|
.yarn-integrity
|
||||||
|
|
||||||
|
# dotenv environment variables file
|
||||||
|
.env
|
||||||
|
|
||||||
|
#custom
|
||||||
|
/dist*
|
||||||
|
/package-lock.json
|
||||||
|
yarn.lock
|
||||||
|
|
||||||
|
#导出的WebCADApi
|
||||||
|
api
|
22
api.cjs.js
22
api.cjs.js
@ -3252,7 +3252,7 @@ class Contour {
|
|||||||
else if (status === Status.ConverToCircle) {
|
else if (status === Status.ConverToCircle) {
|
||||||
g.length = 0;
|
g.length = 0;
|
||||||
let a = c1;
|
let a = c1;
|
||||||
g.push(new Circle(a.Center, a.Radius));
|
g.push(new exports.Circle(a.Center, a.Radius));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3952,7 +3952,7 @@ let Ellipse = Ellipse_1 = class Ellipse extends Curve {
|
|||||||
if (curve instanceof exports.Line) {
|
if (curve instanceof exports.Line) {
|
||||||
return SwapParam(IntersectEllipseAndLine(curve, this, reverseIntersectOption(intType)));
|
return SwapParam(IntersectEllipseAndLine(curve, this, reverseIntersectOption(intType)));
|
||||||
}
|
}
|
||||||
else if (curve instanceof Circle || curve instanceof exports.Arc) {
|
else if (curve instanceof exports.Circle || curve instanceof exports.Arc) {
|
||||||
return IntersectEllipseAndCircleOrArc(this, curve, intType);
|
return IntersectEllipseAndCircleOrArc(this, curve, intType);
|
||||||
}
|
}
|
||||||
else if (curve instanceof exports.Polyline) {
|
else if (curve instanceof exports.Polyline) {
|
||||||
@ -4190,7 +4190,7 @@ exports.Line = Line_1 = class Line extends Curve {
|
|||||||
if (curve instanceof exports.Arc) {
|
if (curve instanceof exports.Arc) {
|
||||||
return IntersectLineAndArc(this, curve, intType, tolerance);
|
return IntersectLineAndArc(this, curve, intType, tolerance);
|
||||||
}
|
}
|
||||||
if (curve instanceof Circle) {
|
if (curve instanceof exports.Circle) {
|
||||||
return IntersectLineAndCircle(this, curve, intType, tolerance);
|
return IntersectLineAndCircle(this, curve, intType, tolerance);
|
||||||
}
|
}
|
||||||
if (curve instanceof exports.Polyline) {
|
if (curve instanceof exports.Polyline) {
|
||||||
@ -4416,7 +4416,7 @@ class CurveTreeNode {
|
|||||||
c.TrimBy(contour, box);
|
c.TrimBy(contour, box);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (contour.Curve instanceof Circle && this.curve instanceof exports.Arc) {
|
if (contour.Curve instanceof exports.Circle && this.curve instanceof exports.Arc) {
|
||||||
if (equalv3(contour.Curve.Center, this.curve.Center)) {
|
if (equalv3(contour.Curve.Center, this.curve.Center)) {
|
||||||
if (contour.Curve.Radius > this.curve.Radius + 1e-4)
|
if (contour.Curve.Radius > this.curve.Radius + 1e-4)
|
||||||
this.children = [];
|
this.children = [];
|
||||||
@ -4503,7 +4503,7 @@ class OffsetPolyline {
|
|||||||
if (!equalv3(lastCu.EndPoint, this._Vertexs[0], 1e-3))
|
if (!equalv3(lastCu.EndPoint, this._Vertexs[0], 1e-3))
|
||||||
this._Vertexs.push(lastCu.EndPoint);
|
this._Vertexs.push(lastCu.EndPoint);
|
||||||
let radius = Math.abs(this._OffsetDist);
|
let radius = Math.abs(this._OffsetDist);
|
||||||
this._Circles = this._Vertexs.map(p => new Circle(p, radius));
|
this._Circles = this._Vertexs.map(p => new exports.Circle(p, radius));
|
||||||
}
|
}
|
||||||
OffsetSubCurves() {
|
OffsetSubCurves() {
|
||||||
this._SubOffsetedCurves = [];
|
this._SubOffsetedCurves = [];
|
||||||
@ -4824,7 +4824,7 @@ class OffsetPolyline {
|
|||||||
if (status === Status.ConverToCircle) {
|
if (status === Status.ConverToCircle) {
|
||||||
n.used = true;
|
n.used = true;
|
||||||
n2.used = true;
|
n2.used = true;
|
||||||
let circle = new Circle(n.curve.Center, n.curve.Radius);
|
let circle = new exports.Circle(n.curve.Center, n.curve.Radius);
|
||||||
n.curve = circle;
|
n.curve = circle;
|
||||||
this._RetCurves.push(ConverCircleToPolyline(circle).ApplyMatrix(this._CacheOCS));
|
this._RetCurves.push(ConverCircleToPolyline(circle).ApplyMatrix(this._CacheOCS));
|
||||||
}
|
}
|
||||||
@ -6866,7 +6866,7 @@ function GetCircleGeometry() {
|
|||||||
circleGeometry = BufferGeometryUtils.CreateFromPts(new three.EllipseCurve(0, 0, 1, 1, 0, 2 * Math.PI, false, 0).getPoints(360).map(AsVector3));
|
circleGeometry = BufferGeometryUtils.CreateFromPts(new three.EllipseCurve(0, 0, 1, 1, 0, 2 * Math.PI, false, 0).getPoints(360).map(AsVector3));
|
||||||
return circleGeometry;
|
return circleGeometry;
|
||||||
}
|
}
|
||||||
let Circle = Circle_1 = class Circle extends Curve {
|
exports.Circle = Circle_1 = class Circle extends Curve {
|
||||||
constructor(center, radius = 1e-6) {
|
constructor(center, radius = 1e-6) {
|
||||||
super();
|
super();
|
||||||
center && this._Matrix.setPosition(center);
|
center && this._Matrix.setPosition(center);
|
||||||
@ -7143,9 +7143,9 @@ let Circle = Circle_1 = class Circle extends Curve {
|
|||||||
file.Write(this._Radius);
|
file.Write(this._Radius);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Circle = Circle_1 = __decorate([
|
exports.Circle = Circle_1 = __decorate([
|
||||||
Factory
|
Factory
|
||||||
], Circle);
|
], exports.Circle);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 一个简单的计数器实现,本质是使用一个Map来保存元素的个数
|
* 一个简单的计数器实现,本质是使用一个Map来保存元素的个数
|
||||||
@ -7382,7 +7382,7 @@ function equalCurve(cu1, cu2, tolerance = 1e-4) {
|
|||||||
return equalArray(buls1, buls2, equaln) &&
|
return equalArray(buls1, buls2, equaln) &&
|
||||||
equalArray(pts1, pts2, (p1, p2) => equalv3(AsVector3(p1).applyMatrix4(cu1.OCS), AsVector3(p2).applyMatrix4(cu2.OCS), tolerance));
|
equalArray(pts1, pts2, (p1, p2) => equalv3(AsVector3(p1).applyMatrix4(cu1.OCS), AsVector3(p2).applyMatrix4(cu2.OCS), tolerance));
|
||||||
}
|
}
|
||||||
else if (cu1 instanceof Circle && cu2 instanceof Circle) {
|
else if (cu1 instanceof exports.Circle && cu2 instanceof exports.Circle) {
|
||||||
return equalv3(cu1.Center, cu2.Center) && equaln(cu1.Radius, cu2.Radius, 1e-6);
|
return equalv3(cu1.Center, cu2.Center) && equaln(cu1.Radius, cu2.Radius, 1e-6);
|
||||||
}
|
}
|
||||||
else if (cu1 instanceof exports.Arc && cu2 instanceof exports.Arc) {
|
else if (cu1 instanceof exports.Arc && cu2 instanceof exports.Arc) {
|
||||||
@ -7883,7 +7883,7 @@ exports.Arc = Arc_1 = class Arc extends Curve {
|
|||||||
if (curve instanceof exports.Line) {
|
if (curve instanceof exports.Line) {
|
||||||
return SwapParam(IntersectLineAndArc(curve, this, reverseIntersectOption(intType), tolerance));
|
return SwapParam(IntersectLineAndArc(curve, this, reverseIntersectOption(intType), tolerance));
|
||||||
}
|
}
|
||||||
if (curve instanceof Circle) {
|
if (curve instanceof exports.Circle) {
|
||||||
return SwapParam(IntersectCircleAndArc(curve, this, reverseIntersectOption(intType), tolerance));
|
return SwapParam(IntersectCircleAndArc(curve, this, reverseIntersectOption(intType), tolerance));
|
||||||
}
|
}
|
||||||
if (curve instanceof exports.Polyline)
|
if (curve instanceof exports.Polyline)
|
||||||
|
File diff suppressed because one or more lines are too long
@ -8139,5 +8139,5 @@ Arc = Arc_1 = __decorate([
|
|||||||
Factory
|
Factory
|
||||||
], Arc);
|
], Arc);
|
||||||
|
|
||||||
export { Arc, BoolOpeartionType, CADFiler, IsPtsAllOutOrOnReg, Line, Polyline, TempPolyline, isTargetCurInOrOnSourceCur };
|
export { Arc, BoolOpeartionType, CADFiler, Circle, IsPtsAllOutOrOnReg, Line, Polyline, TempPolyline, isTargetCurInOrOnSourceCur };
|
||||||
//# sourceMappingURL=api.esm.js.map
|
//# sourceMappingURL=api.esm.js.map
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cadapi",
|
"name": "cadapi",
|
||||||
"version": "0.0.9",
|
"version": "0.0.10",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "api.esm.js",
|
"main": "api.esm.js",
|
||||||
"module": "api.esm.js",
|
"module": "api.esm.js",
|
||||||
|
@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EAAE,CAAC;KAAE;IAkE/E,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,EAAE;IA8BjD;;OAEG;IACH,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG;QAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC;QAAC,SAAS,EAAE,KAAK,EAAE,CAAC;KAAE;IAqF5F,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,QAAQ,EAAE;IA6D5C,4BAA4B,CAAC,OAAO,EAAE,OAAO,EAAE;;;;IAqC/C,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE;;;;IA2FpC;;;OAGG;IACH,MAAM,CAAC,aAAa,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE;IAiBzD;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,QAAQ,UAAO,EAAE,SAAS,SAAO,GAAG,KAAK;IA6BtE,IAAI,KAAK,IAAI,KAAK,CAAC,KAAK,CAGvB;IACD,WAAW,CAAC,SAAS,EAAE,KAAK;IAI5B,KAAK,CAAC,GAAG,EAAE,OAAO;CAIrB"}
|
1
types/api.d.ts
vendored
1
types/api.d.ts
vendored
@ -1,5 +1,6 @@
|
|||||||
export * from "./DatabaseServices/CADFiler";
|
export * from "./DatabaseServices/CADFiler";
|
||||||
export * from "./DatabaseServices/Entity/Arc";
|
export * from "./DatabaseServices/Entity/Arc";
|
||||||
|
export * from "./DatabaseServices/Entity/Circle";
|
||||||
export * from "./DatabaseServices/Entity/Line";
|
export * from "./DatabaseServices/Entity/Line";
|
||||||
export * from "./DatabaseServices/Entity/Polyline";
|
export * from "./DatabaseServices/Entity/Polyline";
|
||||||
export * from "./GraphicsSystem/BoolOperateUtils";
|
export * from "./GraphicsSystem/BoolOperateUtils";
|
||||||
|
@ -1 +1 @@
|
|||||||
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC"}
|
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC"}
|
Loading…
Reference in New Issue
Block a user