1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-11 17:24:20 +02:00

added modules to avoid namespace problems

This commit is contained in:
Justin Lin
2017-06-22 18:17:02 +08:00
parent 40e4ba5b12
commit 9d770c9cf8
7 changed files with 198 additions and 175 deletions

View File

@@ -21,12 +21,14 @@ include <test_bend.scad>;
// Function // Function
include <test_rotate_p.scad>; include <test_rotate_p.scad>;
include <test_paths2sections.scad>;
include <test_sub_str.scad>; include <test_sub_str.scad>;
include <test_split_str.scad>; include <test_split_str.scad>;
include <test_parse_number.scad>; include <test_parse_number.scad>;
include <test_cross_sections.scad>; include <test_cross_sections.scad>;
include <test_paths2sections.scad>;
// Path
include <test_circle_path.scad>;
// 2D Shape // 2D Shape
include <test_shape_arc.scad>; include <test_shape_arc.scad>;

View File

@@ -1,10 +1,7 @@
module test_bend() {
include <unittest.scad>; include <unittest.scad>;
include <bend.scad>; include <bend.scad>;
x = 9.25;
y = 9.55;
z = 1;
module test_bend_tri_frag(points, angle) { module test_bend_tri_frag(points, angle) {
echo("==== test_bend_tri_frag ===="); echo("==== test_bend_tri_frag ====");
@@ -17,3 +14,6 @@ module test_bend_tri_frag(points, angle) {
bend(size = [x, y, z], angle = 270) bend(size = [x, y, z], angle = 270)
linear_extrude(z) text("A"); linear_extrude(z) text("A");
}
test_bend();

View File

@@ -1,3 +1,4 @@
module test_cross_sections() {
echo("==== test_cross_sections ===="); echo("==== test_cross_sections ====");
include <unittest.scad>; include <unittest.scad>;
@@ -133,3 +134,6 @@ sects = cross_sections(shape_pts, pts, angles, twist = 180, scale = 0.1);
for(i = [0:len(expected) - 1]) { for(i = [0:len(expected) - 1]) {
assertEqualPoints(expected[i], sects[i]); assertEqualPoints(expected[i], sects[i]);
} }
}
test_cross_sections();

View File

@@ -1,3 +1,4 @@
module test_parse_number() {
echo("==== test_parse_number ===="); echo("==== test_parse_number ====");
include <unittest.scad>; include <unittest.scad>;
@@ -7,3 +8,6 @@ include <parse_number.scad>;
assertEqual(11, parse_number("10") + 1); assertEqual(11, parse_number("10") + 1);
assertEqual(-0.1, parse_number("-1.1") + 1); assertEqual(-0.1, parse_number("-1.1") + 1);
}
test_parse_number();

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,4 @@
module test_split_str() {
echo("==== test_split_str ===="); echo("==== test_split_str ====");
include <unittest.scad>; include <unittest.scad>;
@@ -5,3 +6,6 @@ include <sub_str.scad>;
include <split_str.scad>; include <split_str.scad>;
assertEqual(["hello", "world"], split_str("hello,world", ",")); assertEqual(["hello", "world"], split_str("hello,world", ","));
}
test_split_str();

View File

@@ -1,3 +1,4 @@
module test_sub_str() {
echo("==== test_sub_str ===="); echo("==== test_sub_str ====");
include <unittest.scad>; include <unittest.scad>;
@@ -5,3 +6,6 @@ include <sub_str.scad>;
assertEqual("hello", sub_str("helloworld", 0, 5)); assertEqual("hello", sub_str("helloworld", 0, 5));
assertEqual("world", sub_str("helloworld", 5)); assertEqual("world", sub_str("helloworld", 5));
}
test_sub_str();