|
|
@ -1,4 +1,4 @@
|
|
|
|
import { Matrix4, Vector3, Math, Box3 } from "three";
|
|
|
|
import { Box3, Math, Matrix4, Vector3 } from "three";
|
|
|
|
import { AutoRecord, ISPROXYKEY } from "../AutoRecord";
|
|
|
|
import { AutoRecord, ISPROXYKEY } from "../AutoRecord";
|
|
|
|
import { Factory } from "../CADFactory";
|
|
|
|
import { Factory } from "../CADFactory";
|
|
|
|
import { CADFiler } from "../CADFiler";
|
|
|
|
import { CADFiler } from "../CADFiler";
|
|
|
@ -9,6 +9,7 @@ import { SymbolTableRecord } from "../SymbolTableRecord";
|
|
|
|
import { TemplateParam } from "./Param/TemplateParam";
|
|
|
|
import { TemplateParam } from "./Param/TemplateParam";
|
|
|
|
import { TemplateParamType } from "./Param/TemplateParamType";
|
|
|
|
import { TemplateParamType } from "./Param/TemplateParamType";
|
|
|
|
import { Positioning } from "./Positioning/Positioning";
|
|
|
|
import { Positioning } from "./Positioning/Positioning";
|
|
|
|
|
|
|
|
import { PositioningTemporary } from "./Positioning/PositioningTemporary";
|
|
|
|
import { TemplateSplitType, TemplateType } from "./TemplateType";
|
|
|
|
import { TemplateSplitType, TemplateType } from "./TemplateType";
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -227,7 +228,7 @@ export class TemplateRecord extends SymbolTableRecord
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
protected async Update()
|
|
|
|
protected async Update()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let vardefines = this.GetParameterDefinition(false);
|
|
|
|
let varDefines = this.GetParameterDefinition(false);
|
|
|
|
let brs = this.Objects.filter(id => !id.IsErase).map(id => id.Object as Board);
|
|
|
|
let brs = this.Objects.filter(id => !id.IsErase).map(id => id.Object as Board);
|
|
|
|
let evaled = new Set<TemplateParam>();
|
|
|
|
let evaled = new Set<TemplateParam>();
|
|
|
|
|
|
|
|
|
|
|
@ -251,7 +252,7 @@ export class TemplateRecord extends SymbolTableRecord
|
|
|
|
spaceCS = this.positioning.SpaceCS;
|
|
|
|
spaceCS = this.positioning.SpaceCS;
|
|
|
|
spaceSize = this.positioning.SpaceSize;
|
|
|
|
spaceSize = this.positioning.SpaceSize;
|
|
|
|
|
|
|
|
|
|
|
|
spaceCS = this.RotateSpaceCS(vardefines, paramMap, evaled, spaceCS, spaceSize);
|
|
|
|
spaceCS = this.RotateSpaceCS(varDefines, paramMap, evaled, spaceCS, spaceSize);
|
|
|
|
//更新LWH(通过定位空间)
|
|
|
|
//更新LWH(通过定位空间)
|
|
|
|
this.LParam.UpdateParam(spaceSize.x);
|
|
|
|
this.LParam.UpdateParam(spaceSize.x);
|
|
|
|
this.LParam.expr = "";
|
|
|
|
this.LParam.expr = "";
|
|
|
@ -259,17 +260,20 @@ export class TemplateRecord extends SymbolTableRecord
|
|
|
|
this.WParam.expr = "";
|
|
|
|
this.WParam.expr = "";
|
|
|
|
this.HParam.UpdateParam(spaceSize.z);
|
|
|
|
this.HParam.UpdateParam(spaceSize.z);
|
|
|
|
this.HParam.expr = "";
|
|
|
|
this.HParam.expr = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.positioning instanceof PositioningTemporary)
|
|
|
|
|
|
|
|
this.positioning = undefined;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
this.LParam.EvalUpdate(vardefines, paramMap, evaled);
|
|
|
|
this.LParam.EvalUpdate(varDefines, paramMap, evaled);
|
|
|
|
this.WParam.EvalUpdate(vardefines, paramMap, evaled);
|
|
|
|
this.WParam.EvalUpdate(varDefines, paramMap, evaled);
|
|
|
|
this.HParam.EvalUpdate(vardefines, paramMap, evaled);
|
|
|
|
this.HParam.EvalUpdate(varDefines, paramMap, evaled);
|
|
|
|
|
|
|
|
|
|
|
|
this.PXParam.EvalUpdate(vardefines, paramMap, evaled);
|
|
|
|
this.PXParam.EvalUpdate(varDefines, paramMap, evaled);
|
|
|
|
this.PYParam.EvalUpdate(vardefines, paramMap, evaled);
|
|
|
|
this.PYParam.EvalUpdate(varDefines, paramMap, evaled);
|
|
|
|
this.PZParam.EvalUpdate(vardefines, paramMap, evaled);
|
|
|
|
this.PZParam.EvalUpdate(varDefines, paramMap, evaled);
|
|
|
|
|
|
|
|
|
|
|
|
let l = this.LParam.value as number;
|
|
|
|
let l = this.LParam.value as number;
|
|
|
|
let w = this.WParam.value as number;
|
|
|
|
let w = this.WParam.value as number;
|
|
|
@ -280,7 +284,7 @@ export class TemplateRecord extends SymbolTableRecord
|
|
|
|
let baseP = new Vector3(this.PXParam.value as number, this.PYParam.value as number, this.PZParam.value as number);
|
|
|
|
let baseP = new Vector3(this.PXParam.value as number, this.PYParam.value as number, this.PZParam.value as number);
|
|
|
|
baseP.applyMatrix4(spaceCS);
|
|
|
|
baseP.applyMatrix4(spaceCS);
|
|
|
|
spaceCS.setPosition(baseP);
|
|
|
|
spaceCS.setPosition(baseP);
|
|
|
|
spaceCS = this.RotateSpaceCS(vardefines, paramMap, evaled, spaceCS, spaceSize);
|
|
|
|
spaceCS = this.RotateSpaceCS(varDefines, paramMap, evaled, spaceCS, spaceSize);
|
|
|
|
|
|
|
|
|
|
|
|
if (!this.Parent)
|
|
|
|
if (!this.Parent)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -307,9 +311,9 @@ export class TemplateRecord extends SymbolTableRecord
|
|
|
|
this.HParam.UpdateParam(spaceSize.z);
|
|
|
|
this.HParam.UpdateParam(spaceSize.z);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
vardefines["L"] = spaceSize.x;
|
|
|
|
varDefines["L"] = spaceSize.x;
|
|
|
|
vardefines["W"] = spaceSize.y;
|
|
|
|
varDefines["W"] = spaceSize.y;
|
|
|
|
vardefines["H"] = spaceSize.z;
|
|
|
|
varDefines["H"] = spaceSize.z;
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
|
|
@ -325,7 +329,7 @@ export class TemplateRecord extends SymbolTableRecord
|
|
|
|
//更新其他参数变量 Eval local params
|
|
|
|
//更新其他参数变量 Eval local params
|
|
|
|
for (const param of this.Params)
|
|
|
|
for (const param of this.Params)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
param.EvalUpdate(vardefines, paramMap, evaled);
|
|
|
|
param.EvalUpdate(varDefines, paramMap, evaled);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//保持SpaceCS
|
|
|
|
//保持SpaceCS
|
|
|
@ -335,7 +339,7 @@ export class TemplateRecord extends SymbolTableRecord
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//Cache
|
|
|
|
//Cache
|
|
|
|
this._CacheParamVars = vardefines;
|
|
|
|
this._CacheParamVars = varDefines;
|
|
|
|
this._CacheSpaceCS = spaceCS;
|
|
|
|
this._CacheSpaceCS = spaceCS;
|
|
|
|
this._CacheSpaceSize = spaceSize;
|
|
|
|
this._CacheSpaceSize = spaceSize;
|
|
|
|
}
|
|
|
|
}
|
|
|
|