vue2-tunnel-lining
Version:
A Vue2 component for tunnel lining design with MxCAD integration
63 lines (56 loc) • 2.03 kB
text/typescript
import { MxCADUtility, McDb, McGePoint3d } from "mxcad";
import { Setting } from "../../Setting/Setting";
import { LinDataHelper } from "./LInDataHelper";
import { LinCalcHelper } from "./LinCalcHelper";
import { lining } from "./Lining";
// 定义配置接口(与Vue组件中的config结构一致)
export interface TunnelConfig {
RadiusFirst1: number;
RadiusFirst2: number;
RadiusFirst3: number;
RadiusSecond1: number;
RadiusSecond2: number;
RadiusThird1: number;
RadiusThird2: number;
RadiusThird3: number;
RadiusFourth1: number;
RadiusFourth2: number;
RadiusFourth3: number;
H_ngToO1: number;
H_ngToO2: number;
H_ngToO3: number;
H_zkToZb: number;
d1: number;
d2: number;
m1: number;
m2: number;
Angle1: number;
AngleGb: number;
b1_z: number;
b1_y: number;
}
export class LiningMain {
static SL160200_Yg(basePoint: McGePoint3d, config?: TunnelConfig) {
console.log("LiningMain加载");
const set = new Setting();
basePoint = new McGePoint3d(0, 0, 0);
// 初始化数据 - 传入配置参数
LinDataHelper.InitCommonData(set, true, config);
console.log("InitCommonData函数结果:");
// 创建新的衬砌颜色文本设置
const LT = set.ChenQi.LT;
LT.Color_Jg = 3;
LT.ptBase1 = basePoint;
LT.ptBase2 = new McGePoint3d(basePoint.x + 450, basePoint.y, 0);
// 根据配置计算不同的点集
LT.DicFirst = LinCalcHelper.calcPt3dColFirst(set);
LT.DicSecond = LinCalcHelper.calcPt3dColSecond(set);
LT.DicForth_Gq = LinCalcHelper.CalcPt3dColForth(set);
LT.DicSecond_Gq = LinCalcHelper.CalcPt3dCol_Second_Gq(set);
LT.DicThird_Ylbx_Gq = LinCalcHelper.CalcPt3dCol_Ylbx(set);
// 更新设置
set.ChenQi.LT = LT;
// 创建衬砌并绘制
lining.LinDrawAll(set);
}
}