|
|
@ -4,7 +4,7 @@ import { ColorMaterial } from "../../../../../Common/ColorPalette";
|
|
|
|
import { ObjectSnapMode } from "../../../../../Editor/ObjectSnapMode";
|
|
|
|
import { ObjectSnapMode } from "../../../../../Editor/ObjectSnapMode";
|
|
|
|
import { Box3Ext } from "../../../../../Geometry/Box";
|
|
|
|
import { Box3Ext } from "../../../../../Geometry/Box";
|
|
|
|
import { CreatePolylinePath } from "../../../../../Geometry/CreatePolylinePath";
|
|
|
|
import { CreatePolylinePath } from "../../../../../Geometry/CreatePolylinePath";
|
|
|
|
import { AsVector3, equalv2 } from "../../../../../Geometry/GeUtils";
|
|
|
|
import { AsVector3, equalv2, ZAxis } from "../../../../../Geometry/GeUtils";
|
|
|
|
import { RenderType } from "../../../../../GraphicsSystem/RenderType";
|
|
|
|
import { RenderType } from "../../../../../GraphicsSystem/RenderType";
|
|
|
|
import { Factory } from "../../../../CADFactory";
|
|
|
|
import { Factory } from "../../../../CADFactory";
|
|
|
|
import { CADFiler } from "../../../../CADFiler";
|
|
|
|
import { CADFiler } from "../../../../CADFiler";
|
|
|
@ -14,6 +14,7 @@ import { Line } from "../../../../Entity/Line";
|
|
|
|
import { Polyline } from "../../../../Entity/Polyline";
|
|
|
|
import { Polyline } from "../../../../Entity/Polyline";
|
|
|
|
import { CreateGetCurveParam, GetLineParam } from "../../../ParseService/GetCurveParam";
|
|
|
|
import { CreateGetCurveParam, GetLineParam } from "../../../ParseService/GetCurveParam";
|
|
|
|
import { RoomWallBase } from "../RoomWallBase";
|
|
|
|
import { RoomWallBase } from "../RoomWallBase";
|
|
|
|
|
|
|
|
import { RoomWallLine } from "../RoomWallLine";
|
|
|
|
import { RoomHoleBase } from "./RoomHoleBase";
|
|
|
|
import { RoomHoleBase } from "./RoomHoleBase";
|
|
|
|
|
|
|
|
|
|
|
|
enum HoleType
|
|
|
|
enum HoleType
|
|
|
@ -44,6 +45,9 @@ export class RoomHolePolyline extends RoomHoleBase
|
|
|
|
this.Regions.push(w.Region);
|
|
|
|
this.Regions.push(w.Region);
|
|
|
|
w.OCSNoClone.elements[14] = this._Matrix.elements[14];
|
|
|
|
w.OCSNoClone.elements[14] = this._Matrix.elements[14];
|
|
|
|
w.Height = this.Height;
|
|
|
|
w.Height = this.Height;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (w instanceof RoomWallLine)
|
|
|
|
|
|
|
|
w.UpdateOCSToMinBox();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
get FakerWalls(): RoomWallBase[] { return this._FakerWalls; }
|
|
|
|
get FakerWalls(): RoomWallBase[] { return this._FakerWalls; }
|
|
|
@ -52,6 +56,11 @@ export class RoomHolePolyline extends RoomHoleBase
|
|
|
|
|
|
|
|
|
|
|
|
override get BoundingBoxInOCS(): Box3Ext
|
|
|
|
override get BoundingBoxInOCS(): Box3Ext
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
let box = new Box3Ext;
|
|
|
|
|
|
|
|
let inv = this.OCSInv;
|
|
|
|
|
|
|
|
for (let w of this._FakerWalls)
|
|
|
|
|
|
|
|
box.union(w.GetBoundingBoxInMtx(inv));
|
|
|
|
|
|
|
|
return box;
|
|
|
|
return new Box3Ext().copy(this.BoundingBox).applyMatrix4(this.OCSInv);
|
|
|
|
return new Box3Ext().copy(this.BoundingBox).applyMatrix4(this.OCSInv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -93,15 +102,28 @@ export class RoomHolePolyline extends RoomHoleBase
|
|
|
|
//使用FakerWalls来更新这个洞的信息
|
|
|
|
//使用FakerWalls来更新这个洞的信息
|
|
|
|
UpdatePoints()
|
|
|
|
UpdatePoints()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let ocsInv = this.OCSInv;
|
|
|
|
|
|
|
|
let pts: Vector3[] = [];
|
|
|
|
let pts: Vector3[] = [];
|
|
|
|
|
|
|
|
|
|
|
|
for (let w of this._FakerWalls)
|
|
|
|
for (let w of this._FakerWalls)
|
|
|
|
pts.push(w.StartPoint.applyMatrix4(ocsInv));
|
|
|
|
pts.push(w.StartPoint);
|
|
|
|
if (this._FakerWalls.length)
|
|
|
|
if (this._FakerWalls.length)
|
|
|
|
pts.push(this._FakerWalls[this._FakerWalls.length - 1].EndPoint.applyMatrix4(ocsInv));
|
|
|
|
pts.push(this._FakerWalls[this._FakerWalls.length - 1].EndPoint);
|
|
|
|
|
|
|
|
|
|
|
|
this.WriteAllObjectRecord();
|
|
|
|
this.WriteAllObjectRecord();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pts.length === 2)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let x = pts[1].clone().sub(pts[0]).normalize();
|
|
|
|
|
|
|
|
let z = ZAxis;
|
|
|
|
|
|
|
|
let y = z.clone().cross(x).normalize();
|
|
|
|
|
|
|
|
this._Matrix.makeBasis(x, y, z).setPosition(pts[0]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
this._Matrix.setPosition(pts[1]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let ocsInv = this.OCSInv;
|
|
|
|
|
|
|
|
for (let p of pts) p.applyMatrix4(ocsInv);
|
|
|
|
|
|
|
|
|
|
|
|
this._Points = pts;
|
|
|
|
this._Points = pts;
|
|
|
|
this.Update();
|
|
|
|
this.Update();
|
|
|
|
}
|
|
|
|
}
|
|
|
|