|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
import { Box3, BufferGeometry, Color, Face3, Geometry, InstancedInterleavedBuffer, InterleavedBufferAttribute, LineSegments, Material, MathUtils, Matrix3, Mesh, Object3D, ShapeUtils, Line as TLine, Vector2, Vector3 } from "three";
|
|
|
|
|
import { Box3, BufferGeometry, Color, Face3, Geometry, InstancedInterleavedBuffer, InterleavedBufferAttribute, LineSegments, MathUtils, Matrix3, Mesh, Object3D, ShapeUtils, Line as TLine, Vector2, Vector3 } from "three";
|
|
|
|
|
import { Line2 } from "three/examples/jsm/lines/Line2";
|
|
|
|
|
import { LineGeometry } from "three/examples/jsm/lines/LineGeometry";
|
|
|
|
|
import { HostApplicationServices } from "../../../../ApplicationServices/HostApplicationServices";
|
|
|
|
@ -13,7 +13,6 @@ import { MoveMatrix, ZAxis, ZeroVec, equaln, equalv3, midPoint } from "../../../
|
|
|
|
|
import { RenderType } from "../../../../GraphicsSystem/RenderType";
|
|
|
|
|
import { Factory } from "../../../CADFactory";
|
|
|
|
|
import { CADFiler } from "../../../CADFiler";
|
|
|
|
|
import { Arc } from "../../../Entity/Arc";
|
|
|
|
|
import { Curve } from "../../../Entity/Curve";
|
|
|
|
|
import { Line } from "../../../Entity/Line";
|
|
|
|
|
import { ObjectId } from "../../../ObjectId";
|
|
|
|
@ -730,76 +729,6 @@ export class RoomWallLine extends RoomWallBase
|
|
|
|
|
return [line, mesh];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get MeshMaterials(): Material[]
|
|
|
|
|
{
|
|
|
|
|
let defaultMtl = super.MeshMaterial;
|
|
|
|
|
|
|
|
|
|
let materials: Material[] = [];
|
|
|
|
|
let materialIndex = 0;
|
|
|
|
|
|
|
|
|
|
const addMaterial = (curves: (Arc | Line)[]) =>
|
|
|
|
|
{
|
|
|
|
|
if (curves)
|
|
|
|
|
for (let c of curves)
|
|
|
|
|
{
|
|
|
|
|
if (c[CURVE_FACE_TYPE_KEY] === WallFaceType.Outside)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
materials.push(this.OverWriteMaterial.get(materialIndex)?.Object.Material ?? defaultMtl);
|
|
|
|
|
materialIndex++;
|
|
|
|
|
//这里不使用1
|
|
|
|
|
if (materialIndex === 1)
|
|
|
|
|
{
|
|
|
|
|
materials.push(defaultMtl);
|
|
|
|
|
materialIndex++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
addMaterial(this.LeftCurves);
|
|
|
|
|
addMaterial(this.RightCurves);
|
|
|
|
|
addMaterial(this.LidCurves);
|
|
|
|
|
|
|
|
|
|
if (this.Region)
|
|
|
|
|
{
|
|
|
|
|
materials.push(this.OverWriteMaterial.get(materialIndex)?.Object.Material ?? defaultMtl);
|
|
|
|
|
if (HostApplicationServices.DrawWallBottomFace)
|
|
|
|
|
materials.push(this.OverWriteMaterial.get(materialIndex + 1)?.Object.Material ?? defaultMtl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return materials;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GetMtlLockedStatus()
|
|
|
|
|
{
|
|
|
|
|
let partMtlLocked = false;
|
|
|
|
|
let allMtlLocked = true;
|
|
|
|
|
|
|
|
|
|
for (const [, v] of this.OverWriteMaterial)
|
|
|
|
|
{
|
|
|
|
|
if (v?.Object?.IsMaterialLock)
|
|
|
|
|
{
|
|
|
|
|
partMtlLocked = true;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
allMtlLocked = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const meshSize = this.MeshMaterials.length;
|
|
|
|
|
if (this.OverWriteMaterial.size !== meshSize)
|
|
|
|
|
{
|
|
|
|
|
if (super.Material?.Object?.IsMaterialLock)
|
|
|
|
|
partMtlLocked = true;
|
|
|
|
|
else
|
|
|
|
|
allMtlLocked = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
partMtlLocked,
|
|
|
|
|
allMtlLocked,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InitDrawObject(renderType: RenderType = RenderType.Wireframe): Object3D
|
|
|
|
|
{
|
|
|
|
|
if (renderType === RenderType.Physical)
|
|
|
|
|