You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
WebCAD/__test__/Polyline/polylineArea.test.ts

17 lines
1.8 KiB

import { LoadEntityFromFileData } from "../Utils/LoadEntity.util";
import { Polyline } from "../../src/DatabaseServices/Entity/Polyline";
import "../Utils/jest.util";
test('多段线面积', () =>
{
let d =
{ "file": [6, "Polyline", 5, 2, 101, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 2, 2, [9.569377990430496, 149.52153110047848], 0, [441.3875598086124, 373.2057416267944], 0, false, "Polyline", 5, 2, 102, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 2, 3, [612.4401913875597, 147.12918660287082], 0, [1139.952153110048, 383.9712918660287], 0, [1203.349282296651, 160.28708133971296], 0, false, "Polyline", 5, 2, 103, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 2, 3, [1493.5406698564593, 8.612440191387606], 0, [2302.3923444976076, 372.0095693779905], 0, [2302.3923444976076, -81.81818181818187], 0, true, "Polyline", 5, 2, 104, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 2, 3, [2601.818181818182, 136.88995215311004], 0, [3033.2057416267944, 495.59808612440185], -1.4100385033366523, [3122.2966507177034, 256.4593301435407], 0, false, "Polyline", 5, 2, 105, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 2, 2, [3438.803827751196, -13.157894736842092], -0.37911328762272817, [3745.933014354067, -285.11961722488024], 0, false, "Polyline", 5, 2, 106, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 2, 3, [4261.253588516746, -110.68899521531104], 0, [5012.899521531101, 99.37799043062196], -0.5470946737007636, [4261.253588516747, -110.68899521531102], 0, false], "basePt": { "x": 9.569377990430496, "y": -285.1196172248802, "z": 0 } };
let pls = LoadEntityFromFileData(d) as Polyline[];
for (let pl of pls)
{
expect(pl.Area).toMatchNumberSnapshot();
}
});