!2088 功能:板边编辑显示优化(增加透明板显示,线在板中间)

pull/2089/MERGE
ChenX 2 years ago
parent 8d082248cf
commit 89d81c5bbf

@ -18,10 +18,13 @@ export function CheckFilter(obj: Object3D, filter?: Filter)
{
if (!obj.visible || obj instanceof GripScene)
return false;
let ent = GetEntity(obj);
if (!ent) return false;
if (!filter)
return true;
let ent = GetEntity(obj);
if (filter.filterErase && (!ent || ent.Id === undefined || ent.IsErase))
return false;

@ -13,7 +13,7 @@ export class TempEditor
{
private constructor() { }
private static _EditorIng = false;
private static editorScene = new Scene;
static editorScene = new Scene;
//还原旧的视图厂家
private static viewerScene: Scene;

@ -1,11 +1,13 @@
import { Matrix4 } from "three";
import { FrontSide, Matrix4, Mesh } from "three";
import { app } from "../../../ApplicationServices/Application";
import { ColorMaterial } from "../../../Common/ColorPalette";
import { CADFiler } from "../../../DatabaseServices/CADFiler";
import { Board } from "../../../DatabaseServices/Entity/Board";
import { Curve } from "../../../DatabaseServices/Entity/Curve";
import { Entity } from "../../../DatabaseServices/Entity/Entity";
import { CommandWrap } from "../../../Editor/CommandMachine";
import { TempEditor } from "../../../Editor/TempEditor";
import { userConfig } from "../../../Editor/UserConfig";
export function ZoomToEntity(en: Entity)
{
@ -67,6 +69,8 @@ export class BoardEdgesEditor
{
if (!this._editoring) return;
userConfig.ConceptualOpacity = this._OpacityBak;
//马上标记为否,避免重入
this._editoring = false;
@ -83,16 +87,28 @@ export class BoardEdgesEditor
app.Editor.MaskManage.Clear();
}
private _OpacityBak: number;
private Start()
{
TempEditor.Start();
this._OpacityBak = userConfig.ConceptualOpacity;
userConfig.ConceptualOpacity = 0.2;
CommandWrap(() =>
{
for (let [b, cus] of this._brMap)
for (let [br, cus] of this._brMap)
{
//#region 绘制透明mesh
let geo = br.MeshGeometry;
let mesh = new Mesh(geo, ColorMaterial.GetConceptualMaterial(7, FrontSide, true));
mesh.matrixAutoUpdate = false;
mesh.matrix = br.OCSNoClone;
TempEditor.editorScene.add(mesh);
//#endregion
for (let cu of cus)
{
cu.ApplyMatrix(b.OCSNoClone);
cu.Move({ x: 0, y: 0, z: br.Thickness * 0.5 });
cu.ApplyMatrix(br.OCSNoClone);
app.Database.ModelSpace.Append(cu);
}
}

Loading…
Cancel
Save