!2521 修复:椭圆导出DXF错误

pull/2518/MERGE
ChenX 10 months ago
parent 42a5766a1f
commit 08ebb1a36f

@ -0,0 +1,718 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`测试坐标系 1`] = `
Arc {
"center": Vector3 {
"x": 338.1033990288489,
"y": 492.6878034847188,
"z": 0,
},
"colorNumber": 7,
"endAngle": 160.20836543733196,
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": 1,
},
"handle": "1A",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 144.5876021646271,
"startAngle": 46.27267439304247,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 2`] = `
Arc {
"center": Vector3 {
"x": 648.7300771208227,
"y": 598.858611825193,
"z": 0,
},
"colorNumber": 7,
"endAngle": 317.8005977801438,
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": 1,
},
"handle": "1B",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 163.24762182347456,
"startAngle": 161.8857480659139,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 3`] = `
Circle {
"center": Vector3 {
"x": 914.6529562982004,
"y": 557.0694087403599,
"z": 0,
},
"colorNumber": 7,
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": 1,
},
"handle": "1C",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 89.93756136008184,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "CIRCLE",
"visible": undefined,
}
`;
exports[`测试坐标系 4`] = `
Arc {
"center": Vector3 {
"x": 1256.44200267555,
"y": 617.6363902431158,
"z": 0,
},
"colorNumber": 7,
"endAngle": 28.245069504082206,
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": 1,
},
"handle": "1D",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 142.53451443264086,
"startAngle": 200.43711036930276,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 5`] = `
Arc {
"center": Vector3 {
"x": 795.2400732792385,
"y": -6.9392893298059395,
"z": 0,
},
"colorNumber": 7,
"endAngle": 198.9879636567884,
"extrusion": Vector3 {
"x": 1,
"y": 0,
"z": 0,
},
"handle": "1E",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 58.39946353294328,
"startAngle": 50.067979655488315,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 6`] = `
Arc {
"center": Vector3 {
"x": 951.3713621924406,
"y": -0.9326463427875904,
"z": 0,
},
"colorNumber": 7,
"endAngle": 345.2274499653736,
"extrusion": Vector3 {
"x": 1,
"y": 0,
"z": 0,
},
"handle": "1F",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 39.9043399032529,
"startAngle": 155.53679121838985,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 7`] = `
Circle {
"center": Vector3 {
"x": 1034.456106670302,
"y": 14.108779918888196,
"z": 0,
},
"colorNumber": 7,
"extrusion": Vector3 {
"x": 1,
"y": 0,
"z": 0,
},
"handle": "20",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 33.56356155376025,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "CIRCLE",
"visible": undefined,
}
`;
exports[`测试坐标系 8`] = `
Arc {
"center": Vector3 {
"x": 1154.1481089549789,
"y": 4.455713584499371,
"z": 0,
},
"colorNumber": 7,
"endAngle": 43.731022826758426,
"extrusion": Vector3 {
"x": 1,
"y": 0,
"z": 0,
},
"handle": "21",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 59.076480267941186,
"startAngle": 222.84956668122754,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 9`] = `
Arc {
"center": Vector3 {
"x": -184.66013131769495,
"y": 17.951029809255434,
"z": 0,
},
"colorNumber": 7,
"endAngle": 210.12391886438738,
"extrusion": Vector3 {
"x": -1,
"y": 0,
"z": 0,
},
"handle": "22",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 97.55455259794002,
"startAngle": 23.901411831489693,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 10`] = `
Arc {
"center": Vector3 {
"x": 86.21760512433669,
"y": 18.9606628121278,
"z": 0,
},
"colorNumber": 7,
"endAngle": 18.936975689477336,
"extrusion": Vector3 {
"x": -1,
"y": 0,
"z": 0,
},
"handle": "23",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 102.9527459180477,
"startAngle": 188.90494504036414,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 11`] = `
Circle {
"center": Vector3 {
"x": 321.43131467838316,
"y": 26.847041445506477,
"z": 0,
},
"colorNumber": 7,
"extrusion": Vector3 {
"x": -1,
"y": 0,
"z": 0,
},
"handle": "24",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 90.24330181115464,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "CIRCLE",
"visible": undefined,
}
`;
exports[`测试坐标系 12`] = `
Arc {
"center": Vector3 {
"x": 575.1018676562114,
"y": 61.32538817942155,
"z": 0,
},
"colorNumber": 7,
"endAngle": 359.7917118699017,
"extrusion": Vector3 {
"x": -1,
"y": 0,
"z": 0,
},
"handle": "25",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 113.87762124244482,
"startAngle": 210.50369477008587,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 13`] = `
Arc {
"center": Vector3 {
"x": 1844.0366210068821,
"y": 31.209982632468424,
"z": 0,
},
"colorNumber": 7,
"endAngle": 200.60092775926054,
"extrusion": Vector3 {
"x": 0,
"y": -1,
"z": 0,
},
"handle": "26",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 204.75902790831123,
"startAngle": 17.586056241710665,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 14`] = `
Arc {
"center": Vector3 {
"x": 2343.3282424658646,
"y": 49.00817526124687,
"z": 0,
},
"colorNumber": 7,
"endAngle": 347.95239438854355,
"extrusion": Vector3 {
"x": 0,
"y": -1,
"z": 0,
},
"handle": "27",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 188.07259850706058,
"startAngle": 165.51464391828904,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 15`] = `
Arc {
"center": Vector3 {
"x": 1815.0486048102593,
"y": 1122.208755124013,
"z": 0,
},
"colorNumber": 7,
"endAngle": 321.4670826858946,
"extrusion": Vector3 {
"x": 0,
"y": -1,
"z": 0,
},
"handle": "28",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 1503.9120300934628,
"startAngle": 303.82632358188886,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 16`] = `
Circle {
"center": Vector3 {
"x": 3295.016696810837,
"y": 96.05125433636663,
"z": 0,
},
"colorNumber": 7,
"extrusion": Vector3 {
"x": 0,
"y": -1,
"z": 0,
},
"handle": "29",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 154.74197208563115,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "CIRCLE",
"visible": undefined,
}
`;
exports[`测试坐标系 17`] = `
Arc {
"center": Vector3 {
"x": 1561.8221972145354,
"y": -220.6722975607595,
"z": 0,
},
"colorNumber": 7,
"endAngle": 179.9316687509269,
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": -1,
},
"handle": "2A",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 384.3210739793441,
"startAngle": 24.74650580572556,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 18`] = `
Arc {
"center": Vector3 {
"x": 3011.5016221510377,
"y": 965.5818818826049,
"z": 0,
},
"colorNumber": 7,
"endAngle": 271.5409362138016,
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": -1,
},
"handle": "2B",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 1255.001170786365,
"startAngle": 228.8613110771485,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 19`] = `
Arc {
"center": Vector3 {
"x": 3521.0162557338467,
"y": -266.7937654912005,
"z": 0,
},
"colorNumber": 7,
"endAngle": 149.0341063230569,
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": -1,
},
"handle": "2C",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 336.1536343583566,
"startAngle": 357.10659325887775,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 20`] = `
Circle {
"center": Vector3 {
"x": 4114.56483206322,
"y": -150.54578294871257,
"z": 0,
},
"colorNumber": 7,
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": -1,
},
"handle": "2D",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 219.60046528660857,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "CIRCLE",
"visible": undefined,
}
`;
exports[`测试坐标系 21`] = `
Arc {
"center": Vector3 {
"x": 4880.082219915602,
"y": 124.870849021293,
"z": 0,
},
"colorNumber": 7,
"endAngle": 224.63171264195998,
"extrusion": Vector3 {
"x": 0,
"y": 1,
"z": 0,
},
"handle": "2E",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 295.6896229418994,
"startAngle": 19.02318051138638,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 22`] = `
Arc {
"center": Vector3 {
"x": 5734.190885975135,
"y": 81.99061658853293,
"z": 0,
},
"colorNumber": 7,
"endAngle": 2.577865493882651,
"extrusion": Vector3 {
"x": 0,
"y": 1,
"z": 0,
},
"handle": "2F",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 278.9292771505529,
"startAngle": 179.15823740560845,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 23`] = `
Arc {
"center": Vector3 {
"x": 5058.101141116243,
"y": 6177.514250335131,
"z": 0,
},
"colorNumber": 7,
"endAngle": 288.4409367394779,
"extrusion": Vector3 {
"x": 0,
"y": 1,
"z": 0,
},
"handle": "30",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 6399.624650282583,
"startAngle": 280.7273347683135,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 24`] = `
Circle {
"center": Vector3 {
"x": 7533.418387972919,
"y": 52.297688997727974,
"z": 0,
},
"colorNumber": 7,
"extrusion": Vector3 {
"x": 0,
"y": 1,
"z": 0,
},
"handle": "31",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 309.9270199451834,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "CIRCLE",
"visible": undefined,
}
`;
exports[`测试坐标系 25`] = `
Arc {
"center": Vector3 {
"x": -11346.356532853759,
"y": 8663.3752221401,
"z": 0,
},
"colorNumber": 7,
"endAngle": 339.00388038479855,
"extrusion": Vector3 {
"x": 0,
"y": 1,
"z": 0,
},
"handle": "32",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 21732.3973224181,
"startAngle": 334.8258522695763,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 26`] = `
Arc {
"center": Vector3 {
"x": 4718.237530820744,
"y": -373.98872943584104,
"z": 0,
},
"colorNumber": 7,
"endAngle": 169.33321741664236,
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": 1,
},
"handle": "33",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 657.9985770384598,
"startAngle": 51.6595156726647,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;
exports[`测试坐标系 27`] = `
Arc {
"center": Vector3 {
"x": 496778.2368548376,
"y": -490804.22982603795,
"z": 0,
},
"colorNumber": 7,
"endAngle": 135.11459152082898,
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": 1,
},
"handle": "34",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"radius": 694351.7268222995,
"startAngle": 134.885408479171,
"subclassMarker": "AcDbCircle",
"trueColor": undefined,
"type": "ARC",
"visible": undefined,
}
`;

@ -0,0 +1,833 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`任意轴坐标系椭圆 1`] = `
Ellipse {
"center": Vector3 {
"x": 337.7892030848327,
"y": 0,
"z": 558.6118251930241,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": 1.4405998558833164e-14,
"y": 0,
"z": 235.26781058609194,
},
"extrusion": Vector3 {
"x": 0,
"y": -1,
"z": 0,
},
"handle": "1A",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.7670523412708661,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 2`] = `
Ellipse {
"center": Vector3 {
"x": 971.2021372138901,
"y": 9.979027876158327,
"z": 0,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": 275.9734486574838,
"y": 23.17334301704065,
"z": 0,
},
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": 1,
},
"handle": "1B",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.6161522212677439,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 3`] = `
Ellipse {
"center": Vector3 {
"x": 0,
"y": 376.2787636521916,
"z": 553.5769614228184,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": 0,
"y": 2.510042659685116e-14,
"z": -409.9210746204874,
},
"extrusion": Vector3 {
"x": 1,
"y": 0,
"z": 0,
},
"handle": "1C",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.401639344262295,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 4`] = `
Ellipse {
"center": Vector3 {
"x": 0,
"y": -418.67323531214146,
"z": 679.4023475206053,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": 0,
"y": -248.01477883417138,
"z": 0,
},
"extrusion": Vector3 {
"x": -1,
"y": 0,
"z": 0,
},
"handle": "1D",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.7751306897594087,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 5`] = `
Ellipse {
"center": Vector3 {
"x": -722.7831100972741,
"y": 34.28543499417401,
"z": 0,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": -1.5022200263096847e-14,
"y": -245.33114810826905,
"z": 0,
},
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": -1,
},
"handle": "1E",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.5416666666666666,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 6`] = `
Ellipse {
"center": Vector3 {
"x": -919.2452469445237,
"y": 0,
"z": 575.1871269736582,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": -95.85067346221922,
"y": 0,
"z": -95.8506734622192,
},
"extrusion": Vector3 {
"x": 0,
"y": 1,
"z": 0,
},
"handle": "1F",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.49497474683058007,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 7`] = `
Ellipse {
"center": Vector3 {
"x": 2881.606171887065,
"y": 0,
"z": 765.5826058907224,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": 3.540091155142779e-14,
"y": 0,
"z": -578.140759867666,
},
"extrusion": Vector3 {
"x": 0,
"y": -1,
"z": 0,
},
"handle": "20",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.6885245901639341,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 8`] = `
Ellipse {
"center": Vector3 {
"x": 4383.718724957772,
"y": 0,
"z": 844.4497602985355,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": -426.44462463359486,
"y": 0,
"z": -426.44462463345724,
},
"extrusion": Vector3 {
"x": 0,
"y": -1,
"z": 0,
},
"handle": "21",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.7543403674554563,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 9`] = `
Ellipse {
"center": Vector3 {
"x": 6149.580932239946,
"y": 83.56987103451945,
"z": 0,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": 4.1822165799927475e-14,
"y": -683.0077999476371,
"z": 0,
},
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": 1,
},
"handle": "22",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.4659548315532864,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 10`] = `
Ellipse {
"center": Vector3 {
"x": 7216.19585270612,
"y": -66.13046868003096,
"z": 0,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": 645.5827150189998,
"y": -93.56271232159429,
"z": 0,
},
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": 1,
},
"handle": "23",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.32454294289918767,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 11`] = `
Ellipse {
"center": Vector3 {
"x": 8709.485094419037,
"y": 403.402459189384,
"z": 0,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": 422.7808171726939,
"y": -200.26459760807333,
"z": 0,
},
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": 1,
},
"handle": "24",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.5946427498927404,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 12`] = `
Ellipse {
"center": Vector3 {
"x": 0,
"y": 1495.2977034058104,
"z": 726.4288182666232,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": 0,
"y": 2.446907750249149e-14,
"z": -399.6103614450765,
},
"extrusion": Vector3 {
"x": 1,
"y": 0,
"z": 0,
},
"handle": "25",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.5452389638064711,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 13`] = `
Ellipse {
"center": Vector3 {
"x": 0,
"y": 2509.463837080227,
"z": 561.0221982778894,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": 0,
"y": 170.22120265677353,
"z": 170.2212026567464,
},
"extrusion": Vector3 {
"x": 1,
"y": 0,
"z": 0,
},
"handle": "26",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.4240000000000008,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 14`] = `
Ellipse {
"center": Vector3 {
"x": 0,
"y": 3221.3069695705594,
"z": 610.5992739202115,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": 0,
"y": -219.77641229869542,
"z": -36.13773222361086,
},
"extrusion": Vector3 {
"x": 1,
"y": 0,
"z": 0,
},
"handle": "27",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.9015135457999485,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 15`] = `
Ellipse {
"center": Vector3 {
"x": 0,
"y": -2723.1925840252115,
"z": 693.593787999137,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": 0,
"y": -271.1615781729098,
"z": -665.5784191516864,
},
"extrusion": Vector3 {
"x": -1,
"y": 0,
"z": 0,
},
"handle": "28",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.6790997501017327,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 16`] = `
Ellipse {
"center": Vector3 {
"x": 0,
"y": -4510.393894710296,
"z": 1396.1487859925833,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": 0,
"y": -6.792487338297232e-14,
"z": -1109.2973652528103,
},
"extrusion": Vector3 {
"x": -1,
"y": 0,
"z": 0,
},
"handle": "29",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.41290898169026763,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 17`] = `
Ellipse {
"center": Vector3 {
"x": 0,
"y": -6777.627322824062,
"z": 1001.2810781689377,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": 0,
"y": -875.4594949976998,
"z": 875.4594949974189,
},
"extrusion": Vector3 {
"x": -1,
"y": 0,
"z": 0,
},
"handle": "2A",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.5574968834215821,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 18`] = `
Ellipse {
"center": Vector3 {
"x": -9289.971667863443,
"y": 23.107584966108334,
"z": 0,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": -786.4355366765559,
"y": -2801.6765994102425,
"z": 0,
},
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": -1,
},
"handle": "2B",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.4391666339583543,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 19`] = `
Ellipse {
"center": Vector3 {
"x": -17722.52670987782,
"y": -5399.365440418747,
"z": 0,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": -1.7081238850234282e-13,
"y": 2789.578001122757,
"z": 0,
},
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": -1,
},
"handle": "2C",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.6871779960544495,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 20`] = `
Ellipse {
"center": Vector3 {
"x": -23357.383671828775,
"y": -1064.7201708014763,
"z": 0,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": -2085.352128566476,
"y": -3058.516455222906,
"z": 0,
},
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": -1,
},
"handle": "2D",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.3567799889397346,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 21`] = `
Ellipse {
"center": Vector3 {
"x": -32145.254657867412,
"y": 0,
"z": 1725.386311696919,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": -1001.4528225657303,
"y": 0,
"z": -3543.6022952325666,
},
"extrusion": Vector3 {
"x": 0,
"y": 1,
"z": 0,
},
"handle": "2E",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.6212854606633754,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 22`] = `
Ellipse {
"center": Vector3 {
"x": -38539.145755787045,
"y": 0,
"z": 1879.4559767070298,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": -3620.637127737617,
"y": 0,
"z": -1540.696650101115,
},
"extrusion": Vector3 {
"x": 0,
"y": 1,
"z": 0,
},
"handle": "2F",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.3322455740903174,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 23`] = `
Ellipse {
"center": Vector3 {
"x": -48884.69243769194,
"y": 0,
"z": 2324.1640588586815,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": -1833.4332286094595,
"y": 0,
"z": 6906.789198131889,
},
"extrusion": Vector3 {
"x": 0,
"y": 1,
"z": 0,
},
"handle": "30",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.5282270566323839,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 24`] = `
Ellipse {
"center": Vector3 {
"x": 20865.625435287715,
"y": -9648.578071219148,
"z": 0,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": 6109.921296799555,
"y": 0,
"z": 0,
},
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": 1,
},
"handle": "31",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.8301886788654536,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`任意轴坐标系椭圆 25`] = `
Ellipse {
"center": Vector3 {
"x": 33318.935082427575,
"y": -17029.50021392631,
"z": 0,
},
"colorNumber": 7,
"endParameter": 6.283185307179586,
"endPointOfMajorAxis": Vector3 {
"x": 5648.795158756198,
"y": 0,
"z": 0,
},
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": 1,
},
"handle": "32",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.8172028554313208,
"startParameter": 0,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;
exports[`测试椭圆导出 1`] = `
Ellipse {
"center": Vector3 {
"x": 1125.3161763730257,
"y": 534.314974743387,
"z": 0,
},
"colorNumber": 8,
"endParameter": 0.9625506967082142,
"endPointOfMajorAxis": Vector3 {
"x": -17.49999999993635,
"y": 1.6708856520547834e-12,
"z": 0,
},
"extrusion": Vector3 {
"x": 0,
"y": 0,
"z": -1,
},
"handle": "1A",
"layerName": undefined,
"lineType": undefined,
"lineTypeScale": undefined,
"ratioOfMinorAxisToMajorAxis": 0.827936422528518,
"startParameter": 2.1790418545093813,
"subclassMarker": "AcDbEllipse",
"trueColor": undefined,
"type": "ELLIPSE",
"visible": undefined,
}
`;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,14 +1,28 @@
import
{
AngularDimLines, Arc as DxfArc, ArcDimension as DxfArcDimension, Circle as DxfCircle, CommonEntityOptions, DiameterDimension as DxfDiameterDimension, DiameterDimOptions, DimensionOptions, DxfBlock,
DxfWriter, Ellipse as DxfEllipse, FaceOptions, Insert, InsertOptions, InvisibleEdgeFlags, Line as DxfLine, LinearDimension as DxfLinearDimension, LinearDimOptions, LWPolyline, LWPolylineOptions, RadialDimension, RadialDimOptions, Text as DxfText, TextOptions
AngularDimLines,
CommonEntityOptions,
DiameterDimOptions, DimensionOptions,
Arc as DxfArc, ArcDimension as DxfArcDimension,
DxfBlock,
Circle as DxfCircle,
DiameterDimension as DxfDiameterDimension,
Ellipse as DxfEllipse,
Line as DxfLine, LinearDimension as DxfLinearDimension,
Text as DxfText,
DxfWriter,
FaceOptions, Insert, InsertOptions, InvisibleEdgeFlags,
LWPolyline, LWPolylineOptions,
LinearDimOptions,
RadialDimOptions,
RadialDimension,
TextOptions
} from "dxf-write";
import { BufferGeometry, Float32BufferAttribute, Geometry, Matrix4, Vector3 } from "three";
import { MathUtils } from "three/src/math/MathUtils";
import { IsMirror } from "../../csg/core/math/IsMirrot";
import { BufferGeometry, Float32BufferAttribute, Geometry, MathUtils, Matrix4, Vector3 } from "three";
import { ExtrudeHole } from "../../DatabaseServices/3DSolid/ExtrudeHole";
import { RevolveSolid } from "../../DatabaseServices/3DSolid/RevolveSolid";
import { SweepSolid } from "../../DatabaseServices/3DSolid/SweepSolid";
import { DimStyleRecord } from "../../DatabaseServices/DimStyle/DimStyleRecord";
import { LineAngularDimension } from "../../DatabaseServices/Dimension/2LineAngularDimension";
import { AlignedDimension } from "../../DatabaseServices/Dimension/AlignedDimension";
import { ArcDimension } from "../../DatabaseServices/Dimension/ArcDimension";
@ -16,7 +30,6 @@ import { DiameterDimension } from "../../DatabaseServices/Dimension/DiameterDime
import { Dimension } from "../../DatabaseServices/Dimension/Dimension";
import { LinearDimension } from "../../DatabaseServices/Dimension/LinearDimension";
import { RadiusDimension } from "../../DatabaseServices/Dimension/RadiusDimension";
import { DimStyleRecord } from "../../DatabaseServices/DimStyle/DimStyleRecord";
import { Arc } from "../../DatabaseServices/Entity/Arc";
import { Board } from "../../DatabaseServices/Entity/Board";
import { Circle } from "../../DatabaseServices/Entity/Circle";
@ -28,6 +41,7 @@ import { Polyline } from "../../DatabaseServices/Entity/Polyline";
import { Text } from "../../DatabaseServices/Text/Text";
import { angle, polar } from "../../Geometry/GeUtils";
import { Orbit } from "../../Geometry/Orbit";
import { IsMirror } from "../../csg/core/math/IsMirrot";
@ -106,18 +120,23 @@ export function Conver2DxfEntity(e: Entity, dxf: DxfWriter, blkName?: string)
option.extrusion = e.Normal;
let center = e.Center;
//ACAD与我们的实现有点不一样 他们的x必定是长轴,下面代码做一个换算
let mtx = MakeMatrix4FromNormal(e.Normal);//任意轴坐标系
let mtxInv = new Matrix4().getInverse(mtx);
mtx.setPosition(e.Center);
let x = polar(new Vector3(), e.RadY > e.RadX ? e.Rotation + Math.PI / 2 : e.Rotation, e.RadY);
let [radX, radY] = [e.RadX, e.RadY];
if (radY > radX) [radY, radX] = [radX, radY];
let x = polar(new Vector3(), e.RadY > e.RadX ? e.Rotation + Math.PI / 2 : e.Rotation, radX);
x.applyMatrix4(e.OCS.setPosition(0, 0, 0));
let sa = 0;
let ea = Math.PI * 2;
if (!e.IsClose)
{
let nel = new Ellipse(new Vector3, e.RadY, e.RadX, angle(x.clone().applyMatrix4(mtxInv)));
let nel = new Ellipse(new Vector3, radX, radY, angle(x.clone().applyMatrix4(mtxInv)));
nel.ApplyMatrix(mtx);
sa = nel.GetAngleAtParam(nel.GetParamAtPoint(e.StartPoint));
ea = nel.GetAngleAtParam(nel.GetParamAtPoint(e.EndPoint));
@ -126,7 +145,7 @@ export function Conver2DxfEntity(e: Entity, dxf: DxfWriter, blkName?: string)
return new DxfEllipse(
center,
x,
e.RadY > e.RadX ? e.RadX / e.RadY : e.RadY / e.RadX,
radY / radX,
sa, ea,
option
);

Loading…
Cancel
Save