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

reduce deps

This commit is contained in:
Justin Lin
2020-01-27 08:55:23 +08:00
parent c7b1c74292
commit 31d8782cec
2 changed files with 22 additions and 29 deletions

View File

@@ -8,9 +8,9 @@
*
**/
include <__comm__/__angy_angz.scad>;
include <__comm__/__to3d.scad>;
include <matrix/__comm__/__m_rotation.scad>;
use <__comm__/__angy_angz.scad>;
use <__comm__/__to3d.scad>;
use <matrix/m_rotation.scad>;
module along_with(points, angles, twist = 0, scale = 1.0, method = "AXIS_ANGLE") {
leng_points = len(points);
@@ -190,10 +190,10 @@ module along_with(points, angles, twist = 0, scale = 1.0, method = "AXIS_ANGLE")
}
}
test_along_with_angles(angs);
test_along_with_angles(angs, $children);
}
}
module test_along_with_angles(angles) {
module test_along_with_angles(angles, children) {
}

View File

@@ -1,42 +1,36 @@
include <unittest.scad>;
include <circle_path.scad>;
include <along_with.scad>;
module test_along_with_default_angles() {
echo("==== test_along_with_default_angles ====");
include <along_with.scad>;
$fn = 24;
points = circle_path(radius = 50);
module test_along_with_angles(angles) {
module test_along_with_angles(angles, children) {
if(children == 1) {
// ==== test_along_with_default_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]];
assert($fn == len(angles));
assertEqualPoints(expected_angles, angles);
}
else {
// ==== test_along_with_children ====
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]];
assert(8 == len(angles));
assertEqualPoints(expected_angles, angles);
}
}
module test_along_with_default_angles() {
echo("==== test_along_with_default_angles ====");
$fn = 24;
points = circle_path(radius = 50);
along_with(points, method = "EULER_ANGLE")
sphere(5);
}
module test_along_with_children() {
echo("==== test_along_with_children ====");
include <along_with.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]];
assert(8 == len(angles));
assertEqualPoints(expected_angles, angles);
}
points = circle_path(radius = 50);
along_with(points, method = "EULER_ANGLE") {
linear_extrude(10, center = true) text("A", valign = "center", halign = "center");
linear_extrude(5, center = true) circle(2);
@@ -47,7 +41,6 @@ module test_along_with_children() {
sphere(1);
cube(5);
}
}
test_along_with_default_angles();