mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-14 10:44:48 +02:00
added test_bend
This commit is contained in:
@@ -50,4 +50,12 @@ module bend(size, angle, frags = 24) {
|
|||||||
get_frag(i)
|
get_frag(i)
|
||||||
children();
|
children();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// hook for testing
|
||||||
|
test_bend_tri_frag(tri_frag_pts, frag_angle);
|
||||||
|
}
|
||||||
|
|
||||||
|
// override it to test
|
||||||
|
module test_bend_tri_frag(points, angle) {
|
||||||
|
|
||||||
}
|
}
|
@@ -17,6 +17,7 @@ include <test_polysections.scad>;
|
|||||||
|
|
||||||
// Transformation
|
// Transformation
|
||||||
include <test_along_with.scad>;
|
include <test_along_with.scad>;
|
||||||
|
include <test_bend.scad>;
|
||||||
|
|
||||||
// Function
|
// Function
|
||||||
include <test_paths2sections.scad>;
|
include <test_paths2sections.scad>;
|
||||||
|
17
test/test_bend.scad
Normal file
17
test/test_bend.scad
Normal 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");
|
Reference in New Issue
Block a user