|
|
|
@ -1,12 +1,12 @@
|
|
|
|
|
import { Command } from "../Editor/CommandMachine";
|
|
|
|
|
import { app } from "../ApplicationServices/Application";
|
|
|
|
|
import { PromptStatus } from "../Editor/PromptResult";
|
|
|
|
|
import { ShowLinesToaster } from "../UI/Components/Toaster";
|
|
|
|
|
import { Intent } from "@blueprintjs/core";
|
|
|
|
|
import { Log } from "../Common/Log";
|
|
|
|
|
import { angle } from "../Geometry/GeUtils";
|
|
|
|
|
import { MathUtils } from "three";
|
|
|
|
|
import { app } from "../ApplicationServices/Application";
|
|
|
|
|
import { Log } from "../Common/Log";
|
|
|
|
|
import { FixedNotZero } from "../Common/Utils";
|
|
|
|
|
import { Command } from "../Editor/CommandMachine";
|
|
|
|
|
import { PromptStatus } from "../Editor/PromptResult";
|
|
|
|
|
import { angle } from "../Geometry/GeUtils";
|
|
|
|
|
import { ShowLinesToaster } from "../UI/Components/Toaster";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export class Command_Dist implements Command
|
|
|
|
@ -31,18 +31,18 @@ export class Command_Dist implements Command
|
|
|
|
|
|
|
|
|
|
let p2 = ptRes.Point;
|
|
|
|
|
|
|
|
|
|
let dist = FixedNotZero(p1.distanceTo(p2), 2);
|
|
|
|
|
let x = FixedNotZero(Math.abs(p2.x - p1.x), 2);
|
|
|
|
|
let y = FixedNotZero(Math.abs(p2.y - p1.y), 2);
|
|
|
|
|
let z = FixedNotZero(Math.abs(p2.z - p1.z), 2);
|
|
|
|
|
let dist = FixedNotZero(p1.distanceTo(p2), 4);
|
|
|
|
|
let x = FixedNotZero(Math.abs(p2.x - p1.x), 4);
|
|
|
|
|
let y = FixedNotZero(Math.abs(p2.y - p1.y), 4);
|
|
|
|
|
let z = FixedNotZero(Math.abs(p2.z - p1.z), 4);
|
|
|
|
|
|
|
|
|
|
let vec = p2.sub(p1);
|
|
|
|
|
|
|
|
|
|
let ang = FixedNotZero(MathUtils.radToDeg(angle(vec)), 2);
|
|
|
|
|
let ang2 = FixedNotZero(MathUtils.radToDeg(Math.asin(vec.z / vec.length())), 2);
|
|
|
|
|
let ang = FixedNotZero(MathUtils.radToDeg(angle(vec)), 4);
|
|
|
|
|
let ang2 = FixedNotZero(MathUtils.radToDeg(Math.asin(vec.z / vec.length())), 4);
|
|
|
|
|
|
|
|
|
|
ShowLinesToaster([
|
|
|
|
|
`距离=${dist}`, `XY平面倾角=${ang}°`, `XY平面夹角=${ang2}°`, `X方向距离=${x}`, `Y方向距离=${y}`, `Z方向距离=${z}`
|
|
|
|
|
`距离=${dist} 向量(${x},${y},${z})`, `XY平面倾角=${ang}°`, `XY平面夹角=${ang2}°`, `X方向距离=${x}`, `Y方向距离=${y}`, `Z方向距离=${z}`
|
|
|
|
|
], { timeout: 20 * 1e3, intent: Intent.SUCCESS }, "dist");
|
|
|
|
|
Log(`距离=${dist},XY平面倾角=${ang}°,XY平面夹角=${ang2}°,X方向距离=${x},Y方向距离=${y},Z方向距离=${z}`);
|
|
|
|
|
}
|
|
|
|
|