1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 22:28:16 +01:00
dotSCAD/test/test_polysections.scad
2019-06-11 13:49:31 +08:00

90 lines
32 KiB
OpenSCAD

include <unittest.scad>;
include <rotate_p.scad>;
module test_polysections_solid_sections() {
echo("==== test_polysections_solid_sections ====");
include <polysections.scad>;
section1 = [
[20, 0, 0],
[18, 9, 0],
[15, 10, 0],
[10, 0, 0]
];
// spin section1
sections = [
for(i = [0:55])
[
for(p = section1)
let(pt = rotate_p(p, [90, 0, 10 * i]))
[pt[0], pt[1] , pt[2] + i]
]
];
module test_polysections_solid(points, faces) {
expected_pts = [
for(sect = sections)
for(pt = sect)
pt
];
expected_faces = [[3, 2, 1, 0], [0, 1, 5], [1, 2, 6], [2, 3, 7], [3, 0, 4], [4, 5, 9], [5, 6, 10], [6, 7, 11], [7, 4, 8], [8, 9, 13], [9, 10, 14], [10, 11, 15], [11, 8, 12], [12, 13, 17], [13, 14, 18], [14, 15, 19], [15, 12, 16], [16, 17, 21], [17, 18, 22], [18, 19, 23], [19, 16, 20], [20, 21, 25], [21, 22, 26], [22, 23, 27], [23, 20, 24], [24, 25, 29], [25, 26, 30], [26, 27, 31], [27, 24, 28], [28, 29, 33], [29, 30, 34], [30, 31, 35], [31, 28, 32], [32, 33, 37], [33, 34, 38], [34, 35, 39], [35, 32, 36], [36, 37, 41], [37, 38, 42], [38, 39, 43], [39, 36, 40], [40, 41, 45], [41, 42, 46], [42, 43, 47], [43, 40, 44], [44, 45, 49], [45, 46, 50], [46, 47, 51], [47, 44, 48], [48, 49, 53], [49, 50, 54], [50, 51, 55], [51, 48, 52], [52, 53, 57], [53, 54, 58], [54, 55, 59], [55, 52, 56], [56, 57, 61], [57, 58, 62], [58, 59, 63], [59, 56, 60], [60, 61, 65], [61, 62, 66], [62, 63, 67], [63, 60, 64], [64, 65, 69], [65, 66, 70], [66, 67, 71], [67, 64, 68], [68, 69, 73], [69, 70, 74], [70, 71, 75], [71, 68, 72], [72, 73, 77], [73, 74, 78], [74, 75, 79], [75, 72, 76], [76, 77, 81], [77, 78, 82], [78, 79, 83], [79, 76, 80], [80, 81, 85], [81, 82, 86], [82, 83, 87], [83, 80, 84], [84, 85, 89], [85, 86, 90], [86, 87, 91], [87, 84, 88], [88, 89, 93], [89, 90, 94], [90, 91, 95], [91, 88, 92], [92, 93, 97], [93, 94, 98], [94, 95, 99], [95, 92, 96], [96, 97, 101], [97, 98, 102], [98, 99, 103], [99, 96, 100], [100, 101, 105], [101, 102, 106], [102, 103, 107], [103, 100, 104], [104, 105, 109], [105, 106, 110], [106, 107, 111], [107, 104, 108], [108, 109, 113], [109, 110, 114], [110, 111, 115], [111, 108, 112], [112, 113, 117], [113, 114, 118], [114, 115, 119], [115, 112, 116], [116, 117, 121], [117, 118, 122], [118, 119, 123], [119, 116, 120], [120, 121, 125], [121, 122, 126], [122, 123, 127], [123, 120, 124], [124, 125, 129], [125, 126, 130], [126, 127, 131], [127, 124, 128], [128, 129, 133], [129, 130, 134], [130, 131, 135], [131, 128, 132], [132, 133, 137], [133, 134, 138], [134, 135, 139], [135, 132, 136], [136, 137, 141], [137, 138, 142], [138, 139, 143], [139, 136, 140], [140, 141, 145], [141, 142, 146], [142, 143, 147], [143, 140, 144], [144, 145, 149], [145, 146, 150], [146, 147, 151], [147, 144, 148], [148, 149, 153], [149, 150, 154], [150, 151, 155], [151, 148, 152], [152, 153, 157], [153, 154, 158], [154, 155, 159], [155, 152, 156], [156, 157, 161], [157, 158, 162], [158, 159, 163], [159, 156, 160], [160, 161, 165], [161, 162, 166], [162, 163, 167], [163, 160, 164], [164, 165, 169], [165, 166, 170], [166, 167, 171], [167, 164, 168], [168, 169, 173], [169, 170, 174], [170, 171, 175], [171, 168, 172], [172, 173, 177], [173, 174, 178], [174, 175, 179], [175, 172, 176], [176, 177, 181], [177, 178, 182], [178, 179, 183], [179, 176, 180], [180, 181, 185], [181, 182, 186], [182, 183, 187], [183, 180, 184], [184, 185, 189], [185, 186, 190], [186, 187, 191], [187, 184, 188], [188, 189, 193], [189, 190, 194], [190, 191, 195], [191, 188, 192], [192, 193, 197], [193, 194, 198], [194, 195, 199], [195, 192, 196], [196, 197, 201], [197, 198, 202], [198, 199, 203], [199, 196, 200], [200, 201, 205], [201, 202, 206], [202, 203, 207], [203, 200, 204], [204, 205, 209], [205, 206, 210], [206, 207, 211], [207, 204, 208], [208, 209, 213], [209, 210, 214], [210, 211, 215], [211, 208, 212], [212, 213, 217], [213, 214, 218], [214, 215, 219], [215, 212, 216], [216, 217, 221], [217, 218, 222], [218, 219, 223], [219, 216, 220], [0, 5, 4], [1, 6, 5], [2, 7, 6], [3, 4, 7], [4, 9, 8], [5, 10, 9], [6, 11, 10], [7, 8, 11], [8, 13, 12], [9, 14, 13], [10, 15, 14], [11, 12, 15], [12, 17, 16], [13, 18, 17], [14, 19, 18], [15, 16, 19], [16, 21, 20], [17, 22, 21], [18, 23, 22], [19, 20, 23], [20, 25, 24], [21, 26, 25], [22, 27, 26], [23, 24, 27], [24, 29, 28], [25, 30, 29], [26, 31, 30], [27, 28, 31], [28, 33, 32], [29, 34, 33], [30, 35, 34], [31, 32, 35], [32, 37, 36], [33, 38, 37], [34, 39, 38], [35, 36, 39], [36, 41, 40], [37, 42, 41], [38, 43, 42], [39, 40, 43], [40, 45, 44], [41, 46, 45], [42, 47, 46], [43, 44, 47], [44, 49, 48], [45, 50, 49], [46, 51, 50], [47, 48, 51], [48, 53, 52], [49, 54, 53], [50, 55, 54], [51, 52, 55], [52, 57, 56], [53, 58, 57], [54, 59, 58], [55, 56, 59], [56, 61, 60], [57, 62, 61], [58, 63, 62], [59, 60, 63], [60, 65, 64], [61, 66, 65], [62, 67, 66], [63, 64, 67], [64, 69, 68], [65, 70, 69], [66, 71, 70], [67, 68, 71], [68, 73, 72], [69, 74, 73], [70, 75, 74], [71, 72, 75], [72, 77, 76], [73, 78, 77], [74, 79, 78], [75, 76, 79], [76, 81, 80], [77, 82, 81], [78, 83, 82], [79, 80, 83], [80, 85, 84], [81, 86, 85], [82, 87, 86], [83, 84, 87], [84, 89, 88], [85, 90, 89], [86, 91, 90], [87, 88, 91], [88, 93, 92], [89, 94, 93], [90, 95, 94], [91, 92, 95], [92, 97, 96], [93, 98, 97], [94, 99, 98], [95, 96, 99], [96, 101, 100], [97, 102, 101], [98, 103, 102], [99, 100, 103], [100, 105, 104], [101, 106, 105], [102, 107, 106], [103, 104, 107], [104, 109, 108], [105, 110, 109], [106, 111, 110], [107, 108, 111], [108, 113, 112], [109, 114, 113], [110, 115, 114], [111, 112, 115], [112, 117, 116], [113, 118, 117], [114, 119, 118], [115, 116, 119], [116, 121, 120], [117, 122, 121], [118, 123, 122], [119, 120, 123], [120, 125, 124], [121, 126, 125], [122, 127, 126], [123, 124, 127], [124, 129, 128], [125, 130, 129], [126, 131, 130], [127, 128, 131], [128, 133, 132], [129, 134, 133], [130, 135, 134], [131, 132, 135], [132, 137, 136], [133, 138, 137], [134, 139, 138], [135, 136, 139], [136, 141, 140], [137, 142, 141], [138, 143, 142], [139, 140, 143], [140, 145, 144], [141, 146, 145], [142, 147, 146], [143, 144, 147], [144, 149, 148], [145, 150, 149], [146, 151, 150], [147, 148, 151], [148, 153, 152], [149, 154, 153], [150, 155, 154], [151, 152, 155], [152, 157, 156], [153, 158, 157], [154, 159, 158], [155, 156, 159], [156, 161, 160], [157, 162, 161], [158, 163, 162], [159, 160, 163], [160, 165, 164], [161, 166, 165], [162, 167, 166], [163, 164, 167], [164, 169, 168], [165, 170, 169], [166, 171, 170], [167, 168, 171], [168, 173, 172], [169, 174, 173], [170, 175, 174], [171, 172, 175], [172, 177, 176], [173, 178, 177], [174, 179, 178], [175, 176, 179], [176, 181, 180], [177, 182, 181], [178, 183, 182], [179, 180, 183], [180, 185, 184], [181, 186, 185], [182, 187, 186], [183, 184, 187], [184, 189, 188], [185, 190, 189], [186, 191, 190], [187, 188, 191], [188, 193, 192], [189, 194, 193], [190, 195, 194], [191, 192, 195], [192, 197, 196], [193, 198, 197], [194, 199, 198], [195, 196, 199], [196, 201, 200], [197, 202, 201], [198, 203, 202], [199, 200, 203], [200, 205, 204], [201, 206, 205], [202, 207, 206], [203, 204, 207], [204, 209, 208], [205, 210, 209], [206, 211, 210], [207, 208, 211], [208, 213, 212], [209, 214, 213], [210, 215, 214], [211, 212, 215], [212, 217, 216], [213, 218, 217], [214, 219, 218], [215, 216, 219], [216, 221, 220], [217, 222, 221], [218, 223, 222], [219, 220, 223], [220, 221, 222, 223]];
assertEqualPoints(expected_pts, points);
for(i = [0:len(expected_faces) - 1]) {
assert(expected_faces[i] == faces[i]);
}
}
polysections(sections);
}
module test_polysections_hollow_sections() {
echo("==== test_polysections_hollow_sections ====");
include <polysections.scad>;
section1 = [
// outer
[20, 0, 0],
[18, 9, 0],
[15, 10, 0],
[10, 0, 0],
// inner
[18, 2, 0],
[17, 7, 0],
[15, 7, 0],
[12, 2, 0]
];
// spin section1
sections = [
for(i = [0:55])
[
for(p = section1)
let(pt = rotate_p(p, [90, 0, 10 * i]))
[pt[0], pt[1] , pt[2] + i]
]
];
module test_polysections_solid(points, faces) {
expected_pts = [[20, 0, 0], [18, 0, 9], [15, 0, 10], [10, 0, 0], [19.6962, 3.473, 1], [17.7265, 3.1257, 10], [14.7721, 2.6047, 11], [9.8481, 1.7365, 1], [18.7939, 6.8404, 2], [16.9145, 6.1564, 11], [14.0954, 5.1303, 12], [9.3969, 3.4202, 2], [17.3205, 10, 3], [15.5885, 9, 12], [12.9904, 7.5, 13], [8.6603, 5, 3], [15.3209, 12.8558, 4], [13.7888, 11.5702, 13], [11.4907, 9.6418, 14], [7.6604, 6.4279, 4], [12.8558, 15.3209, 5], [11.5702, 13.7888, 14], [9.6418, 11.4907, 15], [6.4279, 7.6604, 5], [10, 17.3205, 6], [9, 15.5885, 15], [7.5, 12.9904, 16], [5, 8.6603, 6], [6.8404, 18.7939, 7], [6.1564, 16.9145, 16], [5.1303, 14.0954, 17], [3.4202, 9.3969, 7], [3.473, 19.6962, 8], [3.1257, 17.7265, 17], [2.6047, 14.7721, 18], [1.7365, 9.8481, 8], [0, 20, 9], [0, 18, 18], [0, 15, 19], [0, 10, 9], [-3.473, 19.6962, 10], [-3.1257, 17.7265, 19], [-2.6047, 14.7721, 20], [-1.7365, 9.8481, 10], [-6.8404, 18.7939, 11], [-6.1564, 16.9145, 20], [-5.1303, 14.0954, 21], [-3.4202, 9.3969, 11], [-10, 17.3205, 12], [-9, 15.5885, 21], [-7.5, 12.9904, 22], [-5, 8.6603, 12], [-12.8558, 15.3209, 13], [-11.5702, 13.7888, 22], [-9.6418, 11.4907, 23], [-6.4279, 7.6604, 13], [-15.3209, 12.8558, 14], [-13.7888, 11.5702, 23], [-11.4907, 9.6418, 24], [-7.6604, 6.4279, 14], [-17.3205, 10, 15], [-15.5885, 9, 24], [-12.9904, 7.5, 25], [-8.6603, 5, 15], [-18.7939, 6.8404, 16], [-16.9145, 6.1564, 25], [-14.0954, 5.1303, 26], [-9.3969, 3.4202, 16], [-19.6962, 3.473, 17], [-17.7265, 3.1257, 26], [-14.7721, 2.6047, 27], [-9.8481, 1.7365, 17], [-20, 0, 18], [-18, 0, 27], [-15, 0, 28], [-10, 0, 18], [-19.6962, -3.473, 19], [-17.7265, -3.1257, 28], [-14.7721, -2.6047, 29], [-9.8481, -1.7365, 19], [-18.7939, -6.8404, 20], [-16.9145, -6.1564, 29], [-14.0954, -5.1303, 30], [-9.3969, -3.4202, 20], [-17.3205, -10, 21], [-15.5885, -9, 30], [-12.9904, -7.5, 31], [-8.6603, -5, 21], [-15.3209, -12.8558, 22], [-13.7888, -11.5702, 31], [-11.4907, -9.6418, 32], [-7.6604, -6.4279, 22], [-12.8558, -15.3209, 23], [-11.5702, -13.7888, 32], [-9.6418, -11.4907, 33], [-6.4279, -7.6604, 23], [-10, -17.3205, 24], [-9, -15.5885, 33], [-7.5, -12.9904, 34], [-5, -8.6603, 24], [-6.8404, -18.7939, 25], [-6.1564, -16.9145, 34], [-5.1303, -14.0954, 35], [-3.4202, -9.3969, 25], [-3.473, -19.6962, 26], [-3.1257, -17.7265, 35], [-2.6047, -14.7721, 36], [-1.7365, -9.8481, 26], [0, -20, 27], [0, -18, 36], [0, -15, 37], [0, -10, 27], [3.473, -19.6962, 28], [3.1257, -17.7265, 37], [2.6047, -14.7721, 38], [1.7365, -9.8481, 28], [6.8404, -18.7939, 29], [6.1564, -16.9145, 38], [5.1303, -14.0954, 39], [3.4202, -9.3969, 29], [10, -17.3205, 30], [9, -15.5885, 39], [7.5, -12.9904, 40], [5, -8.6603, 30], [12.8558, -15.3209, 31], [11.5702, -13.7888, 40], [9.6418, -11.4907, 41], [6.4279, -7.6604, 31], [15.3209, -12.8558, 32], [13.7888, -11.5702, 41], [11.4907, -9.6418, 42], [7.6604, -6.4279, 32], [17.3205, -10, 33], [15.5885, -9, 42], [12.9904, -7.5, 43], [8.6603, -5, 33], [18.7939, -6.8404, 34], [16.9145, -6.1564, 43], [14.0954, -5.1303, 44], [9.3969, -3.4202, 34], [19.6962, -3.473, 35], [17.7265, -3.1257, 44], [14.7721, -2.6047, 45], [9.8481, -1.7365, 35], [20, 0, 36], [18, 0, 45], [15, 0, 46], [10, 0, 36], [19.6962, 3.473, 37], [17.7265, 3.1257, 46], [14.7721, 2.6047, 47], [9.8481, 1.7365, 37], [18.7939, 6.8404, 38], [16.9145, 6.1564, 47], [14.0954, 5.1303, 48], [9.3969, 3.4202, 38], [17.3205, 10, 39], [15.5885, 9, 48], [12.9904, 7.5, 49], [8.6603, 5, 39], [15.3209, 12.8558, 40], [13.7888, 11.5702, 49], [11.4907, 9.6418, 50], [7.6604, 6.4279, 40], [12.8558, 15.3209, 41], [11.5702, 13.7888, 50], [9.6418, 11.4907, 51], [6.4279, 7.6604, 41], [10, 17.3205, 42], [9, 15.5885, 51], [7.5, 12.9904, 52], [5, 8.6603, 42], [6.8404, 18.7939, 43], [6.1564, 16.9145, 52], [5.1303, 14.0954, 53], [3.4202, 9.3969, 43], [3.473, 19.6962, 44], [3.1257, 17.7265, 53], [2.6047, 14.7721, 54], [1.7365, 9.8481, 44], [0, 20, 45], [0, 18, 54], [0, 15, 55], [0, 10, 45], [-3.473, 19.6962, 46], [-3.1257, 17.7265, 55], [-2.6047, 14.7721, 56], [-1.7365, 9.8481, 46], [-6.8404, 18.7939, 47], [-6.1564, 16.9145, 56], [-5.1303, 14.0954, 57], [-3.4202, 9.3969, 47], [-10, 17.3205, 48], [-9, 15.5885, 57], [-7.5, 12.9904, 58], [-5, 8.6603, 48], [-12.8558, 15.3209, 49], [-11.5702, 13.7888, 58], [-9.6418, 11.4907, 59], [-6.4279, 7.6604, 49], [-15.3209, 12.8558, 50], [-13.7888, 11.5702, 59], [-11.4907, 9.6418, 60], [-7.6604, 6.4279, 50], [-17.3205, 10, 51], [-15.5885, 9, 60], [-12.9904, 7.5, 61], [-8.6603, 5, 51], [-18.7939, 6.8404, 52], [-16.9145, 6.1564, 61], [-14.0954, 5.1303, 62], [-9.3969, 3.4202, 52], [-19.6962, 3.473, 53], [-17.7265, 3.1257, 62], [-14.7721, 2.6047, 63], [-9.8481, 1.7365, 53], [-20, 0, 54], [-18, 0, 63], [-15, 0, 64], [-10, 0, 54], [-19.6962, -3.473, 55], [-17.7265, -3.1257, 64], [-14.7721, -2.6047, 65], [-9.8481, -1.7365, 55], [18, 0, 2], [17, 0, 7], [15, 0, 7], [12, 0, 2], [17.7265, 3.1257, 3], [16.7417, 2.952, 8], [14.7721, 2.6047, 8], [11.8177, 2.0838, 3], [16.9145, 6.1564, 4], [15.9748, 5.8143, 9], [14.0954, 5.1303, 9], [11.2763, 4.1042, 4], [15.5885, 9, 5], [14.7224, 8.5, 10], [12.9904, 7.5, 10], [10.3923, 6, 5], [13.7888, 11.5702, 6], [13.0228, 10.9274, 11], [11.4907, 9.6418, 11], [9.1925, 7.7135, 6], [11.5702, 13.7888, 7], [10.9274, 13.0228, 12], [9.6418, 11.4907, 12], [7.7135, 9.1925, 7], [9, 15.5885, 8], [8.5, 14.7224, 13], [7.5, 12.9904, 13], [6, 10.3923, 8], [6.1564, 16.9145, 9], [5.8143, 15.9748, 14], [5.1303, 14.0954, 14], [4.1042, 11.2763, 9], [3.1257, 17.7265, 10], [2.952, 16.7417, 15], [2.6047, 14.7721, 15], [2.0838, 11.8177, 10], [0, 18, 11], [0, 17, 16], [0, 15, 16], [0, 12, 11], [-3.1257, 17.7265, 12], [-2.952, 16.7417, 17], [-2.6047, 14.7721, 17], [-2.0838, 11.8177, 12], [-6.1564, 16.9145, 13], [-5.8143, 15.9748, 18], [-5.1303, 14.0954, 18], [-4.1042, 11.2763, 13], [-9, 15.5885, 14], [-8.5, 14.7224, 19], [-7.5, 12.9904, 19], [-6, 10.3923, 14], [-11.5702, 13.7888, 15], [-10.9274, 13.0228, 20], [-9.6418, 11.4907, 20], [-7.7135, 9.1925, 15], [-13.7888, 11.5702, 16], [-13.0228, 10.9274, 21], [-11.4907, 9.6418, 21], [-9.1925, 7.7135, 16], [-15.5885, 9, 17], [-14.7224, 8.5, 22], [-12.9904, 7.5, 22], [-10.3923, 6, 17], [-16.9145, 6.1564, 18], [-15.9748, 5.8143, 23], [-14.0954, 5.1303, 23], [-11.2763, 4.1042, 18], [-17.7265, 3.1257, 19], [-16.7417, 2.952, 24], [-14.7721, 2.6047, 24], [-11.8177, 2.0838, 19], [-18, 0, 20], [-17, 0, 25], [-15, 0, 25], [-12, 0, 20], [-17.7265, -3.1257, 21], [-16.7417, -2.952, 26], [-14.7721, -2.6047, 26], [-11.8177, -2.0838, 21], [-16.9145, -6.1564, 22], [-15.9748, -5.8143, 27], [-14.0954, -5.1303, 27], [-11.2763, -4.1042, 22], [-15.5885, -9, 23], [-14.7224, -8.5, 28], [-12.9904, -7.5, 28], [-10.3923, -6, 23], [-13.7888, -11.5702, 24], [-13.0228, -10.9274, 29], [-11.4907, -9.6418, 29], [-9.1925, -7.7135, 24], [-11.5702, -13.7888, 25], [-10.9274, -13.0228, 30], [-9.6418, -11.4907, 30], [-7.7135, -9.1925, 25], [-9, -15.5885, 26], [-8.5, -14.7224, 31], [-7.5, -12.9904, 31], [-6, -10.3923, 26], [-6.1564, -16.9145, 27], [-5.8143, -15.9748, 32], [-5.1303, -14.0954, 32], [-4.1042, -11.2763, 27], [-3.1257, -17.7265, 28], [-2.952, -16.7417, 33], [-2.6047, -14.7721, 33], [-2.0838, -11.8177, 28], [0, -18, 29], [0, -17, 34], [0, -15, 34], [0, -12, 29], [3.1257, -17.7265, 30], [2.952, -16.7417, 35], [2.6047, -14.7721, 35], [2.0838, -11.8177, 30], [6.1564, -16.9145, 31], [5.8143, -15.9748, 36], [5.1303, -14.0954, 36], [4.1042, -11.2763, 31], [9, -15.5885, 32], [8.5, -14.7224, 37], [7.5, -12.9904, 37], [6, -10.3923, 32], [11.5702, -13.7888, 33], [10.9274, -13.0228, 38], [9.6418, -11.4907, 38], [7.7135, -9.1925, 33], [13.7888, -11.5702, 34], [13.0228, -10.9274, 39], [11.4907, -9.6418, 39], [9.1925, -7.7135, 34], [15.5885, -9, 35], [14.7224, -8.5, 40], [12.9904, -7.5, 40], [10.3923, -6, 35], [16.9145, -6.1564, 36], [15.9748, -5.8143, 41], [14.0954, -5.1303, 41], [11.2763, -4.1042, 36], [17.7265, -3.1257, 37], [16.7417, -2.952, 42], [14.7721, -2.6047, 42], [11.8177, -2.0838, 37], [18, 0, 38], [17, 0, 43], [15, 0, 43], [12, 0, 38], [17.7265, 3.1257, 39], [16.7417, 2.952, 44], [14.7721, 2.6047, 44], [11.8177, 2.0838, 39], [16.9145, 6.1564, 40], [15.9748, 5.8143, 45], [14.0954, 5.1303, 45], [11.2763, 4.1042, 40], [15.5885, 9, 41], [14.7224, 8.5, 46], [12.9904, 7.5, 46], [10.3923, 6, 41], [13.7888, 11.5702, 42], [13.0228, 10.9274, 47], [11.4907, 9.6418, 47], [9.1925, 7.7135, 42], [11.5702, 13.7888, 43], [10.9274, 13.0228, 48], [9.6418, 11.4907, 48], [7.7135, 9.1925, 43], [9, 15.5885, 44], [8.5, 14.7224, 49], [7.5, 12.9904, 49], [6, 10.3923, 44], [6.1564, 16.9145, 45], [5.8143, 15.9748, 50], [5.1303, 14.0954, 50], [4.1042, 11.2763, 45], [3.1257, 17.7265, 46], [2.952, 16.7417, 51], [2.6047, 14.7721, 51], [2.0838, 11.8177, 46], [0, 18, 47], [0, 17, 52], [0, 15, 52], [0, 12, 47], [-3.1257, 17.7265, 48], [-2.952, 16.7417, 53], [-2.6047, 14.7721, 53], [-2.0838, 11.8177, 48], [-6.1564, 16.9145, 49], [-5.8143, 15.9748, 54], [-5.1303, 14.0954, 54], [-4.1042, 11.2763, 49], [-9, 15.5885, 50], [-8.5, 14.7224, 55], [-7.5, 12.9904, 55], [-6, 10.3923, 50], [-11.5702, 13.7888, 51], [-10.9274, 13.0228, 56], [-9.6418, 11.4907, 56], [-7.7135, 9.1925, 51], [-13.7888, 11.5702, 52], [-13.0228, 10.9274, 57], [-11.4907, 9.6418, 57], [-9.1925, 7.7135, 52], [-15.5885, 9, 53], [-14.7224, 8.5, 58], [-12.9904, 7.5, 58], [-10.3923, 6, 53], [-16.9145, 6.1564, 54], [-15.9748, 5.8143, 59], [-14.0954, 5.1303, 59], [-11.2763, 4.1042, 54], [-17.7265, 3.1257, 55], [-16.7417, 2.952, 60], [-14.7721, 2.6047, 60], [-11.8177, 2.0838, 55], [-18, 0, 56], [-17, 0, 61], [-15, 0, 61], [-12, 0, 56], [-17.7265, -3.1257, 57], [-16.7417, -2.952, 62], [-14.7721, -2.6047, 62], [-11.8177, -2.0838, 57]];
expected_faces = [[0, 224, 225, 1], [1, 225, 226, 2], [2, 226, 227, 3], [3, 227, 224, 0], [0, 1, 5], [1, 2, 6], [2, 3, 7], [3, 0, 4], [4, 5, 9], [5, 6, 10], [6, 7, 11], [7, 4, 8], [8, 9, 13], [9, 10, 14], [10, 11, 15], [11, 8, 12], [12, 13, 17], [13, 14, 18], [14, 15, 19], [15, 12, 16], [16, 17, 21], [17, 18, 22], [18, 19, 23], [19, 16, 20], [20, 21, 25], [21, 22, 26], [22, 23, 27], [23, 20, 24], [24, 25, 29], [25, 26, 30], [26, 27, 31], [27, 24, 28], [28, 29, 33], [29, 30, 34], [30, 31, 35], [31, 28, 32], [32, 33, 37], [33, 34, 38], [34, 35, 39], [35, 32, 36], [36, 37, 41], [37, 38, 42], [38, 39, 43], [39, 36, 40], [40, 41, 45], [41, 42, 46], [42, 43, 47], [43, 40, 44], [44, 45, 49], [45, 46, 50], [46, 47, 51], [47, 44, 48], [48, 49, 53], [49, 50, 54], [50, 51, 55], [51, 48, 52], [52, 53, 57], [53, 54, 58], [54, 55, 59], [55, 52, 56], [56, 57, 61], [57, 58, 62], [58, 59, 63], [59, 56, 60], [60, 61, 65], [61, 62, 66], [62, 63, 67], [63, 60, 64], [64, 65, 69], [65, 66, 70], [66, 67, 71], [67, 64, 68], [68, 69, 73], [69, 70, 74], [70, 71, 75], [71, 68, 72], [72, 73, 77], [73, 74, 78], [74, 75, 79], [75, 72, 76], [76, 77, 81], [77, 78, 82], [78, 79, 83], [79, 76, 80], [80, 81, 85], [81, 82, 86], [82, 83, 87], [83, 80, 84], [84, 85, 89], [85, 86, 90], [86, 87, 91], [87, 84, 88], [88, 89, 93], [89, 90, 94], [90, 91, 95], [91, 88, 92], [92, 93, 97], [93, 94, 98], [94, 95, 99], [95, 92, 96], [96, 97, 101], [97, 98, 102], [98, 99, 103], [99, 96, 100], [100, 101, 105], [101, 102, 106], [102, 103, 107], [103, 100, 104], [104, 105, 109], [105, 106, 110], [106, 107, 111], [107, 104, 108], [108, 109, 113], [109, 110, 114], [110, 111, 115], [111, 108, 112], [112, 113, 117], [113, 114, 118], [114, 115, 119], [115, 112, 116], [116, 117, 121], [117, 118, 122], [118, 119, 123], [119, 116, 120], [120, 121, 125], [121, 122, 126], [122, 123, 127], [123, 120, 124], [124, 125, 129], [125, 126, 130], [126, 127, 131], [127, 124, 128], [128, 129, 133], [129, 130, 134], [130, 131, 135], [131, 128, 132], [132, 133, 137], [133, 134, 138], [134, 135, 139], [135, 132, 136], [136, 137, 141], [137, 138, 142], [138, 139, 143], [139, 136, 140], [140, 141, 145], [141, 142, 146], [142, 143, 147], [143, 140, 144], [144, 145, 149], [145, 146, 150], [146, 147, 151], [147, 144, 148], [148, 149, 153], [149, 150, 154], [150, 151, 155], [151, 148, 152], [152, 153, 157], [153, 154, 158], [154, 155, 159], [155, 152, 156], [156, 157, 161], [157, 158, 162], [158, 159, 163], [159, 156, 160], [160, 161, 165], [161, 162, 166], [162, 163, 167], [163, 160, 164], [164, 165, 169], [165, 166, 170], [166, 167, 171], [167, 164, 168], [168, 169, 173], [169, 170, 174], [170, 171, 175], [171, 168, 172], [172, 173, 177], [173, 174, 178], [174, 175, 179], [175, 172, 176], [176, 177, 181], [177, 178, 182], [178, 179, 183], [179, 176, 180], [180, 181, 185], [181, 182, 186], [182, 183, 187], [183, 180, 184], [184, 185, 189], [185, 186, 190], [186, 187, 191], [187, 184, 188], [188, 189, 193], [189, 190, 194], [190, 191, 195], [191, 188, 192], [192, 193, 197], [193, 194, 198], [194, 195, 199], [195, 192, 196], [196, 197, 201], [197, 198, 202], [198, 199, 203], [199, 196, 200], [200, 201, 205], [201, 202, 206], [202, 203, 207], [203, 200, 204], [204, 205, 209], [205, 206, 210], [206, 207, 211], [207, 204, 208], [208, 209, 213], [209, 210, 214], [210, 211, 215], [211, 208, 212], [212, 213, 217], [213, 214, 218], [214, 215, 219], [215, 212, 216], [216, 217, 221], [217, 218, 222], [218, 219, 223], [219, 216, 220], [0, 5, 4], [1, 6, 5], [2, 7, 6], [3, 4, 7], [4, 9, 8], [5, 10, 9], [6, 11, 10], [7, 8, 11], [8, 13, 12], [9, 14, 13], [10, 15, 14], [11, 12, 15], [12, 17, 16], [13, 18, 17], [14, 19, 18], [15, 16, 19], [16, 21, 20], [17, 22, 21], [18, 23, 22], [19, 20, 23], [20, 25, 24], [21, 26, 25], [22, 27, 26], [23, 24, 27], [24, 29, 28], [25, 30, 29], [26, 31, 30], [27, 28, 31], [28, 33, 32], [29, 34, 33], [30, 35, 34], [31, 32, 35], [32, 37, 36], [33, 38, 37], [34, 39, 38], [35, 36, 39], [36, 41, 40], [37, 42, 41], [38, 43, 42], [39, 40, 43], [40, 45, 44], [41, 46, 45], [42, 47, 46], [43, 44, 47], [44, 49, 48], [45, 50, 49], [46, 51, 50], [47, 48, 51], [48, 53, 52], [49, 54, 53], [50, 55, 54], [51, 52, 55], [52, 57, 56], [53, 58, 57], [54, 59, 58], [55, 56, 59], [56, 61, 60], [57, 62, 61], [58, 63, 62], [59, 60, 63], [60, 65, 64], [61, 66, 65], [62, 67, 66], [63, 64, 67], [64, 69, 68], [65, 70, 69], [66, 71, 70], [67, 68, 71], [68, 73, 72], [69, 74, 73], [70, 75, 74], [71, 72, 75], [72, 77, 76], [73, 78, 77], [74, 79, 78], [75, 76, 79], [76, 81, 80], [77, 82, 81], [78, 83, 82], [79, 80, 83], [80, 85, 84], [81, 86, 85], [82, 87, 86], [83, 84, 87], [84, 89, 88], [85, 90, 89], [86, 91, 90], [87, 88, 91], [88, 93, 92], [89, 94, 93], [90, 95, 94], [91, 92, 95], [92, 97, 96], [93, 98, 97], [94, 99, 98], [95, 96, 99], [96, 101, 100], [97, 102, 101], [98, 103, 102], [99, 100, 103], [100, 105, 104], [101, 106, 105], [102, 107, 106], [103, 104, 107], [104, 109, 108], [105, 110, 109], [106, 111, 110], [107, 108, 111], [108, 113, 112], [109, 114, 113], [110, 115, 114], [111, 112, 115], [112, 117, 116], [113, 118, 117], [114, 119, 118], [115, 116, 119], [116, 121, 120], [117, 122, 121], [118, 123, 122], [119, 120, 123], [120, 125, 124], [121, 126, 125], [122, 127, 126], [123, 124, 127], [124, 129, 128], [125, 130, 129], [126, 131, 130], [127, 128, 131], [128, 133, 132], [129, 134, 133], [130, 135, 134], [131, 132, 135], [132, 137, 136], [133, 138, 137], [134, 139, 138], [135, 136, 139], [136, 141, 140], [137, 142, 141], [138, 143, 142], [139, 140, 143], [140, 145, 144], [141, 146, 145], [142, 147, 146], [143, 144, 147], [144, 149, 148], [145, 150, 149], [146, 151, 150], [147, 148, 151], [148, 153, 152], [149, 154, 153], [150, 155, 154], [151, 152, 155], [152, 157, 156], [153, 158, 157], [154, 159, 158], [155, 156, 159], [156, 161, 160], [157, 162, 161], [158, 163, 162], [159, 160, 163], [160, 165, 164], [161, 166, 165], [162, 167, 166], [163, 164, 167], [164, 169, 168], [165, 170, 169], [166, 171, 170], [167, 168, 171], [168, 173, 172], [169, 174, 173], [170, 175, 174], [171, 172, 175], [172, 177, 176], [173, 178, 177], [174, 179, 178], [175, 176, 179], [176, 181, 180], [177, 182, 181], [178, 183, 182], [179, 180, 183], [180, 185, 184], [181, 186, 185], [182, 187, 186], [183, 184, 187], [184, 189, 188], [185, 190, 189], [186, 191, 190], [187, 188, 191], [188, 193, 192], [189, 194, 193], [190, 195, 194], [191, 192, 195], [192, 197, 196], [193, 198, 197], [194, 199, 198], [195, 196, 199], [196, 201, 200], [197, 202, 201], [198, 203, 202], [199, 200, 203], [200, 205, 204], [201, 206, 205], [202, 207, 206], [203, 204, 207], [204, 209, 208], [205, 210, 209], [206, 211, 210], [207, 208, 211], [208, 213, 212], [209, 214, 213], [210, 215, 214], [211, 212, 215], [212, 217, 216], [213, 218, 217], [214, 219, 218], [215, 216, 219], [216, 221, 220], [217, 222, 221], [218, 223, 222], [219, 220, 223], [229, 225, 224], [230, 226, 225], [231, 227, 226], [228, 224, 227], [233, 229, 228], [234, 230, 229], [235, 231, 230], [232, 228, 231], [237, 233, 232], [238, 234, 233], [239, 235, 234], [236, 232, 235], [241, 237, 236], [242, 238, 237], [243, 239, 238], [240, 236, 239], [245, 241, 240], [246, 242, 241], [247, 243, 242], [244, 240, 243], [249, 245, 244], [250, 246, 245], [251, 247, 246], [248, 244, 247], [253, 249, 248], [254, 250, 249], [255, 251, 250], [252, 248, 251], [257, 253, 252], [258, 254, 253], [259, 255, 254], [256, 252, 255], [261, 257, 256], [262, 258, 257], [263, 259, 258], [260, 256, 259], [265, 261, 260], [266, 262, 261], [267, 263, 262], [264, 260, 263], [269, 265, 264], [270, 266, 265], [271, 267, 266], [268, 264, 267], [273, 269, 268], [274, 270, 269], [275, 271, 270], [272, 268, 271], [277, 273, 272], [278, 274, 273], [279, 275, 274], [276, 272, 275], [281, 277, 276], [282, 278, 277], [283, 279, 278], [280, 276, 279], [285, 281, 280], [286, 282, 281], [287, 283, 282], [284, 280, 283], [289, 285, 284], [290, 286, 285], [291, 287, 286], [288, 284, 287], [293, 289, 288], [294, 290, 289], [295, 291, 290], [292, 288, 291], [297, 293, 292], [298, 294, 293], [299, 295, 294], [296, 292, 295], [301, 297, 296], [302, 298, 297], [303, 299, 298], [300, 296, 299], [305, 301, 300], [306, 302, 301], [307, 303, 302], [304, 300, 303], [309, 305, 304], [310, 306, 305], [311, 307, 306], [308, 304, 307], [313, 309, 308], [314, 310, 309], [315, 311, 310], [312, 308, 311], [317, 313, 312], [318, 314, 313], [319, 315, 314], [316, 312, 315], [321, 317, 316], [322, 318, 317], [323, 319, 318], [320, 316, 319], [325, 321, 320], [326, 322, 321], [327, 323, 322], [324, 320, 323], [329, 325, 324], [330, 326, 325], [331, 327, 326], [328, 324, 327], [333, 329, 328], [334, 330, 329], [335, 331, 330], [332, 328, 331], [337, 333, 332], [338, 334, 333], [339, 335, 334], [336, 332, 335], [341, 337, 336], [342, 338, 337], [343, 339, 338], [340, 336, 339], [345, 341, 340], [346, 342, 341], [347, 343, 342], [344, 340, 343], [349, 345, 344], [350, 346, 345], [351, 347, 346], [348, 344, 347], [353, 349, 348], [354, 350, 349], [355, 351, 350], [352, 348, 351], [357, 353, 352], [358, 354, 353], [359, 355, 354], [356, 352, 355], [361, 357, 356], [362, 358, 357], [363, 359, 358], [360, 356, 359], [365, 361, 360], [366, 362, 361], [367, 363, 362], [364, 360, 363], [369, 365, 364], [370, 366, 365], [371, 367, 366], [368, 364, 367], [373, 369, 368], [374, 370, 369], [375, 371, 370], [372, 368, 371], [377, 373, 372], [378, 374, 373], [379, 375, 374], [376, 372, 375], [381, 377, 376], [382, 378, 377], [383, 379, 378], [380, 376, 379], [385, 381, 380], [386, 382, 381], [387, 383, 382], [384, 380, 383], [389, 385, 384], [390, 386, 385], [391, 387, 386], [388, 384, 387], [393, 389, 388], [394, 390, 389], [395, 391, 390], [392, 388, 391], [397, 393, 392], [398, 394, 393], [399, 395, 394], [396, 392, 395], [401, 397, 396], [402, 398, 397], [403, 399, 398], [400, 396, 399], [405, 401, 400], [406, 402, 401], [407, 403, 402], [404, 400, 403], [409, 405, 404], [410, 406, 405], [411, 407, 406], [408, 404, 407], [413, 409, 408], [414, 410, 409], [415, 411, 410], [412, 408, 411], [417, 413, 412], [418, 414, 413], [419, 415, 414], [416, 412, 415], [421, 417, 416], [422, 418, 417], [423, 419, 418], [420, 416, 419], [425, 421, 420], [426, 422, 421], [427, 423, 422], [424, 420, 423], [429, 425, 424], [430, 426, 425], [431, 427, 426], [428, 424, 427], [433, 429, 428], [434, 430, 429], [435, 431, 430], [432, 428, 431], [437, 433, 432], [438, 434, 433], [439, 435, 434], [436, 432, 435], [441, 437, 436], [442, 438, 437], [443, 439, 438], [440, 436, 439], [445, 441, 440], [446, 442, 441], [447, 443, 442], [444, 440, 443], [228, 229, 224], [229, 230, 225], [230, 231, 226], [231, 228, 227], [232, 233, 228], [233, 234, 229], [234, 235, 230], [235, 232, 231], [236, 237, 232], [237, 238, 233], [238, 239, 234], [239, 236, 235], [240, 241, 236], [241, 242, 237], [242, 243, 238], [243, 240, 239], [244, 245, 240], [245, 246, 241], [246, 247, 242], [247, 244, 243], [248, 249, 244], [249, 250, 245], [250, 251, 246], [251, 248, 247], [252, 253, 248], [253, 254, 249], [254, 255, 250], [255, 252, 251], [256, 257, 252], [257, 258, 253], [258, 259, 254], [259, 256, 255], [260, 261, 256], [261, 262, 257], [262, 263, 258], [263, 260, 259], [264, 265, 260], [265, 266, 261], [266, 267, 262], [267, 264, 263], [268, 269, 264], [269, 270, 265], [270, 271, 266], [271, 268, 267], [272, 273, 268], [273, 274, 269], [274, 275, 270], [275, 272, 271], [276, 277, 272], [277, 278, 273], [278, 279, 274], [279, 276, 275], [280, 281, 276], [281, 282, 277], [282, 283, 278], [283, 280, 279], [284, 285, 280], [285, 286, 281], [286, 287, 282], [287, 284, 283], [288, 289, 284], [289, 290, 285], [290, 291, 286], [291, 288, 287], [292, 293, 288], [293, 294, 289], [294, 295, 290], [295, 292, 291], [296, 297, 292], [297, 298, 293], [298, 299, 294], [299, 296, 295], [300, 301, 296], [301, 302, 297], [302, 303, 298], [303, 300, 299], [304, 305, 300], [305, 306, 301], [306, 307, 302], [307, 304, 303], [308, 309, 304], [309, 310, 305], [310, 311, 306], [311, 308, 307], [312, 313, 308], [313, 314, 309], [314, 315, 310], [315, 312, 311], [316, 317, 312], [317, 318, 313], [318, 319, 314], [319, 316, 315], [320, 321, 316], [321, 322, 317], [322, 323, 318], [323, 320, 319], [324, 325, 320], [325, 326, 321], [326, 327, 322], [327, 324, 323], [328, 329, 324], [329, 330, 325], [330, 331, 326], [331, 328, 327], [332, 333, 328], [333, 334, 329], [334, 335, 330], [335, 332, 331], [336, 337, 332], [337, 338, 333], [338, 339, 334], [339, 336, 335], [340, 341, 336], [341, 342, 337], [342, 343, 338], [343, 340, 339], [344, 345, 340], [345, 346, 341], [346, 347, 342], [347, 344, 343], [348, 349, 344], [349, 350, 345], [350, 351, 346], [351, 348, 347], [352, 353, 348], [353, 354, 349], [354, 355, 350], [355, 352, 351], [356, 357, 352], [357, 358, 353], [358, 359, 354], [359, 356, 355], [360, 361, 356], [361, 362, 357], [362, 363, 358], [363, 360, 359], [364, 365, 360], [365, 366, 361], [366, 367, 362], [367, 364, 363], [368, 369, 364], [369, 370, 365], [370, 371, 366], [371, 368, 367], [372, 373, 368], [373, 374, 369], [374, 375, 370], [375, 372, 371], [376, 377, 372], [377, 378, 373], [378, 379, 374], [379, 376, 375], [380, 381, 376], [381, 382, 377], [382, 383, 378], [383, 380, 379], [384, 385, 380], [385, 386, 381], [386, 387, 382], [387, 384, 383], [388, 389, 384], [389, 390, 385], [390, 391, 386], [391, 388, 387], [392, 393, 388], [393, 394, 389], [394, 395, 390], [395, 392, 391], [396, 397, 392], [397, 398, 393], [398, 399, 394], [399, 396, 395], [400, 401, 396], [401, 402, 397], [402, 403, 398], [403, 400, 399], [404, 405, 400], [405, 406, 401], [406, 407, 402], [407, 404, 403], [408, 409, 404], [409, 410, 405], [410, 411, 406], [411, 408, 407], [412, 413, 408], [413, 414, 409], [414, 415, 410], [415, 412, 411], [416, 417, 412], [417, 418, 413], [418, 419, 414], [419, 416, 415], [420, 421, 416], [421, 422, 417], [422, 423, 418], [423, 420, 419], [424, 425, 420], [425, 426, 421], [426, 427, 422], [427, 424, 423], [428, 429, 424], [429, 430, 425], [430, 431, 426], [431, 428, 427], [432, 433, 428], [433, 434, 429], [434, 435, 430], [435, 432, 431], [436, 437, 432], [437, 438, 433], [438, 439, 434], [439, 436, 435], [440, 441, 436], [441, 442, 437], [442, 443, 438], [443, 440, 439], [444, 445, 440], [445, 446, 441], [446, 447, 442], [447, 444, 443], [220, 221, 445, 444], [221, 222, 446, 445], [222, 223, 447, 446], [223, 220, 444, 447]];
assertEqualPoints(expected_pts, points);
for(i = [0:len(expected_faces) - 1]) {
assert(expected_faces[i] == faces[i]);
}
}
polysections(sections, "HOLLOW");
}
test_polysections_solid_sections();
test_polysections_hollow_sections();