1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-14 02:34:12 +02:00

added test_bend

This commit is contained in:
Justin Lin
2017-06-19 17:51:28 +08:00
parent c7f9cb424e
commit b83ae02cab
3 changed files with 26 additions and 0 deletions

View File

@@ -50,4 +50,12 @@ module bend(size, angle, frags = 24) {
get_frag(i)
children();
}
// hook for testing
test_bend_tri_frag(tri_frag_pts, frag_angle);
}
// override it to test
module test_bend_tri_frag(points, angle) {
}

View File

@@ -17,6 +17,7 @@ include <test_polysections.scad>;
// Transformation
include <test_along_with.scad>;
include <test_bend.scad>;
// Function
include <test_paths2sections.scad>;

17
test/test_bend.scad Normal file
View File

@@ -0,0 +1,17 @@
include <unittest.scad>;
include <bend.scad>;
x = 9.25;
y = 9.55;
z = 1;
module test_bend_tri_frag(points, angle) {
expected_points = [[0, 0], [0.1927, 1.9566], [0.3854, 0], [0, 0]];
expected_angle = 11.25;
assertEqualPoints(expected_points, points);
assertEqual(expected_angle, angle);
}
bend(size = [x, y, z], angle = 270)
linear_extrude(z) text("A");