diff --git a/__test__/Geometry/__snapshots__/lir.test.ts.snap b/__test__/Geometry/__snapshots__/lir.test.ts.snap index 75f979646..9042c906a 100644 --- a/__test__/Geometry/__snapshots__/lir.test.ts.snap +++ b/__test__/Geometry/__snapshots__/lir.test.ts.snap @@ -214,3 +214,48 @@ Array [ }, ] `; + +exports[`宽度优先的情况下 不再适合动态规划的内容 2`] = ` +Array [ + Box2 { + "max": Vector2 { + "x": 1220, + "y": 1084.2889, + }, + "min": Vector2 { + "x": 0, + "y": 668.6566, + }, + }, + Box2 { + "max": Vector2 { + "x": 354.1641, + "y": 575.6342000000001, + }, + "min": Vector2 { + "x": 0, + "y": 438.7912, + }, + }, + Box2 { + "max": Vector2 { + "x": 262.7173, + "y": 332.111, + }, + "min": Vector2 { + "x": 0, + "y": 167.1686, + }, + }, + Box2 { + "max": Vector2 { + "x": 1220, + "y": 646.8867, + }, + "min": Vector2 { + "x": 1004.6024000000001, + "y": 444.4506, + }, + }, +] +`; diff --git a/__test__/Geometry/lir.test.ts b/__test__/Geometry/lir.test.ts index 6a12f86fa..5db9a88fe 100644 --- a/__test__/Geometry/lir.test.ts +++ b/__test__/Geometry/lir.test.ts @@ -36,11 +36,19 @@ test('宽度优先的情况下 不再适合动态规划的内容', () => if (equalv3(pts[0], pts[pts.length - 1])) pts.pop(); - let lir = new LargestInteriorRectangle; - lir.GetMaxRectIndexFn = LargestInteriorRectangle.GetMaxWidthFn; - - let rects = lir.ParseLIR(pts.map(AsVector2)); - - expect(rects).toMatchSnapshot(); + { + + let lir = new LargestInteriorRectangle; + lir.GetMaxRectIndexFn = LargestInteriorRectangle.GetMaxWidthFn; + let rects = lir.ParseLIR(pts.map(AsVector2)); + expect(rects).toMatchSnapshot(); + } + + { + let lir = new LargestInteriorRectangle; + lir.GetMaxRectIndexFn = LargestInteriorRectangle.GetMaxHeightFn; + let rects = lir.ParseLIR(pts.map(AsVector2)); + expect(rects).toMatchSnapshot(); + } } }); diff --git a/__test__/Polyline/__snapshots__/offset_tool_sq.test.ts.snap b/__test__/Polyline/__snapshots__/offset_tool_sq.test.ts.snap new file mode 100644 index 000000000..4069acff6 --- /dev/null +++ b/__test__/Polyline/__snapshots__/offset_tool_sq.test.ts.snap @@ -0,0 +1,5 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`走刀 补直线 1`] = `1`; + +exports[`走刀 补直线 2`] = `"3972.21363"`;