更新版本
This commit is contained in:
37
api.esm.js
37
api.esm.js
@@ -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([
|
||||
|
Reference in New Issue
Block a user