mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-21 05:52:16 +02:00
added test_along_with
This commit is contained in:
@@ -15,6 +15,9 @@ include <test_hull_polyline3d.scad>;
|
|||||||
include <test_function_grapher.scad>;
|
include <test_function_grapher.scad>;
|
||||||
include <test_polysections.scad>;
|
include <test_polysections.scad>;
|
||||||
|
|
||||||
|
// Transformation
|
||||||
|
include <test_along_with.scad>;
|
||||||
|
|
||||||
// Function
|
// Function
|
||||||
include <test_paths2sections.scad>;
|
include <test_paths2sections.scad>;
|
||||||
|
|
||||||
|
54
test/test_along_with.scad
Normal file
54
test/test_along_with.scad
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
include <unittest.scad>;
|
||||||
|
|
||||||
|
module test_along_with_default_angles() {
|
||||||
|
include <along_with.scad>;
|
||||||
|
include <circle_path.scad>;
|
||||||
|
|
||||||
|
$fn = 24;
|
||||||
|
|
||||||
|
points = circle_path(radius = 50);
|
||||||
|
|
||||||
|
module test_along_with_angles(angles) {
|
||||||
|
expected_angles = [[0, 0, 97.5], [0, 0, 97.5], [0, 0, 112.5], [0, 0, 127.5], [0, 0, 142.5], [0, 0, 157.5], [0, 0, 172.5], [0, 0, -172.5], [0, 0, -157.5], [0, 0, -142.5], [0, 0, -127.5], [0, 0, -112.5], [0, 0, -97.5], [0, 0, -82.5], [0, 0, -67.5], [0, 0, -52.5], [0, 0, -37.5], [0, 0, -22.5], [0, 0, -7.5], [0, 0, 7.5], [0, 0, 22.5], [0, 0, 37.5], [0, 0, 52.5], [0, 0, 67.5]];
|
||||||
|
|
||||||
|
assertEqual($fn, len(angles));
|
||||||
|
assertEqualPoints(expected_angles, angles);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
along_with(points)
|
||||||
|
sphere(5, center = true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
module test_along_with_children() {
|
||||||
|
include <along_with.scad>;
|
||||||
|
include <circle_path.scad>;
|
||||||
|
|
||||||
|
$fn = 24;
|
||||||
|
|
||||||
|
points = circle_path(radius = 50);
|
||||||
|
|
||||||
|
module test_along_with_angles(angles) {
|
||||||
|
expected_angles = [[0, 0, 97.5], [0, 0, 97.5], [0, 0, 112.5], [0, 0, 127.5], [0, 0, 142.5], [0, 0, 157.5], [0, 0, 172.5], [0, 0, -172.5]];
|
||||||
|
|
||||||
|
assertEqual(8, len(angles));
|
||||||
|
assertEqualPoints(expected_angles, angles);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
along_with(points) {
|
||||||
|
linear_extrude(10, center = true) text("A", valign = "center", halign = "center");
|
||||||
|
linear_extrude(5, center = true) circle(2);
|
||||||
|
sphere(1);
|
||||||
|
cube(5);
|
||||||
|
linear_extrude(10, center = true) text("A", valign = "center", halign = "center");
|
||||||
|
linear_extrude(5, center = true) circle(2);
|
||||||
|
sphere(1);
|
||||||
|
cube(5);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
test_along_with_default_angles();
|
||||||
|
test_along_with_children();
|
Reference in New Issue
Block a user