1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
dotSCAD/test/test_midpt_smooth.scad

16 lines
7.1 KiB
OpenSCAD
Raw Normal View History

2022-06-06 13:11:46 +08:00
use <unittest.scad>
use <shape_taiwan.scad>
use <midpt_smooth.scad>
2020-01-26 16:26:19 +08:00
2019-06-16 18:23:10 +08:00
module test_midpt_smooth() {
echo("==== test_midpt_smooth ====");
taiwan = shape_taiwan(50);
expected = [[10.63, 22.383], [10.1322, 22.6054], [9.65611, 22.8175], [9.26491, 23.013], [8.97805, 23.1879], [8.77136, 23.3444], [8.59924, 23.4932], [8.41804, 23.652], [8.19789, 23.835], [7.924, 24.0385], [7.59413, 24.2351], [7.21713, 24.3828], [6.81247, 24.4453], [6.40816, 24.4087], [6.03497, 24.2851], [5.71872, 24.1048], [5.47485, 23.9026], [5.3079, 23.7055], [5.21391, 23.5269], [5.18172, 23.3679], [5.19229, 23.2254], [5.2195, 23.1], [5.23557, 22.9985], [5.21927, 22.9287], [5.16157, 22.891], [5.06439, 22.8749], [4.93268, 22.862], [4.76432, 22.8332], [4.54436, 22.7749], [4.24956, 22.6813], [3.86392, 22.5547], [3.39557, 22.4027], [2.88008, 22.2349], [2.36299, 22.0574], [1.87426, 21.8686], [1.41628, 21.658], [0.974894, 21.4098], [0.541119, 21.1111], [0.123546, 20.7617], [-0.256239, 20.3801], [-0.57757, 19.9999], [-0.831844, 19.6571], [-1.02464, 19.3735], [-1.17023, 19.1499], [-1.28387, 18.9706], [-1.37709, 18.815], [-1.45723, 18.6666], [-1.52922, 18.5148], [-1.59737, 18.3511], [-1.66659, 18.1661], [-1.74309, 17.9513], [-1.8336, 17.7034], [-1.94287, 17.4279], [-2.07092, 17.1387], [-2.2128, 16.8525], [-2.36146, 16.5833], [-2.51212, 16.3396], [-2.66534, 16.1248], [-2.82654, 15.9391], [-3.00181, 15.7792], [-3.19204, 15.6373], [-3.39004, 15.5036], [-3.5836, 15.3697], [-3.76283, 15.232], [-3.92588, 15.0903], [-4.0786, 14.9424], [-4.22925, 14.7803], [-4.38325, 14.5908], [-4.54247, 14.3608], [-4.70892, 14.0825], [-4.88942, 13.7542], [-5.09632, 13.3761], [-5.34192, 12.9479], [-5.62904, 12.4699], [-5.94531, 11.9488], [-6.26697, 11.4003], [-6.57004, 10.8482], [-6.8408, 10.319], [-7.07929, 9.83461], [-7.29556, 9.40499], [-7.50157, 9.02568], [-7.70299, 8.68327], [-7.8959, 8.36475], [-8.07105, 8.0638], [-8.22214, 7.78104], [-8.35063, 7.52096], [-8.46345, 7.28875], [-8.56764, 7.0879], [-8.66778, 6.91778], [-8.76767, 6.77148], [-8.8725, 6.63422], [-8.98878, 6.48373], [-9.12206, 6.29465], [-9.27463, 6.04779], [-9.44449, 5.74017], [-9.62607, 5.38879], [-9.8122, 5.0234], [-9.99627, 4.67235], [-10.1735, 4.35116], [-10.3417, 4.06058], [-10.5018, 3.79242], [-10.6578, 3.53644], [-10.815, 3.28328], [-10.9767, 3.02401], [-11.1434, 2.74885], [-11.3138, 2.44761], [-11.4874, 2.11172], [-11.6632, 1.73693], [-11.8362, 1.32482], [-11.9945, 0.882597], [-12.1214, 0.421669], [-12.2029, -0.0435495], [-12.2351, -0.496003], [-12.2265, -0.917097], [-12.1943, -1.29055], [-12.1569, -1.60857], [-12.1266, -1.87687], [-12.1073, -2.1145], [-12.0967, -2.34759], [-12.0909, -2.59901], [-12.0875, -2.87817], [-12.0856, -3.17605], [-12.0861, -3.46997], [-12.0925, -3.73656], [-12.1112, -3.9645], [-12.1497, -4.15813], [-12.2116, -4.33142], [-12.2942, -4.49885], [-12.3892, -4.66958], [-12.4867, -4.84605], [-12.5789, -5.02531], [-12.6606, -5.20235], [-12.7288, -5.37373], [-12.7815, -5.53935], [-12.8185, -5.70088], [-12.8435, -5.85884], [-12.8642, -6.0113], [-12.8893, -6.1556], [-12.9224, -6.29146], [-12.9583, -6.42228], [-12.9864, -6.5533], [-12.9974, -6.68803], [-12.988, -6.82606], [-12.9604, -6.96409], [-12.9194, -7.09841], [-12.8724, -7.22642], [-12.831, -7.34645], [-12.8093, -7.45742], [-12.8148, -7.55961], [-12.8398, -7.65585], [-12.861, -7.75107], [-12.8495, -7.84998], [-12.7854, -7.95458], [-12.6653, -8.06416], [-12.5022, -8.17808], [-12.3198, -8.29903], [-12.1459, -8.43379], [-12.0041, -8.59081], [-11.906, -8.77737], [-11.8454, -8.99865], [-11.8024, -9.2581], [-11.7546, -9.55546], [-11.6892, -9.88234], [-11.6065, -10.2202], [-11.5161, -10.5458], [-11.4302, -10.8414], [-11.3573, -11.1035], [-11.2972, -11.3431], [-11.2405, -11.58], [-11.1731, -11.8332], [-11.0851, -12.1128], [-10.9782, -12.4156], [-10.866, -12.7285], [-10.7644, -13.0358], [-10.6807, -13.3279], [-10.6062, -13.6054], [-10.5197, -13.877], [-10.3986, -14.1556], [-10.231, -14.4518], [-10.019, -14.7696], [-9.7739, -15.1036], [-9.50815, -15.4379], [-9.23223, -15.7506], [-8.95555, -16.0226], [-8.68614, -16.2465], [-8.42687, -16.4312], [-8.17294, -16.5961], [-7.91555, -16.7611], [-7.64966, -16.9383], [-7.37826, -17.1308], [-7.10939, -17.3374], [-6.84962, -17.559], [-6.59971, -17.8041], [-6.35454, -18.091],
actual = midpt_smooth(taiwan, 20, true);
assertEqualPoints(expected, actual);
}
test_midpt_smooth();