Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
b94848988a |
37
api.cjs.js
37
api.cjs.js
@ -29386,16 +29386,16 @@ function Board2DModelCSGBuilder(board, side = false) {
|
|||||||
let cus = con.Explode();
|
let cus = con.Explode();
|
||||||
for (let [faceId, modelings] of board.Side2DModelingMap) {
|
for (let [faceId, modelings] of board.Side2DModelingMap) {
|
||||||
let faceMtx = GetSideCuFaceMtx(cus[faceId], inverseZ);
|
let faceMtx = GetSideCuFaceMtx(cus[faceId], inverseZ);
|
||||||
hasError = Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx) || hasError;
|
hasError = Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx, side) || hasError;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
hasError = Creat2DModelGeom(board, board.Modeling2D, _2DPathCsgs, faceMtx);
|
hasError = Creat2DModelGeom(board, board.Modeling2D, _2DPathCsgs, faceMtx, side);
|
||||||
if (hasError)
|
if (hasError)
|
||||||
Log(`板:${board.Name} 二维刀路建模异常!`, LogType.Error, [board]);
|
Log(`板:${board.Name} 二维刀路建模异常!`, LogType.Error, [board]);
|
||||||
return _2DPathCsgs;
|
return _2DPathCsgs;
|
||||||
}
|
}
|
||||||
function Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx) {
|
function Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx, side) {
|
||||||
let hasError = false;
|
let hasError = false;
|
||||||
let fuzzy = new FuzzyFactory;
|
let fuzzy = new FuzzyFactory;
|
||||||
let tempVec = new three.Vector3;
|
let tempVec = new three.Vector3;
|
||||||
@ -29444,7 +29444,7 @@ function Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx) {
|
|||||||
for (let item of vm.items) {
|
for (let item of vm.items) {
|
||||||
let tempPath = GetOffsetPath(board, path, item);
|
let tempPath = GetOffsetPath(board, path, item);
|
||||||
if (tempPath) {
|
if (tempPath) {
|
||||||
let sweepContour = board.KnifePolylineMap.get(item.knife.id);
|
let sweepContour = side ? board.SideKnifePolylineMap.get(item.knife.id) : board.KnifePolylineMap.get(item.knife.id);
|
||||||
{
|
{
|
||||||
let curves = VData2Curve(VKnifToolPath(tempPath, item.depth, item.knife.angle / 2)); //走刀+提刀曲线
|
let curves = VData2Curve(VKnifToolPath(tempPath, item.depth, item.knife.angle / 2)); //走刀+提刀曲线
|
||||||
let pathObject = new three.Object3D(); //走刀路径绘制线
|
let pathObject = new three.Object3D(); //走刀路径绘制线
|
||||||
@ -30844,6 +30844,8 @@ exports.Board = Board_1 = class Board extends exports.ExtrudeSolid {
|
|||||||
this.bevelEnabled = true;
|
this.bevelEnabled = true;
|
||||||
//二维刀路 id -> polyline
|
//二维刀路 id -> polyline
|
||||||
this._KnifePolylineMap = new Map();
|
this._KnifePolylineMap = new Map();
|
||||||
|
//侧面二维刀路 id -> polyline
|
||||||
|
this._SideKnifePolylineMap = new Map();
|
||||||
this._FixContourByArcSweepPath_Ing = false;
|
this._FixContourByArcSweepPath_Ing = false;
|
||||||
this.UpdateSplitBoardSideModelUtil = true;
|
this.UpdateSplitBoardSideModelUtil = true;
|
||||||
this.UpdateSplitBoardSide2DModelUtil = true;
|
this.UpdateSplitBoardSide2DModelUtil = true;
|
||||||
@ -31692,6 +31694,7 @@ exports.Board = Board_1 = class Board extends exports.ExtrudeSolid {
|
|||||||
return;
|
return;
|
||||||
this.WriteAllObjectRecord();
|
this.WriteAllObjectRecord();
|
||||||
this._Side2DModelingMap.clear();
|
this._Side2DModelingMap.clear();
|
||||||
|
this._SideKnifePolylineMap.clear();
|
||||||
this.ClearSide2DPathCache();
|
this.ClearSide2DPathCache();
|
||||||
this.Update(exports.UpdateDraw.Geometry);
|
this.Update(exports.UpdateDraw.Geometry);
|
||||||
}
|
}
|
||||||
@ -32358,6 +32361,16 @@ exports.Board = Board_1 = class Board extends exports.ExtrudeSolid {
|
|||||||
this._KnifePolylineMap = map;
|
this._KnifePolylineMap = map;
|
||||||
//不进行更新 通常由其他的方法更新
|
//不进行更新 通常由其他的方法更新
|
||||||
}
|
}
|
||||||
|
get SideKnifePolylineMap() {
|
||||||
|
return this._SideKnifePolylineMap;
|
||||||
|
}
|
||||||
|
set SideKnifePolylineMap(map) {
|
||||||
|
if (map.size === 0 && this._SideKnifePolylineMap.size === 0)
|
||||||
|
return;
|
||||||
|
this.WriteAllObjectRecord();
|
||||||
|
this._SideKnifePolylineMap = map;
|
||||||
|
//不进行更新 通常由其他的方法更新
|
||||||
|
}
|
||||||
Clear3DPathCache() {
|
Clear3DPathCache() {
|
||||||
if (!this._3DPathObject)
|
if (!this._3DPathObject)
|
||||||
return;
|
return;
|
||||||
@ -33901,10 +33914,19 @@ exports.Board = Board_1 = class Board extends exports.ExtrudeSolid {
|
|||||||
}
|
}
|
||||||
if (ver > 26)
|
if (ver > 26)
|
||||||
DeserializationBoardSide2DModeingData(file, this._Side2DModelingMap);
|
DeserializationBoardSide2DModeingData(file, this._Side2DModelingMap);
|
||||||
|
this._SideKnifePolylineMap.clear();
|
||||||
|
if (ver > 27) {
|
||||||
|
let size = file.Read();
|
||||||
|
for (let i = 0; i < size; i++) {
|
||||||
|
let id = file.Read();
|
||||||
|
let pl = file.ReadObject();
|
||||||
|
this._SideKnifePolylineMap.set(id, pl);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
WriteFile(file) {
|
WriteFile(file) {
|
||||||
super.WriteFile(file);
|
super.WriteFile(file);
|
||||||
file.Write(27);
|
file.Write(28);
|
||||||
// file.Write(this._SpaceOCS.toArray()); ver < 6
|
// file.Write(this._SpaceOCS.toArray()); ver < 6
|
||||||
file.Write(this._BoardType);
|
file.Write(this._BoardType);
|
||||||
file.Write(this._Name);
|
file.Write(this._Name);
|
||||||
@ -34012,6 +34034,11 @@ exports.Board = Board_1 = class Board extends exports.ExtrudeSolid {
|
|||||||
file.Write(ids.Name);
|
file.Write(ids.Name);
|
||||||
}
|
}
|
||||||
SerializeBoardSide2DModeingData(file, this._Side2DModelingMap);
|
SerializeBoardSide2DModeingData(file, this._Side2DModelingMap);
|
||||||
|
file.Write(this._SideKnifePolylineMap.size);
|
||||||
|
for (let [id, pl] of this._SideKnifePolylineMap) {
|
||||||
|
file.Write(id);
|
||||||
|
file.WriteObject(pl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
__decorate([
|
__decorate([
|
||||||
|
File diff suppressed because one or more lines are too long
37
api.esm.js
37
api.esm.js
@ -29350,16 +29350,16 @@ function Board2DModelCSGBuilder(board, side = false) {
|
|||||||
let cus = con.Explode();
|
let cus = con.Explode();
|
||||||
for (let [faceId, modelings] of board.Side2DModelingMap) {
|
for (let [faceId, modelings] of board.Side2DModelingMap) {
|
||||||
let faceMtx = GetSideCuFaceMtx(cus[faceId], inverseZ);
|
let faceMtx = GetSideCuFaceMtx(cus[faceId], inverseZ);
|
||||||
hasError = Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx) || hasError;
|
hasError = Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx, side) || hasError;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
hasError = Creat2DModelGeom(board, board.Modeling2D, _2DPathCsgs, faceMtx);
|
hasError = Creat2DModelGeom(board, board.Modeling2D, _2DPathCsgs, faceMtx, side);
|
||||||
if (hasError)
|
if (hasError)
|
||||||
Log(`板:${board.Name} 二维刀路建模异常!`, LogType.Error, [board]);
|
Log(`板:${board.Name} 二维刀路建模异常!`, LogType.Error, [board]);
|
||||||
return _2DPathCsgs;
|
return _2DPathCsgs;
|
||||||
}
|
}
|
||||||
function Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx) {
|
function Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx, side) {
|
||||||
let hasError = false;
|
let hasError = false;
|
||||||
let fuzzy = new FuzzyFactory;
|
let fuzzy = new FuzzyFactory;
|
||||||
let tempVec = new Vector3;
|
let tempVec = new Vector3;
|
||||||
@ -29408,7 +29408,7 @@ function Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx) {
|
|||||||
for (let item of vm.items) {
|
for (let item of vm.items) {
|
||||||
let tempPath = GetOffsetPath(board, path, item);
|
let tempPath = GetOffsetPath(board, path, item);
|
||||||
if (tempPath) {
|
if (tempPath) {
|
||||||
let sweepContour = board.KnifePolylineMap.get(item.knife.id);
|
let sweepContour = side ? board.SideKnifePolylineMap.get(item.knife.id) : board.KnifePolylineMap.get(item.knife.id);
|
||||||
{
|
{
|
||||||
let curves = VData2Curve(VKnifToolPath(tempPath, item.depth, item.knife.angle / 2)); //走刀+提刀曲线
|
let curves = VData2Curve(VKnifToolPath(tempPath, item.depth, item.knife.angle / 2)); //走刀+提刀曲线
|
||||||
let pathObject = new Object3D(); //走刀路径绘制线
|
let pathObject = new Object3D(); //走刀路径绘制线
|
||||||
@ -30808,6 +30808,8 @@ let Board = Board_1 = class Board extends ExtrudeSolid {
|
|||||||
this.bevelEnabled = true;
|
this.bevelEnabled = true;
|
||||||
//二维刀路 id -> polyline
|
//二维刀路 id -> polyline
|
||||||
this._KnifePolylineMap = new Map();
|
this._KnifePolylineMap = new Map();
|
||||||
|
//侧面二维刀路 id -> polyline
|
||||||
|
this._SideKnifePolylineMap = new Map();
|
||||||
this._FixContourByArcSweepPath_Ing = false;
|
this._FixContourByArcSweepPath_Ing = false;
|
||||||
this.UpdateSplitBoardSideModelUtil = true;
|
this.UpdateSplitBoardSideModelUtil = true;
|
||||||
this.UpdateSplitBoardSide2DModelUtil = true;
|
this.UpdateSplitBoardSide2DModelUtil = true;
|
||||||
@ -31656,6 +31658,7 @@ let Board = Board_1 = class Board extends ExtrudeSolid {
|
|||||||
return;
|
return;
|
||||||
this.WriteAllObjectRecord();
|
this.WriteAllObjectRecord();
|
||||||
this._Side2DModelingMap.clear();
|
this._Side2DModelingMap.clear();
|
||||||
|
this._SideKnifePolylineMap.clear();
|
||||||
this.ClearSide2DPathCache();
|
this.ClearSide2DPathCache();
|
||||||
this.Update(UpdateDraw.Geometry);
|
this.Update(UpdateDraw.Geometry);
|
||||||
}
|
}
|
||||||
@ -32322,6 +32325,16 @@ let Board = Board_1 = class Board extends ExtrudeSolid {
|
|||||||
this._KnifePolylineMap = map;
|
this._KnifePolylineMap = map;
|
||||||
//不进行更新 通常由其他的方法更新
|
//不进行更新 通常由其他的方法更新
|
||||||
}
|
}
|
||||||
|
get SideKnifePolylineMap() {
|
||||||
|
return this._SideKnifePolylineMap;
|
||||||
|
}
|
||||||
|
set SideKnifePolylineMap(map) {
|
||||||
|
if (map.size === 0 && this._SideKnifePolylineMap.size === 0)
|
||||||
|
return;
|
||||||
|
this.WriteAllObjectRecord();
|
||||||
|
this._SideKnifePolylineMap = map;
|
||||||
|
//不进行更新 通常由其他的方法更新
|
||||||
|
}
|
||||||
Clear3DPathCache() {
|
Clear3DPathCache() {
|
||||||
if (!this._3DPathObject)
|
if (!this._3DPathObject)
|
||||||
return;
|
return;
|
||||||
@ -33865,10 +33878,19 @@ let Board = Board_1 = class Board extends ExtrudeSolid {
|
|||||||
}
|
}
|
||||||
if (ver > 26)
|
if (ver > 26)
|
||||||
DeserializationBoardSide2DModeingData(file, this._Side2DModelingMap);
|
DeserializationBoardSide2DModeingData(file, this._Side2DModelingMap);
|
||||||
|
this._SideKnifePolylineMap.clear();
|
||||||
|
if (ver > 27) {
|
||||||
|
let size = file.Read();
|
||||||
|
for (let i = 0; i < size; i++) {
|
||||||
|
let id = file.Read();
|
||||||
|
let pl = file.ReadObject();
|
||||||
|
this._SideKnifePolylineMap.set(id, pl);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
WriteFile(file) {
|
WriteFile(file) {
|
||||||
super.WriteFile(file);
|
super.WriteFile(file);
|
||||||
file.Write(27);
|
file.Write(28);
|
||||||
// file.Write(this._SpaceOCS.toArray()); ver < 6
|
// file.Write(this._SpaceOCS.toArray()); ver < 6
|
||||||
file.Write(this._BoardType);
|
file.Write(this._BoardType);
|
||||||
file.Write(this._Name);
|
file.Write(this._Name);
|
||||||
@ -33976,6 +33998,11 @@ let Board = Board_1 = class Board extends ExtrudeSolid {
|
|||||||
file.Write(ids.Name);
|
file.Write(ids.Name);
|
||||||
}
|
}
|
||||||
SerializeBoardSide2DModeingData(file, this._Side2DModelingMap);
|
SerializeBoardSide2DModeingData(file, this._Side2DModelingMap);
|
||||||
|
file.Write(this._SideKnifePolylineMap.size);
|
||||||
|
for (let [id, pl] of this._SideKnifePolylineMap) {
|
||||||
|
file.Write(id);
|
||||||
|
file.WriteObject(pl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
__decorate([
|
__decorate([
|
||||||
|
File diff suppressed because one or more lines are too long
3
types/DatabaseServices/Entity/Board.d.ts
vendored
3
types/DatabaseServices/Entity/Board.d.ts
vendored
@ -95,6 +95,7 @@ export declare class Board extends ExtrudeSolid {
|
|||||||
arcBoardFeedProcess: ArcBoardFeedProcess;
|
arcBoardFeedProcess: ArcBoardFeedProcess;
|
||||||
protected bevelEnabled: boolean;
|
protected bevelEnabled: boolean;
|
||||||
private _KnifePolylineMap;
|
private _KnifePolylineMap;
|
||||||
|
private _SideKnifePolylineMap;
|
||||||
private _jigSweepPath;
|
private _jigSweepPath;
|
||||||
private _jigPath2WCSMtx;
|
private _jigPath2WCSMtx;
|
||||||
constructor();
|
constructor();
|
||||||
@ -247,6 +248,8 @@ export declare class Board extends ExtrudeSolid {
|
|||||||
private GetLinesOpenDir;
|
private GetLinesOpenDir;
|
||||||
get KnifePolylineMap(): Map<string, Polyline>;
|
get KnifePolylineMap(): Map<string, Polyline>;
|
||||||
set KnifePolylineMap(map: Map<string, Polyline>);
|
set KnifePolylineMap(map: Map<string, Polyline>);
|
||||||
|
get SideKnifePolylineMap(): Map<string, Polyline>;
|
||||||
|
set SideKnifePolylineMap(map: Map<string, Polyline>);
|
||||||
private _3DPathObject;
|
private _3DPathObject;
|
||||||
Clear3DPathCache(): void;
|
Clear3DPathCache(): void;
|
||||||
private Get3DPathDrawObject;
|
private Get3DPathDrawObject;
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user