mirror of https://gitee.com/cf-fz/WebCAD.git
parent
2116647cd1
commit
3dfd08cdd5
@ -0,0 +1,38 @@
|
||||
import { Box3, Vector3 } from "three";
|
||||
import { Line } from "../../DatabaseServices/Entity/Line";
|
||||
import { equalv3 } from "../../Geometry/GeUtils";
|
||||
|
||||
|
||||
export function BoxLine(box: Box3): Line[]
|
||||
{
|
||||
if (box.isEmpty())
|
||||
return [];
|
||||
let pts = [
|
||||
new Vector3(box.min.x, box.min.y, box.min.z),
|
||||
new Vector3(box.min.x, box.min.y, box.max.z),
|
||||
new Vector3(box.min.x, box.max.y, box.min.z),
|
||||
new Vector3(box.min.x, box.max.y, box.max.z),
|
||||
|
||||
new Vector3(box.max.x, box.min.y, box.min.z),
|
||||
new Vector3(box.max.x, box.min.y, box.max.z),
|
||||
new Vector3(box.max.x, box.max.y, box.min.z),
|
||||
new Vector3(box.max.x, box.max.y, box.max.z),
|
||||
];
|
||||
|
||||
let lines: Line[] = [];
|
||||
for (let line of [
|
||||
[0, 1], [2, 3], [0, 2], [1, 3],
|
||||
[4, 5], [6, 7], [4, 6], [5, 7],
|
||||
|
||||
[0, 4], [2, 6],
|
||||
|
||||
[1, 5], [3, 7],
|
||||
])
|
||||
{
|
||||
let p1 = pts[line[0]];
|
||||
let p2 = pts[line[1]];
|
||||
if (!equalv3(p1, p2))
|
||||
lines.push(new Line(p1, p2));
|
||||
}
|
||||
return lines;
|
||||
}
|
@ -1,10 +1,14 @@
|
||||
|
||||
export function IsDev()
|
||||
{
|
||||
//del_exp_start
|
||||
return window.location.hostname === "localhost";
|
||||
//del_exp_end return false
|
||||
}
|
||||
|
||||
export function IsTest()
|
||||
{
|
||||
//del_exp_start
|
||||
return window.location.hostname === "localhost" || window.location.hostname === "t.cfcad.cn";
|
||||
//del_exp_end return false
|
||||
}
|
||||
|
@ -0,0 +1,9 @@
|
||||
import { IBaseOption } from "../UI/Store/BoardInterface";
|
||||
|
||||
|
||||
export interface ICursorConfig extends IBaseOption
|
||||
{
|
||||
D2: number;
|
||||
D3: number;
|
||||
SquareSize: number;
|
||||
}
|
Loading…
Reference in new issue