修复:地面天花的Z轴位置不正确

This commit is contained in:
ChenX
2022-05-27 16:26:41 +08:00
parent b9b4d06bed
commit 4a1542027d
11 changed files with 33 additions and 9 deletions

View File

@@ -1530,6 +1530,13 @@ exports.Entity = Entity_1 = class Entity extends CADObject {
this.Update(UpdateDraw.Matrix);
}
get Z() { return this._Matrix.elements[14]; }
set Z(z) {
if (equaln$1(this.Z, z))
return;
this.WriteAllObjectRecord();
this._Matrix.elements[14] = z;
this.Update(UpdateDraw.Matrix);
}
//Z轴归0
Z0() {
if (this._Matrix.elements[14] === 0)
@@ -35372,7 +35379,10 @@ class RoomRegionParse {
Do(walls) {
let curves = [];
let leftCurves = new Set();
let maxZ = 0;
let minZ = walls[0].Z;
for (let wall of walls) {
maxZ = Math.max(wall.Z);
if (!wall.LeftCurves) {
continue;
}
@@ -35445,7 +35455,8 @@ class RoomRegionParse {
top.Contour = con.contour.Curve;
floor.Holes = con.children.map(c => c.contour.Curve);
top.Holes = con.children.map(c => c.contour.Curve);
top.Move({ x: 0, y: 0, z: 2700 }); //等轮廓设置完在移动 否则设置失败
floor.Z = minZ;
top.Z = maxZ; //等轮廓设置完在移动 否则设置失败
let conPts = Polyline2Points(floor.Contour, false, 0)[1];
let holePts = floor.HoleDatas.map(h => Polyline2Points(UpdateTempPolyline(h), false, 0)[1]);
let pos = ParseRegionTextPos(conPts, holePts);