From 7d1fdc785e86eb5ade3fc606def3485589f5e95c Mon Sep 17 00:00:00 2001 From: Frank Staals Date: Sat, 14 Sep 2024 16:58:37 +0200 Subject: [PATCH] some more testscases --- .../Plane/LowerEnvelope/foo_debug_out.ipe | 224 ++++++++++ .../LowerEnvelope/foo_simple1_graph_out.ipe | 413 ++++++++++++++++++ .../LowerEnvelope/foo_simple_graph_out.ipe | 328 ++++++++++++++ .../VoronoiDiagram/foo_debug.ipe | 330 ++++++++++++++ .../VoronoiDiagram/foo_issue.ipe | 331 ++++++++++++++ .../VoronoiDiagram/foo_simple.ipe | 327 ++++++++++++++ .../VoronoiDiagram/foo_simple1.ipe | 329 ++++++++++++++ .../test/Plane/LowerEnvelopeSpec.hs | 20 + 8 files changed, 2302 insertions(+) create mode 100644 hgeometry/data/test-with-ipe/Plane/LowerEnvelope/foo_debug_out.ipe create mode 100644 hgeometry/data/test-with-ipe/Plane/LowerEnvelope/foo_simple1_graph_out.ipe create mode 100644 hgeometry/data/test-with-ipe/Plane/LowerEnvelope/foo_simple_graph_out.ipe create mode 100644 hgeometry/data/test-with-ipe/VoronoiDiagram/foo_debug.ipe create mode 100644 hgeometry/data/test-with-ipe/VoronoiDiagram/foo_issue.ipe create mode 100644 hgeometry/data/test-with-ipe/VoronoiDiagram/foo_simple.ipe create mode 100644 hgeometry/data/test-with-ipe/VoronoiDiagram/foo_simple1.ipe diff --git a/hgeometry/data/test-with-ipe/Plane/LowerEnvelope/foo_debug_out.ipe b/hgeometry/data/test-with-ipe/Plane/LowerEnvelope/foo_debug_out.ipe new file mode 100644 index 000000000..5bbaa9a16 --- /dev/null +++ b/hgeometry/data/test-with-ipe/Plane/LowerEnvelope/foo_debug_out.ipe @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.6 0 0 0.6 0 0 e 0.4 0 0 0.4 0 0 e + + + +0.6 0 0 0.6 0 0 e + + + +0.5 0 0 0.5 0 0 e + +0.6 0 0 0.6 0 0 e 0.4 0 0 0.4 0 0 e + + + +-0.6 -0.6 m 0.6 -0.6 l 0.6 0.6 l -0.6 0.6 l h +-0.4 -0.4 m 0.4 -0.4 l 0.4 0.4 l -0.4 0.4 l h + + +-0.6 -0.6 m 0.6 -0.6 l 0.6 0.6 l -0.6 0.6 l h + + +-0.5 -0.5 m 0.5 -0.5 l 0.5 0.5 l -0.5 0.5 l h + +-0.6 -0.6 m 0.6 -0.6 l 0.6 0.6 l -0.6 0.6 l h +-0.4 -0.4 m 0.4 -0.4 l 0.4 0.4 l -0.4 0.4 l h + + +-0.43 -0.57 m 0.57 0.43 l 0.43 0.57 l -0.57 -0.43 l h + +-0.43 0.57 m 0.57 -0.43 l 0.43 -0.57 l -0.57 0.43 l h + + + +0 0 m -1.0 0.333 l -1.0 -0.333 l h + + +0 0 m -1.0 0.333 l -1.0 -0.333 l h + + +0 0 m -1.0 0.333 l -0.8 0 l -1.0 -0.333 l h + + +0 0 m -1.0 0.333 l -0.8 0 l -1.0 -0.333 l h + + +0 0 m -1.0 0.333 l -1.0 -0.333 l h + + +0 0 m -1.0 0.333 l -0.8 0 l -1.0 -0.333 l h + + +0 0 m -1.0 0.333 l -0.8 0 l -1.0 -0.333 l h + + +-1.0 0.333 m 0 0 l -1.0 -0.333 l + + +0 0 m -1.0 0.333 l -1.0 -0.333 l h +-1 0 m -2.0 0.333 l -2.0 -0.333 l h + + + +0 0 m -1.0 0.333 l -1.0 -0.333 l h +-1 0 m -2.0 0.333 l -2.0 -0.333 l h + + + + + + +1464.975609756097 -2346.439024390244 m +1481.313432835820 290.812603648424 l +481.313432835820 179.701492537313 l +464.975609756097 153.560975609756 l +h +1481.313432835820 290.812603648424 m +1427.534883720930 552.883720930232 l +427.534883720930 302.883720930232 l +425.254901960784 277.803921568627 l +481.313432835820 179.701492537313 l +h +1427.534883720930 552.883720930232 m +1375.292035398230 3120.053097345132 l +375.292035398230 370.053097345132 l +427.534883720930 302.883720930232 l +h +-888.000000000000 -28312.000000000000 m +1464.975609756097 -2346.439024390244 l +464.975609756097 153.560975609756 l +388.075471698113 120.603773584905 l +248.000000000000 -1000.000000000000 l +112.000000000000 -3312.000000000000 l +h +425.254901960784 277.803921568627 m +341.913043478260 211.130434782608 l +325.473684210526 172.771929824561 l +388.075471698113 120.603773584905 l +464.975609756097 153.560975609756 l +481.313432835820 179.701492537313 l +h +375.292035398230 370.053097345132 m +251.389830508474 347.525423728813 l +251.200000000000 347.200000000000 l +341.913043478260 211.130434782608 l +425.254901960784 277.803921568627 l +427.534883720930 302.883720930232 l +h +388.075471698113 120.603773584905 m +325.473684210526 172.771929824561 l +272.500000000000 161.000000000000 l +248.000000000000 112.000000000000 l +248.000000000000 -1000.000000000000 l +h +1375.292035398230 3120.053097345132 m +-748.610169491526 2847.525423728813 l +251.389830508474 347.525423728813 l +375.292035398230 370.053097345132 l +h +251.200000000000 347.200000000000 m +178.181818181818 274.181818181818 l +272.500000000000 161.000000000000 l +325.473684210526 172.771929824561 l +341.913043478260 211.130434782608 l +h +178.181818181818 274.181818181818 m +65.739130434782 250.086956521739 l +112.000000000000 146.000000000000 l +248.000000000000 112.000000000000 l +272.500000000000 161.000000000000 l +h +248.000000000000 -1000.000000000000 m +248.000000000000 112.000000000000 l +112.000000000000 146.000000000000 l +112.000000000000 -3312.000000000000 l +h +-748.610169491526 2847.525423728813 m +-934.260869565218 583.420289855072 l +65.739130434782 250.086956521739 l +178.181818181818 274.181818181818 l +251.200000000000 347.200000000000 l +251.389830508474 347.525423728813 l +h +-934.260869565218 583.420289855072 m +-888.000000000000 -28312.000000000000 l +112.000000000000 -3312.000000000000 l +112.000000000000 146.000000000000 l +65.739130434782 250.086956521739 l +h + \ No newline at end of file diff --git a/hgeometry/data/test-with-ipe/Plane/LowerEnvelope/foo_simple1_graph_out.ipe b/hgeometry/data/test-with-ipe/Plane/LowerEnvelope/foo_simple1_graph_out.ipe new file mode 100644 index 000000000..ab0dc41d3 --- /dev/null +++ b/hgeometry/data/test-with-ipe/Plane/LowerEnvelope/foo_simple1_graph_out.ipe @@ -0,0 +1,413 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.6 0 0 0.6 0 0 e 0.4 0 0 0.4 0 0 e + + + +0.6 0 0 0.6 0 0 e + + + +0.5 0 0 0.5 0 0 e + +0.6 0 0 0.6 0 0 e 0.4 0 0 0.4 0 0 e + + + +-0.6 -0.6 m 0.6 -0.6 l 0.6 0.6 l -0.6 0.6 l h +-0.4 -0.4 m 0.4 -0.4 l 0.4 0.4 l -0.4 0.4 l h + + +-0.6 -0.6 m 0.6 -0.6 l 0.6 0.6 l -0.6 0.6 l h + + +-0.5 -0.5 m 0.5 -0.5 l 0.5 0.5 l -0.5 0.5 l h + +-0.6 -0.6 m 0.6 -0.6 l 0.6 0.6 l -0.6 0.6 l h +-0.4 -0.4 m 0.4 -0.4 l 0.4 0.4 l -0.4 0.4 l h + + +-0.43 -0.57 m 0.57 0.43 l 0.43 0.57 l -0.57 -0.43 l h + +-0.43 0.57 m 0.57 -0.43 l 0.43 -0.57 l -0.57 0.43 l h + + + +0 0 m -1.0 0.333 l -1.0 -0.333 l h + + +0 0 m -1.0 0.333 l -1.0 -0.333 l h + + +0 0 m -1.0 0.333 l -0.8 0 l -1.0 -0.333 l h + + +0 0 m -1.0 0.333 l -0.8 0 l -1.0 -0.333 l h + + +0 0 m -1.0 0.333 l -1.0 -0.333 l h + + +0 0 m -1.0 0.333 l -0.8 0 l -1.0 -0.333 l h + + +0 0 m -1.0 0.333 l -0.8 0 l -1.0 -0.333 l h + + +-1.0 0.333 m 0 0 l -1.0 -0.333 l + + +0 0 m -1.0 0.333 l -1.0 -0.333 l h +-1 0 m -2.0 0.333 l -2.0 -0.333 l h + + + +0 0 m -1.0 0.333 l -1.0 -0.333 l h +-1 0 m -2.0 0.333 l -2.0 -0.333 l h + + + + + + +1484.331210191082 124.596714716728 m +1375.292035398230 3120.053097345132 l +375.292035398230 370.053097345132 l +484.331210191082 229.859872611464 l +h +-888.000000000000 -28312.000000000000 m +1484.331210191082 124.596714716728 l +484.331210191082 229.859872611464 l +395.235955056179 177.887640449438 l +248.000000000000 -1000.000000000000 l +112.000000000000 -3312.000000000000 l +h +375.292035398230 370.053097345132 m +271.917525773195 351.257731958762 l +268.571428571428 321.142857142857 l +362.064516129032 180.903225806451 l +395.235955056179 177.887640449438 l +484.331210191082 229.859872611464 l +h +395.235955056179 177.887640449438 m +362.064516129032 180.903225806451 l +272.500000000000 161.000000000000 l +248.000000000000 112.000000000000 l +248.000000000000 -1000.000000000000 l +h +1375.292035398230 3120.053097345132 m +-758.666666666667 2872.666666666666 l +241.333333333333 372.666666666666 l +271.917525773195 351.257731958762 l +375.292035398230 370.053097345132 l +h +268.571428571428 321.142857142857 m +220.000000000000 224.000000000000 l +272.500000000000 161.000000000000 l +362.064516129032 180.903225806451 l +h +268.571428571428 321.142857142857 m +271.917525773195 351.257731958762 l +241.333333333333 372.666666666666 l +107.555555555555 305.777777777777 l +154.285714285714 224.000000000000 l +220.000000000000 224.000000000000 l +h +272.500000000000 161.000000000000 m +220.000000000000 224.000000000000 l +154.285714285714 224.000000000000 l +111.000000000000 148.250000000000 l +112.000000000000 146.000000000000 l +248.000000000000 112.000000000000 l +h +248.000000000000 -1000.000000000000 m +248.000000000000 112.000000000000 l +112.000000000000 146.000000000000 l +112.000000000000 -3312.000000000000 l +h +-758.666666666667 2872.666666666666 m +-892.444444444445 705.777777777777 l +107.555555555555 305.777777777777 l +241.333333333333 372.666666666666 l +h +-892.444444444445 705.777777777777 m +-889.000000000000 398.250000000000 l +111.000000000000 148.250000000000 l +154.285714285714 224.000000000000 l +107.555555555555 305.777777777777 l +h +-889.000000000000 398.250000000000 m +-888.000000000000 -28312.000000000000 l +112.000000000000 -3312.000000000000 l +112.000000000000 146.000000000000 l +111.000000000000 148.250000000000 l +h +107.555555555555 305.777777777777 m +111.000000000000 148.250000000000 l +107.555555555555 305.777777777777 m +154.285714285714 224.000000000000 l +107.555555555555 305.777777777777 m +268.571428571428 321.142857142857 l +107.555555555555 305.777777777777 m +241.333333333333 372.666666666666 l +111.000000000000 148.250000000000 m +107.555555555555 305.777777777777 l +111.000000000000 148.250000000000 m +112.000000000000 -3312.000000000000 l +111.000000000000 148.250000000000 m +112.000000000000 146.000000000000 l +111.000000000000 148.250000000000 m +272.500000000000 161.000000000000 l +111.000000000000 148.250000000000 m +154.285714285714 224.000000000000 l +112.000000000000 -3312.000000000000 m +112.000000000000 146.000000000000 l +112.000000000000 -3312.000000000000 m +111.000000000000 148.250000000000 l +112.000000000000 -3312.000000000000 m +484.331210191082 229.859872611464 l +112.000000000000 -3312.000000000000 m +248.000000000000 -1000.000000000000 l +112.000000000000 146.000000000000 m +111.000000000000 148.250000000000 l +112.000000000000 146.000000000000 m +112.000000000000 -3312.000000000000 l +112.000000000000 146.000000000000 m +248.000000000000 -1000.000000000000 l +112.000000000000 146.000000000000 m +248.000000000000 112.000000000000 l +112.000000000000 146.000000000000 m +272.500000000000 161.000000000000 l +154.285714285714 224.000000000000 m +107.555555555555 305.777777777777 l +154.285714285714 224.000000000000 m +111.000000000000 148.250000000000 l +154.285714285714 224.000000000000 m +272.500000000000 161.000000000000 l +154.285714285714 224.000000000000 m +220.000000000000 224.000000000000 l +154.285714285714 224.000000000000 m +268.571428571428 321.142857142857 l +220.000000000000 224.000000000000 m +154.285714285714 224.000000000000 l +220.000000000000 224.000000000000 m +272.500000000000 161.000000000000 l +220.000000000000 224.000000000000 m +268.571428571428 321.142857142857 l +241.333333333333 372.666666666666 m +107.555555555555 305.777777777777 l +241.333333333333 372.666666666666 m +268.571428571428 321.142857142857 l +241.333333333333 372.666666666666 m +271.917525773195 351.257731958762 l +241.333333333333 372.666666666666 m +375.292035398230 370.053097345132 l +248.000000000000 -1000.000000000000 m +248.000000000000 112.000000000000 l +248.000000000000 -1000.000000000000 m +112.000000000000 146.000000000000 l +248.000000000000 -1000.000000000000 m +112.000000000000 -3312.000000000000 l +248.000000000000 -1000.000000000000 m +484.331210191082 229.859872611464 l +248.000000000000 -1000.000000000000 m +395.235955056179 177.887640449438 l +248.000000000000 112.000000000000 m +112.000000000000 146.000000000000 l +248.000000000000 112.000000000000 m +248.000000000000 -1000.000000000000 l +248.000000000000 112.000000000000 m +395.235955056179 177.887640449438 l +248.000000000000 112.000000000000 m +272.500000000000 161.000000000000 l +268.571428571428 321.142857142857 m +241.333333333333 372.666666666666 l +268.571428571428 321.142857142857 m +107.555555555555 305.777777777777 l +268.571428571428 321.142857142857 m +154.285714285714 224.000000000000 l +268.571428571428 321.142857142857 m +220.000000000000 224.000000000000 l +268.571428571428 321.142857142857 m +272.500000000000 161.000000000000 l +268.571428571428 321.142857142857 m +362.064516129032 180.903225806451 l +268.571428571428 321.142857142857 m +375.292035398230 370.053097345132 l +268.571428571428 321.142857142857 m +271.917525773195 351.257731958762 l +271.917525773195 351.257731958762 m +241.333333333333 372.666666666666 l +271.917525773195 351.257731958762 m +268.571428571428 321.142857142857 l +271.917525773195 351.257731958762 m +375.292035398230 370.053097345132 l +272.500000000000 161.000000000000 m +268.571428571428 321.142857142857 l +272.500000000000 161.000000000000 m +220.000000000000 224.000000000000 l +272.500000000000 161.000000000000 m +154.285714285714 224.000000000000 l +272.500000000000 161.000000000000 m +111.000000000000 148.250000000000 l +272.500000000000 161.000000000000 m +112.000000000000 146.000000000000 l +272.500000000000 161.000000000000 m +248.000000000000 112.000000000000 l +272.500000000000 161.000000000000 m +395.235955056179 177.887640449438 l +272.500000000000 161.000000000000 m +362.064516129032 180.903225806451 l +362.064516129032 180.903225806451 m +268.571428571428 321.142857142857 l +362.064516129032 180.903225806451 m +272.500000000000 161.000000000000 l +362.064516129032 180.903225806451 m +395.235955056179 177.887640449438 l +362.064516129032 180.903225806451 m +375.292035398230 370.053097345132 l +375.292035398230 370.053097345132 m +241.333333333333 372.666666666666 l +375.292035398230 370.053097345132 m +271.917525773195 351.257731958762 l +375.292035398230 370.053097345132 m +268.571428571428 321.142857142857 l +375.292035398230 370.053097345132 m +362.064516129032 180.903225806451 l +375.292035398230 370.053097345132 m +395.235955056179 177.887640449438 l +375.292035398230 370.053097345132 m +484.331210191082 229.859872611464 l +395.235955056179 177.887640449438 m +375.292035398230 370.053097345132 l +395.235955056179 177.887640449438 m +362.064516129032 180.903225806451 l +395.235955056179 177.887640449438 m +272.500000000000 161.000000000000 l +395.235955056179 177.887640449438 m +248.000000000000 112.000000000000 l +395.235955056179 177.887640449438 m +248.000000000000 -1000.000000000000 l +395.235955056179 177.887640449438 m +484.331210191082 229.859872611464 l +484.331210191082 229.859872611464 m +375.292035398230 370.053097345132 l +484.331210191082 229.859872611464 m +395.235955056179 177.887640449438 l +484.331210191082 229.859872611464 m +248.000000000000 -1000.000000000000 l +484.331210191082 229.859872611464 m +112.000000000000 -3312.000000000000 l +107.555555555555 305.777777777777 m +111.000000000000 148.250000000000 l +107.555555555555 305.777777777777 m +154.285714285714 224.000000000000 l +107.555555555555 305.777777777777 m +241.333333333333 372.666666666666 l +107.555555555555 305.777777777777 m +268.571428571428 321.142857142857 l +111.000000000000 148.250000000000 m +112.000000000000 -3312.000000000000 l +111.000000000000 148.250000000000 m +112.000000000000 146.000000000000 l +112.000000000000 146.000000000000 m +248.000000000000 -1000.000000000000 l +220.000000000000 224.000000000000 m +268.571428571428 321.142857142857 l +241.333333333333 372.666666666666 m +271.917525773195 351.257731958762 l +241.333333333333 372.666666666666 m +375.292035398230 370.053097345132 l +248.000000000000 112.000000000000 m +272.500000000000 161.000000000000 l +268.571428571428 321.142857142857 m +272.500000000000 161.000000000000 l +268.571428571428 321.142857142857 m +362.064516129032 180.903225806451 l +375.292035398230 370.053097345132 m +395.235955056179 177.887640449438 l +375.292035398230 370.053097345132 m +484.331210191082 229.859872611464 l +107.555555555555 305.777777777777 m +154.285714285714 224.000000000000 l +107.555555555555 305.777777777777 m +111.000000000000 148.250000000000 l +107.555555555555 305.777777777777 m +268.571428571428 321.142857142857 l +272.500000000000 161.000000000000 l +107.555555555555 305.777777777777 m +111.000000000000 148.250000000000 l + \ No newline at end of file diff --git a/hgeometry/data/test-with-ipe/Plane/LowerEnvelope/foo_simple_graph_out.ipe b/hgeometry/data/test-with-ipe/Plane/LowerEnvelope/foo_simple_graph_out.ipe new file mode 100644 index 000000000..c41a275cc --- /dev/null +++ b/hgeometry/data/test-with-ipe/Plane/LowerEnvelope/foo_simple_graph_out.ipe @@ -0,0 +1,328 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.6 0 0 0.6 0 0 e 0.4 0 0 0.4 0 0 e + + + +0.6 0 0 0.6 0 0 e + + + +0.5 0 0 0.5 0 0 e + +0.6 0 0 0.6 0 0 e 0.4 0 0 0.4 0 0 e + + + +-0.6 -0.6 m 0.6 -0.6 l 0.6 0.6 l -0.6 0.6 l h +-0.4 -0.4 m 0.4 -0.4 l 0.4 0.4 l -0.4 0.4 l h + + +-0.6 -0.6 m 0.6 -0.6 l 0.6 0.6 l -0.6 0.6 l h + + +-0.5 -0.5 m 0.5 -0.5 l 0.5 0.5 l -0.5 0.5 l h + +-0.6 -0.6 m 0.6 -0.6 l 0.6 0.6 l -0.6 0.6 l h +-0.4 -0.4 m 0.4 -0.4 l 0.4 0.4 l -0.4 0.4 l h + + +-0.43 -0.57 m 0.57 0.43 l 0.43 0.57 l -0.57 -0.43 l h + +-0.43 0.57 m 0.57 -0.43 l 0.43 -0.57 l -0.57 0.43 l h + + + +0 0 m -1.0 0.333 l -1.0 -0.333 l h + + +0 0 m -1.0 0.333 l -1.0 -0.333 l h + + +0 0 m -1.0 0.333 l -0.8 0 l -1.0 -0.333 l h + + +0 0 m -1.0 0.333 l -0.8 0 l -1.0 -0.333 l h + + +0 0 m -1.0 0.333 l -1.0 -0.333 l h + + +0 0 m -1.0 0.333 l -0.8 0 l -1.0 -0.333 l h + + +0 0 m -1.0 0.333 l -0.8 0 l -1.0 -0.333 l h + + +-1.0 0.333 m 0 0 l -1.0 -0.333 l + + +0 0 m -1.0 0.333 l -1.0 -0.333 l h +-1 0 m -2.0 0.333 l -2.0 -0.333 l h + + + +0 0 m -1.0 0.333 l -1.0 -0.333 l h +-1 0 m -2.0 0.333 l -2.0 -0.333 l h + + + + + + +1325.473684210526 -660.561403508772 m +1589.176470588235 783.941176470588 l +589.176470588235 408.941176470588 l +341.913043478260 211.130434782608 l +325.473684210526 172.771929824561 l +h +589.176470588235 408.941176470588 m +271.917525773195 351.257731958762 l +268.571428571428 321.142857142857 l +341.913043478260 211.130434782608 l +h +248.000000000000 -844.444444444445 m +1325.473684210526 -660.561403508772 l +325.473684210526 172.771929824561 l +248.000000000000 155.555555555555 l +h +1589.176470588235 783.941176470588 m +-758.666666666667 2872.666666666666 l +241.333333333333 372.666666666666 l +271.917525773195 351.257731958762 l +589.176470588235 408.941176470588 l +h +341.913043478260 211.130434782608 m +268.571428571428 321.142857142857 l +203.200000000000 190.400000000000 l +248.000000000000 155.555555555555 l +325.473684210526 172.771929824561 l +h +268.571428571428 321.142857142857 m +271.917525773195 351.257731958762 l +241.333333333333 372.666666666666 l +107.555555555555 305.777777777777 l +172.000000000000 193.000000000000 l +203.200000000000 190.400000000000 l +h +112.000000000000 -852.000000000000 m +248.000000000000 -844.444444444445 l +248.000000000000 155.555555555555 l +203.200000000000 190.400000000000 l +172.000000000000 193.000000000000 l +112.000000000000 148.000000000000 l +h +-758.666666666667 2872.666666666666 m +-892.444444444445 705.777777777777 l +107.555555555555 305.777777777777 l +241.333333333333 372.666666666666 l +h +-892.444444444445 705.777777777777 m +-888.000000000000 398.000000000000 l +112.000000000000 148.000000000000 l +172.000000000000 193.000000000000 l +107.555555555555 305.777777777777 l +h +-888.000000000000 398.000000000000 m +112.000000000000 -852.000000000000 l +112.000000000000 148.000000000000 l +h +107.555555555555 305.777777777777 m +112.000000000000 148.000000000000 l +107.555555555555 305.777777777777 m +172.000000000000 193.000000000000 l +107.555555555555 305.777777777777 m +268.571428571428 321.142857142857 l +107.555555555555 305.777777777777 m +241.333333333333 372.666666666666 l +112.000000000000 148.000000000000 m +107.555555555555 305.777777777777 l +112.000000000000 148.000000000000 m +248.000000000000 155.555555555555 l +112.000000000000 148.000000000000 m +172.000000000000 193.000000000000 l +172.000000000000 193.000000000000 m +107.555555555555 305.777777777777 l +172.000000000000 193.000000000000 m +112.000000000000 148.000000000000 l +172.000000000000 193.000000000000 m +248.000000000000 155.555555555555 l +172.000000000000 193.000000000000 m +203.200000000000 190.400000000000 l +172.000000000000 193.000000000000 m +268.571428571428 321.142857142857 l +203.200000000000 190.400000000000 m +172.000000000000 193.000000000000 l +203.200000000000 190.400000000000 m +248.000000000000 155.555555555555 l +203.200000000000 190.400000000000 m +341.913043478260 211.130434782608 l +203.200000000000 190.400000000000 m +268.571428571428 321.142857142857 l +241.333333333333 372.666666666666 m +107.555555555555 305.777777777777 l +241.333333333333 372.666666666666 m +268.571428571428 321.142857142857 l +241.333333333333 372.666666666666 m +271.917525773195 351.257731958762 l +241.333333333333 372.666666666666 m +589.176470588235 408.941176470588 l +248.000000000000 155.555555555555 m +203.200000000000 190.400000000000 l +248.000000000000 155.555555555555 m +172.000000000000 193.000000000000 l +248.000000000000 155.555555555555 m +112.000000000000 148.000000000000 l +248.000000000000 155.555555555555 m +325.473684210526 172.771929824561 l +248.000000000000 155.555555555555 m +341.913043478260 211.130434782608 l +268.571428571428 321.142857142857 m +241.333333333333 372.666666666666 l +268.571428571428 321.142857142857 m +107.555555555555 305.777777777777 l +268.571428571428 321.142857142857 m +172.000000000000 193.000000000000 l +268.571428571428 321.142857142857 m +203.200000000000 190.400000000000 l +268.571428571428 321.142857142857 m +341.913043478260 211.130434782608 l +268.571428571428 321.142857142857 m +589.176470588235 408.941176470588 l +268.571428571428 321.142857142857 m +271.917525773195 351.257731958762 l +271.917525773195 351.257731958762 m +241.333333333333 372.666666666666 l +271.917525773195 351.257731958762 m +268.571428571428 321.142857142857 l +271.917525773195 351.257731958762 m +589.176470588235 408.941176470588 l +325.473684210526 172.771929824561 m +248.000000000000 155.555555555555 l +325.473684210526 172.771929824561 m +589.176470588235 408.941176470588 l +325.473684210526 172.771929824561 m +341.913043478260 211.130434782608 l +341.913043478260 211.130434782608 m +268.571428571428 321.142857142857 l +341.913043478260 211.130434782608 m +203.200000000000 190.400000000000 l +341.913043478260 211.130434782608 m +248.000000000000 155.555555555555 l +341.913043478260 211.130434782608 m +325.473684210526 172.771929824561 l +341.913043478260 211.130434782608 m +589.176470588235 408.941176470588 l +589.176470588235 408.941176470588 m +241.333333333333 372.666666666666 l +589.176470588235 408.941176470588 m +271.917525773195 351.257731958762 l +589.176470588235 408.941176470588 m +268.571428571428 321.142857142857 l +589.176470588235 408.941176470588 m +341.913043478260 211.130434782608 l +589.176470588235 408.941176470588 m +325.473684210526 172.771929824561 l +107.555555555555 305.777777777777 m +112.000000000000 148.000000000000 l +107.555555555555 305.777777777777 m +172.000000000000 193.000000000000 l +107.555555555555 305.777777777777 m +241.333333333333 372.666666666666 l +107.555555555555 305.777777777777 m +268.571428571428 321.142857142857 l +172.000000000000 193.000000000000 m +248.000000000000 155.555555555555 l +203.200000000000 190.400000000000 m +268.571428571428 321.142857142857 l +241.333333333333 372.666666666666 m +271.917525773195 351.257731958762 l +241.333333333333 372.666666666666 m +589.176470588235 408.941176470588 l +268.571428571428 321.142857142857 m +341.913043478260 211.130434782608 l +325.473684210526 172.771929824561 m +589.176470588235 408.941176470588 l +107.555555555555 305.777777777777 m +172.000000000000 193.000000000000 l +107.555555555555 305.777777777777 m +112.000000000000 148.000000000000 l +107.555555555555 305.777777777777 m +172.000000000000 193.000000000000 l +248.000000000000 155.555555555555 l +107.555555555555 305.777777777777 m +112.000000000000 148.000000000000 l + \ No newline at end of file diff --git a/hgeometry/data/test-with-ipe/VoronoiDiagram/foo_debug.ipe b/hgeometry/data/test-with-ipe/VoronoiDiagram/foo_debug.ipe new file mode 100644 index 000000000..78c668cea --- /dev/null +++ b/hgeometry/data/test-with-ipe/VoronoiDiagram/foo_debug.ipe @@ -0,0 +1,330 @@ + + + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + +0.6 0 0 0.6 0 0 e + + + + + +0.5 0 0 0.5 0 0 e + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h + + + + + +-0.5 -0.5 m +0.5 -0.5 l +0.5 0.5 l +-0.5 0.5 l +h + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + + + +-0.43 -0.57 m +0.57 0.43 l +0.43 0.57 l +-0.57 -0.43 l +h + + +-0.43 0.57 m +0.57 -0.43 l +0.43 -0.57 l +-0.57 0.43 l +h + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +-1 0.333 m +0 0 l +-1 -0.333 l + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.3 0 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.3 0 l +-0.5 -0.333 l +h + + + + +1 0 m +0 0.333 l +0 -0.333 l +h +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +1 0 m +0 0.333 l +0 -0.333 l +h +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hgeometry/data/test-with-ipe/VoronoiDiagram/foo_issue.ipe b/hgeometry/data/test-with-ipe/VoronoiDiagram/foo_issue.ipe new file mode 100644 index 000000000..0c3743b7c --- /dev/null +++ b/hgeometry/data/test-with-ipe/VoronoiDiagram/foo_issue.ipe @@ -0,0 +1,331 @@ + + + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + +0.6 0 0 0.6 0 0 e + + + + + +0.5 0 0 0.5 0 0 e + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h + + + + + +-0.5 -0.5 m +0.5 -0.5 l +0.5 0.5 l +-0.5 0.5 l +h + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + + + +-0.43 -0.57 m +0.57 0.43 l +0.43 0.57 l +-0.57 -0.43 l +h + + +-0.43 0.57 m +0.57 -0.43 l +0.43 -0.57 l +-0.57 0.43 l +h + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +-1 0.333 m +0 0 l +-1 -0.333 l + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.3 0 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.3 0 l +-0.5 -0.333 l +h + + + + +1 0 m +0 0.333 l +0 -0.333 l +h +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +1 0 m +0 0.333 l +0 -0.333 l +h +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hgeometry/data/test-with-ipe/VoronoiDiagram/foo_simple.ipe b/hgeometry/data/test-with-ipe/VoronoiDiagram/foo_simple.ipe new file mode 100644 index 000000000..c0d582fcd --- /dev/null +++ b/hgeometry/data/test-with-ipe/VoronoiDiagram/foo_simple.ipe @@ -0,0 +1,327 @@ + + + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + +0.6 0 0 0.6 0 0 e + + + + + +0.5 0 0 0.5 0 0 e + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h + + + + + +-0.5 -0.5 m +0.5 -0.5 l +0.5 0.5 l +-0.5 0.5 l +h + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + + + +-0.43 -0.57 m +0.57 0.43 l +0.43 0.57 l +-0.57 -0.43 l +h + + +-0.43 0.57 m +0.57 -0.43 l +0.43 -0.57 l +-0.57 0.43 l +h + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +-1 0.333 m +0 0 l +-1 -0.333 l + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.3 0 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.3 0 l +-0.5 -0.333 l +h + + + + +1 0 m +0 0.333 l +0 -0.333 l +h +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +1 0 m +0 0.333 l +0 -0.333 l +h +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hgeometry/data/test-with-ipe/VoronoiDiagram/foo_simple1.ipe b/hgeometry/data/test-with-ipe/VoronoiDiagram/foo_simple1.ipe new file mode 100644 index 000000000..f14d82fe4 --- /dev/null +++ b/hgeometry/data/test-with-ipe/VoronoiDiagram/foo_simple1.ipe @@ -0,0 +1,329 @@ + + + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + +0.6 0 0 0.6 0 0 e + + + + + +0.5 0 0 0.5 0 0 e + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h + + + + + +-0.5 -0.5 m +0.5 -0.5 l +0.5 0.5 l +-0.5 0.5 l +h + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + + + +-0.43 -0.57 m +0.57 0.43 l +0.43 0.57 l +-0.57 -0.43 l +h + + +-0.43 0.57 m +0.57 -0.43 l +0.43 -0.57 l +-0.57 0.43 l +h + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +-1 0.333 m +0 0 l +-1 -0.333 l + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.3 0 l +-0.5 -0.333 l +h + + + + +0.5 0 m +-0.5 0.333 l +-0.3 0 l +-0.5 -0.333 l +h + + + + +1 0 m +0 0.333 l +0 -0.333 l +h +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +1 0 m +0 0.333 l +0 -0.333 l +h +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hgeometry/test-with-ipe/test/Plane/LowerEnvelopeSpec.hs b/hgeometry/test-with-ipe/test/Plane/LowerEnvelopeSpec.hs index ce6f3ab8c..7dd1dbd00 100644 --- a/hgeometry/test-with-ipe/test/Plane/LowerEnvelopeSpec.hs +++ b/hgeometry/test-with-ipe/test/Plane/LowerEnvelopeSpec.hs @@ -444,6 +444,8 @@ testIpeGraph inFp outFp = do (addStyleSheet opacitiesStyle $ singlePageFromContent out) + + separatorTests :: NonEmpty (Point 2 R :+ _) -> Spec separatorTests points = describe "separatorTests" $ do let vd = voronoiDiagram' $ view core <$> points @@ -503,6 +505,24 @@ separatorTests points = describe "separatorTests" $ do +-- FIXME: write some proper shrinker; since apparently we may return something that is +-- not a separator + +-- separatorIsSeparatorTest = prop "separator is a separator" $ +-- \(MyGraph gr) -> separatorIsSeparator gr + + +separatorIsSeparator gr = null crossingEdges + where + (Separator sep as bs) = Set.fromList <$> planarSeparator gr + crossingEdges = [ e + | e@(u,v) <- toList (graphEdges gr) + , (u `Set.member` as && v `Set.member` bs) + || (u `Set.member` bs && v `Set.member` as) + ] + + + shouldBeAtMost :: (Ord a, Show a, HasCallStack) => a -> a -> Expectation shouldBeAtMost x y = shouldSatisfy x (<= y)