功能:动态插入模块或者绘制左右侧板时,允许使用<T>UCS坐标系

pull/2862/head
ChenX 3 months ago
parent 88119fbea1
commit 18da6c543b

@ -14,6 +14,7 @@ import { JigUtils } from '../../Editor/JigUtils';
import { PromptPointResult, PromptStatus } from '../../Editor/PromptResult';
import { ParsePlaceEntitys } from '../../Editor/TranstrolControl/ParsePlaceEntitys';
import { ParsePlacePos, ParsePlacePosWithTemplate, ParsePlacePosWithTemplate2 } from '../../Editor/TranstrolControl/ParsePlacePos';
import { CoordinateSystem } from '../../Geometry/CoordinateSystem';
import { ZeroVec, equalv3 } from '../../Geometry/GeUtils';
import { PointSelectSpaceClamp } from '../../Geometry/SpaceParse/PointSelectSpaceClamp';
import { BoardModal } from '../../UI/Components/Board/BoardModal';
@ -166,6 +167,7 @@ export class DrawLeftRight implements Command
KeyWordList: [
{ key: "S", msg: "插入空间" },
{ key: "B", msg: "基点" },
{ key: "T", msg: "UCS坐标系" },
...keys
],
Callback: ApplyPos
@ -187,6 +189,13 @@ export class DrawLeftRight implements Command
baseP.applyMatrix4(parse.PlaceEntity.OCSInv);
}
}
else if (ptRes.StringResult === "T")//UCS
{
let mtx = app.Editor.UCSMatrix;
let cs = new CoordinateSystem().CopyForm(mtx);
mtx.makeBasis(cs.XAxis, cs.ZAxis.clone().negate(), cs.YAxis);
parse.PlaceEntity.ApplyMatrix(parse.PlaceEntity.OCSInv.premultiply(mtx));
}
else if (ptRes.StringResult === "1" || ptRes.StringResult === "2" || ptRes.StringResult === "3")
{
parseType = parseInt(ptRes.StringResult) - 1;

@ -19,6 +19,7 @@ import { PromptStatus } from "../../../Editor/PromptResult";
import { ParsePlaceEntitys } from "../../../Editor/TranstrolControl/ParsePlaceEntitys";
import { ParsePlacePos, ParsePlacePosWithTemplate, ParsePlacePosWithTemplate2 } from "../../../Editor/TranstrolControl/ParsePlacePos";
import { userConfig } from "../../../Editor/UserConfig";
import { CoordinateSystem } from "../../../Geometry/CoordinateSystem";
import { ZeroVec, equaln, equalv3 } from "../../../Geometry/GeUtils";
import { DownPanelStore } from "../../Store/DownPanelStore";
import { IGetRoomInfo } from "./GetRoomCabName";
@ -164,8 +165,9 @@ export async function InsertTemplateByBasePoint(template: TemplateRecord, roomIn
let ptRes = await app.Editor.GetPoint({
Msg: "点取位置",
KeyWordList: [
{ key: "S", msg: "插入空间" },
// { key: "S", msg: "插入空间" },
{ key: "B", msg: "基点" },
{ key: "T", msg: "UCS坐标系" },
...keys
],
AllowNone: true,
@ -189,6 +191,13 @@ export async function InsertTemplateByBasePoint(template: TemplateRecord, roomIn
baseP.applyMatrix4(parse.PlaceEntity.OCSInv);
}
}
else if (ptRes.StringResult === "T")//UCS
{
let mtx = app.Editor.UCSMatrix;
let cs = new CoordinateSystem().CopyForm(mtx);
mtx.makeBasis(cs.XAxis, cs.ZAxis.clone().negate(), cs.YAxis);
parse.PlaceEntity.ApplyMatrix(parse.PlaceEntity.OCSInv.premultiply(mtx));
}
else if (ptRes.StringResult === "1" || ptRes.StringResult === "2" || ptRes.StringResult === "3")
{
parseType = parseInt(ptRes.StringResult) - 1;

Loading…
Cancel
Save