mirror of https://gitee.com/cf-fz/WebCAD.git
parent
fc9827b846
commit
dd116b18f3
@ -0,0 +1,35 @@
|
||||
import { FixedNotZero } from '../../../Common/Utils';
|
||||
import { Arc } from '../../../DatabaseServices/Entity/Arc';
|
||||
import { Circle } from '../../../DatabaseServices/Entity/Circle';
|
||||
import { Curve } from '../../../DatabaseServices/Entity/Curve';
|
||||
import { Entity } from '../../../DatabaseServices/Entity/Entity';
|
||||
import { Line } from '../../../DatabaseServices/Entity/Line';
|
||||
import { Polyline } from '../../../DatabaseServices/Entity/Polyline';
|
||||
import { Spline } from '../../../DatabaseServices/Spline';
|
||||
import { PointToString } from '../../Store/PointToString';
|
||||
|
||||
|
||||
export function GetEntityProperty(en: Entity)
|
||||
{
|
||||
let pers: string[] = []; //属性表
|
||||
if (en instanceof Curve)
|
||||
{
|
||||
pers.push(`长度: ${FixedNotZero(en.Length, 3)}`);
|
||||
if (!(en instanceof Line))
|
||||
{
|
||||
pers.push(`面积: ${FixedNotZero(en.Area, 3)}`);
|
||||
if (en instanceof Polyline || en instanceof Spline)
|
||||
pers.push(`参数: ${en.EndParam}`);
|
||||
pers.push(`时针: ${en.IsClockWise ? "顺时针" : "逆时针"}`);
|
||||
|
||||
if (en instanceof Polyline || en instanceof Spline)
|
||||
pers.push(`闭合: ${en.IsClose ? "闭合" : "不闭合"}`);
|
||||
}
|
||||
if (en instanceof Arc || en instanceof Circle)
|
||||
pers.push(`半径: ${FixedNotZero(en.Radius, 3)}`);
|
||||
|
||||
pers.push(`起点: ${PointToString(en.StartPoint)}`);
|
||||
pers.push(`终点: ${PointToString(en.StartPoint)}`);
|
||||
}
|
||||
return pers;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
import { Vector3 } from 'three';
|
||||
import { FixedNotZero } from '../../Common/Utils';
|
||||
|
||||
//点转换为字符串.
|
||||
export function PointToString(pt: Vector3): string
|
||||
{
|
||||
return pt.toArray().map(o =>
|
||||
{
|
||||
return FixedNotZero(o, 3);
|
||||
}).join(" , ");
|
||||
}
|
Loading…
Reference in new issue