Compare commits

...

1 Commits

Author SHA1 Message Date
b94848988a 更新版本 2025-05-21 17:01:27 +08:00
6 changed files with 70 additions and 13 deletions

View File

@ -29386,16 +29386,16 @@ function Board2DModelCSGBuilder(board, side = false) {
let cus = con.Explode();
for (let [faceId, modelings] of board.Side2DModelingMap) {
let faceMtx = GetSideCuFaceMtx(cus[faceId], inverseZ);
hasError = Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx) || hasError;
hasError = Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx, side) || hasError;
}
}
else
hasError = Creat2DModelGeom(board, board.Modeling2D, _2DPathCsgs, faceMtx);
hasError = Creat2DModelGeom(board, board.Modeling2D, _2DPathCsgs, faceMtx, side);
if (hasError)
Log(`板:${board.Name} 二维刀路建模异常!`, LogType.Error, [board]);
return _2DPathCsgs;
}
function Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx) {
function Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx, side) {
let hasError = false;
let fuzzy = new FuzzyFactory;
let tempVec = new three.Vector3;
@ -29444,7 +29444,7 @@ function Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx) {
for (let item of vm.items) {
let tempPath = GetOffsetPath(board, path, item);
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 pathObject = new three.Object3D(); //走刀路径绘制线
@ -30844,6 +30844,8 @@ exports.Board = Board_1 = class Board extends exports.ExtrudeSolid {
this.bevelEnabled = true;
//二维刀路 id -> polyline
this._KnifePolylineMap = new Map();
//侧面二维刀路 id -> polyline
this._SideKnifePolylineMap = new Map();
this._FixContourByArcSweepPath_Ing = false;
this.UpdateSplitBoardSideModelUtil = true;
this.UpdateSplitBoardSide2DModelUtil = true;
@ -31692,6 +31694,7 @@ exports.Board = Board_1 = class Board extends exports.ExtrudeSolid {
return;
this.WriteAllObjectRecord();
this._Side2DModelingMap.clear();
this._SideKnifePolylineMap.clear();
this.ClearSide2DPathCache();
this.Update(exports.UpdateDraw.Geometry);
}
@ -32358,6 +32361,16 @@ exports.Board = Board_1 = class Board extends exports.ExtrudeSolid {
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() {
if (!this._3DPathObject)
return;
@ -33901,10 +33914,19 @@ exports.Board = Board_1 = class Board extends exports.ExtrudeSolid {
}
if (ver > 26)
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) {
super.WriteFile(file);
file.Write(27);
file.Write(28);
// file.Write(this._SpaceOCS.toArray()); ver < 6
file.Write(this._BoardType);
file.Write(this._Name);
@ -34012,6 +34034,11 @@ exports.Board = Board_1 = class Board extends exports.ExtrudeSolid {
file.Write(ids.Name);
}
SerializeBoardSide2DModeingData(file, this._Side2DModelingMap);
file.Write(this._SideKnifePolylineMap.size);
for (let [id, pl] of this._SideKnifePolylineMap) {
file.Write(id);
file.WriteObject(pl);
}
}
};
__decorate([

File diff suppressed because one or more lines are too long

View File

@ -29350,16 +29350,16 @@ function Board2DModelCSGBuilder(board, side = false) {
let cus = con.Explode();
for (let [faceId, modelings] of board.Side2DModelingMap) {
let faceMtx = GetSideCuFaceMtx(cus[faceId], inverseZ);
hasError = Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx) || hasError;
hasError = Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx, side) || hasError;
}
}
else
hasError = Creat2DModelGeom(board, board.Modeling2D, _2DPathCsgs, faceMtx);
hasError = Creat2DModelGeom(board, board.Modeling2D, _2DPathCsgs, faceMtx, side);
if (hasError)
Log(`板:${board.Name} 二维刀路建模异常!`, LogType.Error, [board]);
return _2DPathCsgs;
}
function Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx) {
function Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx, side) {
let hasError = false;
let fuzzy = new FuzzyFactory;
let tempVec = new Vector3;
@ -29408,7 +29408,7 @@ function Creat2DModelGeom(board, modelings, _2DPathCsgs, faceMtx) {
for (let item of vm.items) {
let tempPath = GetOffsetPath(board, path, item);
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 pathObject = new Object3D(); //走刀路径绘制线
@ -30808,6 +30808,8 @@ let Board = Board_1 = class Board extends ExtrudeSolid {
this.bevelEnabled = true;
//二维刀路 id -> polyline
this._KnifePolylineMap = new Map();
//侧面二维刀路 id -> polyline
this._SideKnifePolylineMap = new Map();
this._FixContourByArcSweepPath_Ing = false;
this.UpdateSplitBoardSideModelUtil = true;
this.UpdateSplitBoardSide2DModelUtil = true;
@ -31656,6 +31658,7 @@ let Board = Board_1 = class Board extends ExtrudeSolid {
return;
this.WriteAllObjectRecord();
this._Side2DModelingMap.clear();
this._SideKnifePolylineMap.clear();
this.ClearSide2DPathCache();
this.Update(UpdateDraw.Geometry);
}
@ -32322,6 +32325,16 @@ let Board = Board_1 = class Board extends ExtrudeSolid {
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() {
if (!this._3DPathObject)
return;
@ -33865,10 +33878,19 @@ let Board = Board_1 = class Board extends ExtrudeSolid {
}
if (ver > 26)
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) {
super.WriteFile(file);
file.Write(27);
file.Write(28);
// file.Write(this._SpaceOCS.toArray()); ver < 6
file.Write(this._BoardType);
file.Write(this._Name);
@ -33976,6 +33998,11 @@ let Board = Board_1 = class Board extends ExtrudeSolid {
file.Write(ids.Name);
}
SerializeBoardSide2DModeingData(file, this._Side2DModelingMap);
file.Write(this._SideKnifePolylineMap.size);
for (let [id, pl] of this._SideKnifePolylineMap) {
file.Write(id);
file.WriteObject(pl);
}
}
};
__decorate([

File diff suppressed because one or more lines are too long

View File

@ -95,6 +95,7 @@ export declare class Board extends ExtrudeSolid {
arcBoardFeedProcess: ArcBoardFeedProcess;
protected bevelEnabled: boolean;
private _KnifePolylineMap;
private _SideKnifePolylineMap;
private _jigSweepPath;
private _jigPath2WCSMtx;
constructor();
@ -247,6 +248,8 @@ export declare class Board extends ExtrudeSolid {
private GetLinesOpenDir;
get KnifePolylineMap(): Map<string, Polyline>;
set KnifePolylineMap(map: Map<string, Polyline>);
get SideKnifePolylineMap(): Map<string, Polyline>;
set SideKnifePolylineMap(map: Map<string, Polyline>);
private _3DPathObject;
Clear3DPathCache(): void;
private Get3DPathDrawObject;

File diff suppressed because one or more lines are too long