mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-24 15:22:53 +02:00
reduce deps
This commit is contained in:
@@ -8,9 +8,9 @@
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
include <__comm__/__angy_angz.scad>;
|
use <__comm__/__angy_angz.scad>;
|
||||||
include <__comm__/__to3d.scad>;
|
use <__comm__/__to3d.scad>;
|
||||||
include <matrix/__comm__/__m_rotation.scad>;
|
use <matrix/m_rotation.scad>;
|
||||||
|
|
||||||
module along_with(points, angles, twist = 0, scale = 1.0, method = "AXIS_ANGLE") {
|
module along_with(points, angles, twist = 0, scale = 1.0, method = "AXIS_ANGLE") {
|
||||||
leng_points = len(points);
|
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) {
|
||||||
|
|
||||||
}
|
}
|
@@ -1,42 +1,36 @@
|
|||||||
include <unittest.scad>;
|
include <unittest.scad>;
|
||||||
include <circle_path.scad>;
|
include <circle_path.scad>;
|
||||||
|
include <along_with.scad>;
|
||||||
|
|
||||||
module test_along_with_default_angles() {
|
module test_along_with_angles(angles, children) {
|
||||||
echo("==== test_along_with_default_angles ====");
|
if(children == 1) {
|
||||||
|
// ==== test_along_with_default_angles ====
|
||||||
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], [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]];
|
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));
|
assert($fn == len(angles));
|
||||||
assertEqualPoints(expected_angles, 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")
|
along_with(points, method = "EULER_ANGLE")
|
||||||
sphere(5);
|
sphere(5);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module test_along_with_children() {
|
module test_along_with_children() {
|
||||||
echo("==== test_along_with_children ====");
|
echo("==== test_along_with_children ====");
|
||||||
|
|
||||||
include <along_with.scad>;
|
|
||||||
|
|
||||||
$fn = 24;
|
$fn = 24;
|
||||||
|
|
||||||
points = circle_path(radius = 50);
|
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
along_with(points, method = "EULER_ANGLE") {
|
along_with(points, method = "EULER_ANGLE") {
|
||||||
linear_extrude(10, center = true) text("A", valign = "center", halign = "center");
|
linear_extrude(10, center = true) text("A", valign = "center", halign = "center");
|
||||||
linear_extrude(5, center = true) circle(2);
|
linear_extrude(5, center = true) circle(2);
|
||||||
@@ -47,7 +41,6 @@ module test_along_with_children() {
|
|||||||
sphere(1);
|
sphere(1);
|
||||||
cube(5);
|
cube(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
test_along_with_default_angles();
|
test_along_with_default_angles();
|
||||||
|
Reference in New Issue
Block a user