mirror of https://gitee.com/cf-fz/WebCAD.git
!1252 优化:顶线长度
parent
2743d6f131
commit
78cf4ea376
@ -0,0 +1,69 @@
|
|||||||
|
import { HardwareTopline } from "../../src/DatabaseServices/Hardware/HardwareTopline";
|
||||||
|
import { LoadEntityFromFileData } from "../Utils/LoadEntity.util";
|
||||||
|
|
||||||
|
describe("顶线分段测试", () =>
|
||||||
|
{
|
||||||
|
test("不闭合直线", () =>
|
||||||
|
{
|
||||||
|
let data = { "file": [1, "HardwareTopline", 8, 2, 101, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 1, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -287.8749030927833, -1610.1774753266122, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -259.0799031476998, 7.263922518159916, 0, 1], 0, 2, 12, [327.8749030927833, 1710.1774753266122], 0, [305.5142233177854, 1710.1774753266122], 0, [265.5142233177854, 1630.1774753266122], 0, [227.8749030927833, 1630.1774753266122], 0, [227.8749030927833, 1610.1774753266122], 0, [287.8749030927833, 1610.1774753266122], 0, [287.8749030927833, 1630.1774753266122], 0, [293.72274470531937, 1641.8731585516844], -0.4817330338808767, [307.8749030927833, 1670.1774753266122], 0, [315.06369878080005, 1684.5550667026457], -1.000000000000003, [322.30959178698555, 1699.0468527150167], 0, [327.8749030927833, 1710.1774753266122], 0, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 8, [665.0653753026636, 3.786924939467383], 0, [665.0653753026636, 1051.6513317191284], 0, [2248.2518159806295, 1051.6513317191284], 0, [2248.2518159806295, 274.2953995157385], 0, [3372.9975786924942, 274.2953995157385], 0, [3372.9975786924942, 934.9055690072639], 0, [4594.556900726393, 934.9055690072639], 0, [4594.556900726393, -132.89104116222757], 0, false, 1, 0, "0", "2", "", "", "", "", "", "", "", "", "", 0], "basePt": { "x": 605.0653753026636, "y": -132.89104116222757, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
||||||
|
|
||||||
|
let en = LoadEntityFromFileData(data)[0] as HardwareTopline;
|
||||||
|
let sgs = en.Segmentations;
|
||||||
|
for (let sg of sgs)
|
||||||
|
expect(sg.Length).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
test("闭合直线", () =>
|
||||||
|
{
|
||||||
|
let data = { "file": [1, "HardwareTopline", 8, 2, 103, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 1, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -287.8749030927833, -1610.1774753266122, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -259.0799031476998, 7.263922518159916, 0, 1], 0, 2, 12, [327.8749030927833, 1710.1774753266122], 0, [305.5142233177854, 1710.1774753266122], 0, [265.5142233177854, 1630.1774753266122], 0, [227.8749030927833, 1630.1774753266122], 0, [227.8749030927833, 1610.1774753266122], 0, [287.8749030927833, 1610.1774753266122], 0, [287.8749030927833, 1630.1774753266122], 0, [293.72274470531937, 1641.8731585516844], -0.4817330338808767, [307.8749030927833, 1670.1774753266122], 0, [315.06369878080005, 1684.5550667026457], -1.000000000000003, [322.30959178698555, 1699.0468527150167], 0, [327.8749030927833, 1710.1774753266122], 0, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 10, [6596.172000387409, 1362.5581683292971], 0, [8676.730470895884, 1362.5581683292971], 0, [9168.976165811138, 364.9402266343825], 0, [9359.311167845035, -639.2409909927355], 0, [8958.95133598063, -1512.156689975786], 0, [7199.993386150121, -1978.1492811622265], 0, [6569.918896658596, -1735.308071670701], 0, [5920.15457937046, -882.082200484261], 0, [5920.15457937046, 181.1685005326874], 0, [6596.172000387409, 1362.5581683292971], 0, false, 1, 0, "0", "2", "", "", "", "", "", "", "", "", "", 0], "basePt": { "x": 5860.15457937046, "y": -2041.1284915962528, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
||||||
|
|
||||||
|
let en = LoadEntityFromFileData(data)[0] as HardwareTopline;
|
||||||
|
let sgs = en.Segmentations;
|
||||||
|
for (let sg of sgs)
|
||||||
|
expect(sg.Length).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
test("闭合直线2", () =>
|
||||||
|
{
|
||||||
|
let data = { "file": [1, "HardwareTopline", 8, 2, 125, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 1, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -287.8749030927833, -1610.1774753266122, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -259.0799031476998, 7.263922518159916, 0, 1], 0, 2, 12, [327.8749030927833, 1710.1774753266122], 0, [305.5142233177854, 1710.1774753266122], 0, [265.5142233177854, 1630.1774753266122], 0, [227.8749030927833, 1630.1774753266122], 0, [227.8749030927833, 1610.1774753266122], 0, [287.8749030927833, 1610.1774753266122], 0, [287.8749030927833, 1630.1774753266122], 0, [293.72274470531937, 1641.8731585516844], -0.4817330338808767, [307.8749030927833, 1670.1774753266122], 0, [315.06369878080005, 1684.5550667026457], -1.000000000000003, [322.30959178698555, 1699.0468527150167], 0, [327.8749030927833, 1710.1774753266122], 0, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 13, [1015.8635290455081, -2009.9663326486714], 0, [1130.2226351130905, -3672.571797785067], 0, [-92.5401143787551, -3672.571797785067], 0, [-92.5401143787551, -5185.630739602315], 0, [1042.2540919841813, -5185.630739602315], 0, [1042.2540919841813, -6742.67395298402], 0, [2775.2343916237037, -6742.67395298402], 0, [2775.2343916237037, -5475.926931927717], 0, [4824.901446527302, -5475.926931927717], 0, [4824.901446527302, -3575.8064003432655], 0, [3311.8425047100536, -3575.8064003432655], 0, [3311.8425047100536, -2009.9663326486714], 0, [1015.8635290455081, -2009.9663326486714], 0, false, 1, 0, "0", "2", "", "", "", "", "", "", "", "", "", 0], "basePt": { "x": -132.5401143787559, "y": -6782.67395298402, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
||||||
|
|
||||||
|
let en = LoadEntityFromFileData(data)[0] as HardwareTopline;
|
||||||
|
let sgs = en.Segmentations;
|
||||||
|
for (let sg of sgs)
|
||||||
|
expect(sg.Length).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
test("不闭合直线圆弧", () =>
|
||||||
|
{
|
||||||
|
let data = { "file": [1, "HardwareTopline", 8, 2, 138, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 1, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -287.8749030927833, -1610.1774753266122, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -259.0799031476998, 7.263922518159916, 0, 1], 0, 2, 12, [327.8749030927833, 1710.1774753266122], 0, [305.5142233177854, 1710.1774753266122], 0, [265.5142233177854, 1630.1774753266122], 0, [227.8749030927833, 1630.1774753266122], 0, [227.8749030927833, 1610.1774753266122], 0, [287.8749030927833, 1610.1774753266122], 0, [287.8749030927833, 1630.1774753266122], 0, [293.72274470531937, 1641.8731585516844], -0.4817330338808767, [307.8749030927833, 1670.1774753266122], 0, [315.06369878080005, 1684.5550667026457], -1.000000000000003, [322.30959178698555, 1699.0468527150167], 0, [327.8749030927833, 1710.1774753266122], 0, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 7, [8161.170129063812, -4825.736011624398], 0, [10274.422826954877, -4535.8983420362665], -0.3209968703598907, [13631.804665466512, -3515.33299725931], 0.6961040990362499, [16433.95143649677, -4968.781221551193], 0, [18722.67479532548, -6256.188110892344], 0, [17900.164838246415, -8366.104957312566], 0, [13847.2172236539, -8938.285797019744], 0, false, 1, 0, "0", "2", "", "", "", "", "", "", "", "", "", 0], "basePt": { "x": 8153.017308542492, "y": -8997.696665063295, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
||||||
|
|
||||||
|
let en = LoadEntityFromFileData(data)[0] as HardwareTopline;
|
||||||
|
let sgs = en.Segmentations;
|
||||||
|
for (let sg of sgs)
|
||||||
|
expect(sg.Length).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
test("不闭合直线圆弧2", () =>
|
||||||
|
{
|
||||||
|
let data = { "file": [1, "HardwareTopline", 8, 2, 176, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 1, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -287.8749030927833, -1610.1774753266122, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -259.0799031476998, 7.263922518159916, 0, 1], 0, 2, 12, [327.8749030927833, 1710.1774753266122], 0, [305.5142233177854, 1710.1774753266122], 0, [265.5142233177854, 1630.1774753266122], 0, [227.8749030927833, 1630.1774753266122], 0, [227.8749030927833, 1610.1774753266122], 0, [287.8749030927833, 1610.1774753266122], 0, [287.8749030927833, 1630.1774753266122], 0, [293.72274470531937, 1641.8731585516844], -0.4817330338808767, [307.8749030927833, 1670.1774753266122], 0, [315.06369878080005, 1684.5550667026457], -1.000000000000003, [322.30959178698555, 1699.0468527150167], 0, [327.8749030927833, 1710.1774753266122], 0, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 6, [4897.356760796507, -13021.199375936494], 0, [9215.002456548624, -12210.606888994527], -1.5675361689042855, [8896.50860624945, -15932.715247401524], 0.6586041364016083, [13810.3273614602, -19298.493791077715], 0.5762572382754851, [19488.91928472054, -20035.357142623532], 1.0469568095664106, [24641.13993498401, -15563.349756617026], 0, false, 1, 0, "0", "2", "", "", "", "", "", "", "", "", "", 0], "basePt": { "x": 4886.285807460384, "y": -20100.459726764348, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
||||||
|
|
||||||
|
let en = LoadEntityFromFileData(data)[0] as HardwareTopline;
|
||||||
|
let sgs = en.Segmentations;
|
||||||
|
for (let sg of sgs)
|
||||||
|
expect(sg.Length).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
test("闭合圆弧", () =>
|
||||||
|
{
|
||||||
|
let data = { "file": [1, "HardwareTopline", 8, 2, 212, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 1, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -287.8749030927833, -1610.1774753266122, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -259.0799031476998, 7.263922518159916, 0, 1], 0, 2, 12, [327.8749030927833, 1710.1774753266122], 0, [305.5142233177854, 1710.1774753266122], 0, [265.5142233177854, 1630.1774753266122], 0, [227.8749030927833, 1630.1774753266122], 0, [227.8749030927833, 1610.1774753266122], 0, [287.8749030927833, 1610.1774753266122], 0, [287.8749030927833, 1630.1774753266122], 0, [293.72274470531937, 1641.8731585516844], -0.4817330338808767, [307.8749030927833, 1670.1774753266122], 0, [315.06369878080005, 1684.5550667026457], -1.000000000000003, [322.30959178698555, 1699.0468527150167], 0, [327.8749030927833, 1710.1774753266122], 0, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 9, [26918.40309536543, -6762.519351691368], 0, [30726.6994741038, -2358.141800628734], -0.5886269825401041, [35793.38943886006, -3417.8416625385407], 1.9631692691925628, [37945.904783364356, -536.7826629712545], -0.9869745189351885, [37945.904783364356, 2675.4325434428465], -0.15411492859354337, [45198.2257133096, 489.8015782538714], -0.7492501709688599, [41952.894886210815, -9511.115868519928], -0.13168435817007573, [31223.433784374025, -6298.900662105827], 0.3425423322181609, [26918.40309536543, -6762.519351691368], 0, false, 1, 0, "0", "2", "", "", "", "", "", "", "", "", "", 0], "basePt": { "x": 26006.740732473027, "y": -9571.090590925047, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
||||||
|
|
||||||
|
let en = LoadEntityFromFileData(data)[0] as HardwareTopline;
|
||||||
|
let sgs = en.Segmentations;
|
||||||
|
for (let sg of sgs)
|
||||||
|
expect(sg.Length).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
test("不闭合多补圆弧", () =>
|
||||||
|
{
|
||||||
|
let data = { "file": [1, "HardwareTopline", 8, 2, 461, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 1, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -287.8749030927833, -1610.1774753266122, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -259.0799031476998, 7.263922518159916, 0, 1], 0, 2, 12, [327.8749030927833, 1710.1774753266122], 0, [305.5142233177854, 1710.1774753266122], 0, [265.5142233177854, 1630.1774753266122], 0, [227.8749030927833, 1630.1774753266122], 0, [227.8749030927833, 1610.1774753266122], 0, [287.8749030927833, 1610.1774753266122], 0, [287.8749030927833, 1630.1774753266122], 0, [293.72274470531937, 1641.8731585516844], -0.4817330338808767, [307.8749030927833, 1670.1774753266122], 0, [315.06369878080005, 1684.5550667026457], -1.000000000000003, [322.30959178698555, 1699.0468527150167], 0, [327.8749030927833, 1710.1774753266122], 0, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 9, [45751.96592203299, 3086.036062563707], 0.22239155538431857, [52423.0828344913, 5938.5569393828955], 1.1461811427928006, [56463.47934476306, 3849.018445843789], 1.043480940008842, [62001.088374224215, 3387.691765452039], 0.8769933217842865, [68693.87601580269, 3758.4758746386747], 0.798237664392203, [75267.09679427171, 4091.702169937928], -0.8843311793277688, [80944.03676807143, 3824.3355122590892], -1.0886924073122075, [88681.92945847644, 2000.566713469759], -0.803057870546459, [94187.65216324253, -492.2642729771228], 0, false, 1, 0, "0", "2", "", "", "", "", "", "", "", "", "", 0], "basePt": { "x": 45750.62233582299, "y": -504.6289351196049, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
||||||
|
|
||||||
|
let en = LoadEntityFromFileData(data)[0] as HardwareTopline;
|
||||||
|
let sgs = en.Segmentations;
|
||||||
|
for (let sg of sgs)
|
||||||
|
expect(sg.Length).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
});
|
@ -0,0 +1,123 @@
|
|||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合多补圆弧 1`] = `7527.309534097056`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合多补圆弧 2`] = `181.5491080422332`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合多补圆弧 3`] = `7972.744263135363`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合多补圆弧 4`] = `175.55938663598863`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合多补圆弧 5`] = `9102.215223601412`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合多补圆弧 6`] = `174.8880833875115`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合多补圆弧 7`] = `9850.281806459632`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合多补圆弧 8`] = `167.51636096659317`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合多补圆弧 9`] = `9201.576517258296`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合多补圆弧 10`] = `8466.391158009817`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合多补圆弧 11`] = `13771.549281343938`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合多补圆弧 12`] = `8903.394215503109`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合直线 1`] = `1107.864406779661`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合直线 2`] = `1703.186440677966`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合直线 3`] = `877.3559322033899`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合直线 4`] = `1204.7457627118647`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合直线 5`] = `760.6101694915253`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合直线 6`] = `1341.5593220338988`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合直线 7`] = `1127.7966101694917`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合直线圆弧 1`] = `2149.5428197912242`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合直线圆弧 2`] = `3886.6189286714834`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合直线圆弧 3`] = `4288.290679114739`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合直线圆弧 4`] = `2721.960193789363`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合直线圆弧 5`] = `2351.778679840207`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合直线圆弧 6`] = `4128.24578371541`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合直线圆弧2 1`] = `4393.076886867966`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合直线圆弧2 2`] = `6.5660240646022485`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合直线圆弧2 3`] = `8562.229412244691`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合直线圆弧2 4`] = `7775.242286971556`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合直线圆弧2 5`] = `7158.345287787591`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 不闭合直线圆弧2 6`] = `11250.987271676091`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合圆弧 1`] = `183.06306067445354`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合圆弧 2`] = `5822.513453880229`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合圆弧 3`] = `6427.17494400804`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合圆弧 4`] = `9954.439545178488`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合圆弧 5`] = `5190.973862843558`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合圆弧 6`] = `7730.5776753028`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合圆弧 7`] = `14243.520190228804`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合圆弧 8`] = `11360.44019007804`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合圆弧 9`] = `4713.854133052737`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线 1`] = `2152.655017660556`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线 2`] = `1157.9339062625943`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线 3`] = `1049.373745402737`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线 4`] = `1007.7933435525692`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线 5`] = `1867.3971281882991`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线 6`] = `711.6950394345639`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线 7`] = `1109.7095976240196`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线 8`] = `1099.4488714706863`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线 9`] = `1411.8807330899142`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线2 1`] = `1773.6483926638098`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线2 2`] = `1327.0314994557618`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线2 3`] = `1593.058941817248`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线2 4`] = `1234.7942063629366`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线2 5`] = `1657.0432133817048`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线2 6`] = `1812.9802996395224`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线2 7`] = `1366.7470210563024`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线2 8`] = `2149.6670549035985`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线2 9`] = `1980.1205315844518`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线2 10`] = `1613.0589418172485`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线2 11`] = `1665.8400676945942`;
|
||||||
|
|
||||||
|
exports[`顶线分段测试 闭合直线2 12`] = `2378.824808973823`;
|
@ -0,0 +1,24 @@
|
|||||||
|
import { app } from "../../ApplicationServices/Application";
|
||||||
|
import { HardwareTopline } from "../../DatabaseServices/Hardware/HardwareTopline";
|
||||||
|
import { Command } from "../../Editor/CommandMachine";
|
||||||
|
import { PromptStatus } from "../../Editor/PromptResult";
|
||||||
|
import { HotCMD } from "../../Hot/HotCommand";
|
||||||
|
import { TestDraw } from "../test/TestUtil";
|
||||||
|
|
||||||
|
@HotCMD
|
||||||
|
export class Command_TestSweepMaxLength implements Command
|
||||||
|
{
|
||||||
|
async exec()
|
||||||
|
{
|
||||||
|
let enRes = await app.Editor.GetEntity({ Filter: { filterTypes: [HardwareTopline] }, Msg: "选肉" });
|
||||||
|
if (enRes.Status !== PromptStatus.OK) return;
|
||||||
|
let br = enRes.Entity as HardwareTopline;
|
||||||
|
let b = br.Path.Clone();
|
||||||
|
b.Erase(false);
|
||||||
|
TestDraw(b, 1);
|
||||||
|
//@ts-ignore
|
||||||
|
TestDraw(br.Contours.map(c => c.ApplyMatrix(br.OCS)), 2);
|
||||||
|
TestDraw(br.Segmentations.map(c => c.ApplyMatrix(br.OCS)), 3);
|
||||||
|
br.Erase();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue