开发:优化排版面显示

pull/1563/head
ChenX 3 years ago
parent fbb5fc740a
commit 4ff89a3cbb

@ -1,4 +1,4 @@
import { BackSide, FrontSide, Geometry, Line as TLine, LineSegments, Matrix3, Matrix4, Mesh, Object3D, ShapeGeometry, UVGenerator, Vector3 } from 'three'; import { Geometry, Line as TLine, LineSegments, Matrix3, Matrix4, Mesh, Object3D, ShapeGeometry, UVGenerator, Vector3 } from 'three';
import { Board2Regions } from '../../Add-on/BoardEditor/Board2Regions'; import { Board2Regions } from '../../Add-on/BoardEditor/Board2Regions';
import { DeserializationBoard2DModeingData, DeserializationBoard3DModeingData, deserializationBoardData, SerializeBoard2DModeingData, SerializeBoard3DModeingData, serializeBoardData } from '../../Add-on/BoardEditor/SerializeBoardData'; import { DeserializationBoard2DModeingData, DeserializationBoard3DModeingData, deserializationBoardData, SerializeBoard2DModeingData, SerializeBoard3DModeingData, serializeBoardData } from '../../Add-on/BoardEditor/SerializeBoardData';
import { CyHoleInBoard, InitRectBoardHoleOption, SetRectHighHole, TempRectHoleOption } from '../../Add-on/DrawDrilling/HoleUtils'; import { CyHoleInBoard, InitRectBoardHoleOption, SetRectHighHole, TempRectHoleOption } from '../../Add-on/DrawDrilling/HoleUtils';
@ -1121,7 +1121,10 @@ export class Board extends ExtrudeSolid
} }
else if (renderType === RenderType.PlaceFace) else if (renderType === RenderType.PlaceFace)
{ {
obj = new Object3D().add(new Mesh(this.MeshGeometry, ColorMaterial.GetConceptualMaterial(8))); obj = new Object3D().add(
new Mesh(this.MeshGeometry, ColorMaterial.GetConceptualMaterial(8)),
new LineSegments(this.EdgeGeometry, ColorMaterial.GetLineMaterial(7))
);
if (this._BoardProcessOption[EBoardKeyList.ComposingFace] !== ComposingType.Arbitrary) if (this._BoardProcessOption[EBoardKeyList.ComposingFace] !== ComposingType.Arbitrary)
obj.add(this.GetPlaceFace()); obj.add(this.GetPlaceFace());
} }
@ -1143,7 +1146,9 @@ export class Board extends ExtrudeSolid
} }
else if (renderType === RenderType.PlaceFace) else if (renderType === RenderType.PlaceFace)
{ {
obj.add(new Mesh(this.MeshGeometry, ColorMaterial.GetConceptualMaterial(8))); obj.add(new Mesh(this.MeshGeometry, ColorMaterial.GetConceptualMaterial(8)),
new LineSegments(this.EdgeGeometry, ColorMaterial.GetLineMaterial(7))
);
if (this._BoardProcessOption[EBoardKeyList.ComposingFace] !== ComposingType.Arbitrary) if (this._BoardProcessOption[EBoardKeyList.ComposingFace] !== ComposingType.Arbitrary)
obj.add(this.GetPlaceFace()); obj.add(this.GetPlaceFace());
} }
@ -1158,7 +1163,7 @@ export class Board extends ExtrudeSolid
let shapeGeom = new ShapeGeometry(this.contourCurve.Shape); let shapeGeom = new ShapeGeometry(this.contourCurve.Shape);
let isFront = this._BoardProcessOption[EBoardKeyList.ComposingFace] !== ComposingType.Positive; let isFront = this._BoardProcessOption[EBoardKeyList.ComposingFace] !== ComposingType.Positive;
shapeGeom.translate(0, 0, isFront ? -0.2 : this.thickness + 0.5); shapeGeom.translate(0, 0, isFront ? -0.2 : this.thickness + 0.5);
let mesh = new Mesh(shapeGeom, ColorMaterial.GetConceptualMaterial(this._Color, isFront ? BackSide : FrontSide)); let mesh = new Mesh(shapeGeom, ColorMaterial.GetBasicMaterialDoubleSide(this._Color));
return mesh; return mesh;
} }
@ -1214,9 +1219,18 @@ export class Board extends ExtrudeSolid
} }
} }
UpdateDrawObjectMaterial(renderType: RenderType, obj: Object3D) UpdateDrawObjectMaterial(renderType: RenderType, obj: Object3D)
{ {
super.UpdateDrawObjectMaterial(renderType, obj); super.UpdateDrawObjectMaterial(renderType, obj);
if (renderType === RenderType.PlaceFace)
{
let face = obj.children[2] as Mesh;
if (!face) return;
face.material = ColorMaterial.GetBasicMaterialDoubleSide(this._Color);
}
if (!this.IsChaiDan) if (!this.IsChaiDan)
{ {
if (renderType === RenderType.Conceptual || renderType === RenderType.Physical2) if (renderType === RenderType.Conceptual || renderType === RenderType.Physical2)
@ -1229,6 +1243,7 @@ export class Board extends ExtrudeSolid
} }
} }
} }
CheckSealing(obj: Object3D) CheckSealing(obj: Object3D)
{ {
let sealingInfo = new Map(userConfig.sealingColorMap.filter(d => d[0] && d[1]) as [string, string][]); let sealingInfo = new Map(userConfig.sealingColorMap.filter(d => d[0] && d[1]) as [string, string][]);

Loading…
Cancel
Save