|
|
@ -3,6 +3,7 @@ import { Vector2, Vector3 } from 'three';
|
|
|
|
import { Polyline } from '../../src/DatabaseServices/Polyline';
|
|
|
|
import { Polyline } from '../../src/DatabaseServices/Polyline';
|
|
|
|
import { equal, equaln } from '../../src/Geometry/GeUtils';
|
|
|
|
import { equal, equaln } from '../../src/Geometry/GeUtils';
|
|
|
|
import { CADFile } from '../../src/DatabaseServices/CADFile';
|
|
|
|
import { CADFile } from '../../src/DatabaseServices/CADFile';
|
|
|
|
|
|
|
|
import { Vec2DTo3D } from '../../src/Common/CurveUtils';
|
|
|
|
|
|
|
|
|
|
|
|
test("多段线点获取参数", () =>
|
|
|
|
test("多段线点获取参数", () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -498,4 +499,18 @@ describe('多段线', () =>
|
|
|
|
let p = pl.GetPointAtParam(3);
|
|
|
|
let p = pl.GetPointAtParam(3);
|
|
|
|
expect(p).toMatchSnapshot();
|
|
|
|
expect(p).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test('存在大圆弧的多段线面积', () =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let f = new CADFile();
|
|
|
|
|
|
|
|
f.Data =
|
|
|
|
|
|
|
|
[1, ["Polyline", 1, 1, 1606, false, 7, -1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -19.17745164184445, -6.335408131680751, 0, 1], 2, 5, [11.884352072596577, -75.64730611519322], -1.9523252757782086, [16.25360183965801, -70.58112080246555], 0, [14.621427950114992, -70.9720172143345], 1.8583004340984604, [11.834326201222096, -73.95002751582643], 0, [11.884352072596577, -75.64730611519322], 0, false]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
f.Read();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let pl = f.ReadObject() as Polyline;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(pl.Area2).toMatchSnapshot();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|