mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-01 12:30:33 +02:00
annoying float errors XD
This commit is contained in:
@@ -12,13 +12,12 @@ module test_bezier_curve() {
|
||||
p2 = [-50, 90, 0];
|
||||
p3 = [0, 200, -35];
|
||||
|
||||
expected = [[0, 0, 0], [5.0588, 8.7888, 4.7338], [8.37, 17.21, 8.47], [10.1363, 25.3463, 11.2613], [10.56, 33.28, 13.16], [9.8438, 41.0938, 14.2188], [8.19, 48.87, 14.49], [5.8013, 56.6913, 14.0263], [2.88, 64.64, 12.88], [-0.3712, 72.7987, 11.1038], [-3.75, 81.25, 8.75], [-7.0537, 90.0762, 5.8713], [-10.08, 99.36, 2.52], [-12.6263, 109.184, -1.2513], [-14.49, 119.63, -5.39], [-15.4688, 130.781, -9.8438], [-15.36, 142.72, -14.56], [-13.9612, 155.529, -19.4863], [-11.07, 169.29, -24.57], [-6.4837, 184.086, -29.7588], [0, 200, -35]];
|
||||
|
||||
expected = [[0, 0, 0], [5.05875, 8.78875, 4.73375], [8.37, 17.21, 8.47], [10.1363, 25.3463, 11.2613], [10.56, 33.28, 13.16], [9.84375, 41.0938, 14.2188], [8.19, 48.87, 14.49], [5.80125, 56.6912, 14.0262], [2.88, 64.64, 12.88], [-0.37125, 72.7988, 11.1038], [-3.75, 81.25, 8.75], [-7.05375, 90.0763, 5.87125], [-10.08, 99.36, 2.52], [-12.6263, 109.184, -1.25125], [-14.49, 119.63, -5.39], [-15.4688, 130.781, -9.84375], [-15.36, 142.72, -14.56], [-13.9612, 155.529, -19.4863], [-11.07, 169.29, -24.57], [-6.48375, 184.086, -29.7588], [0, 200, -35]];
|
||||
actual = bezier_curve(t_step,
|
||||
[p0, p1, p2, p3]
|
||||
);
|
||||
|
||||
assertEqualPoints(expected, actual);
|
||||
assertEqualPoints(expected, actual, 0.0005);
|
||||
}
|
||||
|
||||
test_bezier_curve();
|
@@ -20,9 +20,8 @@ module test_bezier_surface() {
|
||||
actual = bezier_surface(t_step, ctrl_pts);
|
||||
|
||||
for(i = [0:len(expected) - 1]) {
|
||||
assertEqualPoints(expected[i], actual[i]);
|
||||
assertEqualPoints(expected[i], actual[i], 0.0006);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
test_bezier_surface();
|
Reference in New Issue
Block a user