1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
This commit is contained in:
Justin Lin 2020-03-17 14:23:18 +08:00
parent 737791e5bc
commit 9beae1f12a
5 changed files with 14 additions and 14 deletions

View File

@ -26,7 +26,6 @@ include <test_trim_shape.scad>;
include <test_midpt_smooth.scad>; include <test_midpt_smooth.scad>;
// Path // Path
include <test_circle_path.scad>;
include <test_bezier_curve.scad>; include <test_bezier_curve.scad>;
include <test_bezier_surface.scad>; include <test_bezier_surface.scad>;
include <test_bezier_smooth.scad>; include <test_bezier_smooth.scad>;
@ -41,6 +40,7 @@ include <test_ellipse_extrude.scad>;
include <test_stereographic_extrude.scad>; include <test_stereographic_extrude.scad>;
// 2D Shape // 2D Shape
include <test_shape_circle.scad>;
include <test_shape_arc.scad>; include <test_shape_arc.scad>;
include <test_shape_cyclicpolygon.scad>; include <test_shape_cyclicpolygon.scad>;
include <test_shape_ellipse.scad>; include <test_shape_ellipse.scad>;

View File

@ -1,5 +1,5 @@
use <unittest.scad>; use <unittest.scad>;
use <circle_path.scad>; use <shape_circle.scad>;
include <along_with.scad>; include <along_with.scad>;
module test_along_with_angles(angles, children) { module test_along_with_angles(angles, children) {
@ -21,7 +21,7 @@ module test_along_with_default_angles() {
echo("==== test_along_with_default_angles ===="); echo("==== test_along_with_default_angles ====");
$fn = 24; $fn = 24;
points = circle_path(radius = 50); points = shape_circle(radius = 50);
along_with(points, method = "EULER_ANGLE") along_with(points, method = "EULER_ANGLE")
sphere(5); sphere(5);
} }
@ -30,7 +30,7 @@ module test_along_with_children() {
echo("==== test_along_with_children ===="); echo("==== test_along_with_children ====");
$fn = 24; $fn = 24;
points = circle_path(radius = 50); points = shape_circle(radius = 50);
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);

View File

@ -1,5 +1,5 @@
use <unittest.scad>; use <unittest.scad>;
use <circle_path.scad>; use <shape_circle.scad>;
include <golden_spiral_extrude.scad>; include <golden_spiral_extrude.scad>;
module test_golden_spiral_extrude(sections, triangles) { module test_golden_spiral_extrude(sections, triangles) {
@ -48,8 +48,8 @@ module test_golden_spiral_extrude_hollow() {
$fn = 12; $fn = 12;
shape_pts = concat( shape_pts = concat(
circle_path(radius = 3), shape_circle(radius = 3),
circle_path(radius = 2) shape_circle(radius = 2)
); );
golden_spiral_extrude( golden_spiral_extrude(

View File

@ -1,15 +1,15 @@
use <unittest.scad>; use <unittest.scad>;
use <circle_path.scad>; use <shape_circle.scad>;
module test_circle_path() { module test_shape_circle() {
echo("==== test_circle_path ===="); echo("==== test_shape_circle ====");
$fn = 24; $fn = 24;
expected = [[50, 0], [48.2963, 12.941], [43.3013, 25], [35.3553, 35.3553], [25, 43.3013], [12.941, 48.2963], [0, 50], [-12.941, 48.2963], [-25, 43.3013], [-35.3553, 35.3553], [-43.3013, 25], [-48.2963, 12.941], [-50, 0], [-48.2963, -12.941], [-43.3013, -25], [-35.3553, -35.3553], [-25, -43.3013], [-12.941, -48.2963], [0, -50], [12.941, -48.2963], [25, -43.3013], [35.3553, -35.3553], [43.3013, -25], [48.2963, -12.941]]; expected = [[50, 0], [48.2963, 12.941], [43.3013, 25], [35.3553, 35.3553], [25, 43.3013], [12.941, 48.2963], [0, 50], [-12.941, 48.2963], [-25, 43.3013], [-35.3553, 35.3553], [-43.3013, 25], [-48.2963, 12.941], [-50, 0], [-48.2963, -12.941], [-43.3013, -25], [-35.3553, -35.3553], [-25, -43.3013], [-12.941, -48.2963], [0, -50], [12.941, -48.2963], [25, -43.3013], [35.3553, -35.3553], [43.3013, -25], [48.2963, -12.941]];
actual = circle_path(radius = 50); actual = shape_circle(radius = 50);
assertEqualPoints(expected, actual); assertEqualPoints(expected, actual);
} }
test_circle_path(); test_shape_circle();

View File

@ -1,7 +1,7 @@
use <unittest.scad>; use <unittest.scad>;
use <shape_path_extend.scad>; use <shape_path_extend.scad>;
use <circle_path.scad>; use <shape_circle.scad>;
use <archimedean_spiral.scad>; use <archimedean_spiral.scad>;
module test_shape_path_extend_stroke1() { module test_shape_path_extend_stroke1() {
@ -9,7 +9,7 @@ module test_shape_path_extend_stroke1() {
$fn = 96; $fn = 96;
stroke1 = [[-5, 2.5], [-2.5, 0], [0, 2.5], [2.5, 0], [5, 2.5]]; stroke1 = [[-5, 2.5], [-2.5, 0], [0, 2.5], [2.5, 0], [5, 2.5]];
path_pts1 = circle_path(50, 60); path_pts1 = shape_circle(50, 60);
expected = [[44.9209, 2.3351], [47.5013, -0.0818], [49.9182, 2.4987], [52.4987, 0.0818], [54.9155, 2.6623], [54.8085, 5.9324], [54.3031, 9.5044], [53.5652, 13.0356], [52.598, 16.511], [51.4055, 19.9157], [49.9929, 23.2352], [48.3662, 26.4551], [46.5324, 29.5618], [44.4993, 32.5419], [42.2757, 35.3826], [39.8711, 38.0718], [37.2957, 40.598], [34.5606, 42.9503], [31.6775, 45.1187], [28.6588, 47.0939], [25.5173, 48.8675], [22.2666, 50.4317], [18.9205, 51.7801], [15.4935, 52.9067], [12, 53.8067], [8.4552, 54.4763], [4.8742, 54.9127], [1.2723, 55.1139], [-2.3351, 55.0791], [-5.9324, 54.8085], [-9.5044, 54.3031], [-13.0356, 53.5652], [-16.511, 52.598], [-19.9157, 51.4055], [-23.2352, 49.9929], [-26.4551, 48.3662], [-29.5618, 46.5324], [-32.5419, 44.4993], [-35.3826, 42.2757], [-38.0718, 39.8711], [-40.598, 37.2957], [-42.9503, 34.5606], [-45.1187, 31.6775], [-47.0939, 28.6588], [-48.8675, 25.5173], [-50.4317, 22.2666], [-51.7801, 18.9205], [-52.9067, 15.4935], [-53.8067, 12], [-54.4763, 8.4552], [-54.9127, 4.8742], [-55.1139, 1.2723], [-55.0791, -2.3351], [-54.8085, -5.9324], [-54.3031, -9.5044], [-53.5652, -13.0356], [-52.598, -16.511], [-51.4055, -19.9157], [-49.9929, -23.2352], [-48.3662, -26.4551], [-46.5324, -29.5618], [-44.4993, -32.5419], [-42.2757, -35.3826], [-39.8711, -38.0718], [-39.5245, -34.5533], [-36.006, -34.8998], [-35.6595, -31.3813], [-32.141, -31.7279], [-32.141, -31.7279], [-34.1472, -29.5578], [-36.0073, -27.2612], [-37.7132, -24.8478], [-39.2576, -22.3281], [-40.6338, -19.7127], [-41.8361, -17.0129], [-42.8592, -14.2403], [-43.6988, -11.4066], [-44.3513, -8.5242], [-44.8138, -5.6052], [-45.0845, -2.6623], [-45.1621, 0.2921], [-45.0463, 3.2452], [-44.7376, 6.1844], [-44.2373, 9.0972], [-43.5476, 11.971], [-42.6714, 14.7935], [-41.6125, 17.5526], [-40.3754, 20.2367], [-38.9654, 22.834], [-37.3886, 25.3336], [-35.6517, 27.7247], [-33.762, 29.997], [-31.7279, 32.141], [-29.5578, 34.1472], [-27.2612, 36.0073], [-24.8478, 37.7132], [-22.3281, 39.2576], [-19.7127, 40.6338], [-17.0129, 41.8361], [-14.2403, 42.8592], [-11.4066, 43.6988], [-8.5242, 44.3513], [-5.6052, 44.8138], [-2.6623, 45.0845], [0.2921, 45.1621], [3.2452, 45.0463], [6.1844, 44.7376], [9.0972, 44.2373], [11.971, 43.5476], [14.7935, 42.6714], [17.5526, 41.6125], [20.2367, 40.3754], [22.834, 38.9654], [25.3336, 37.3886], [27.7247, 35.6517], [29.997, 33.762], [32.141, 31.7279], [34.1472, 29.5578], [36.0073, 27.2612], [37.7132, 24.8478], [39.2576, 22.3281], [40.6338, 19.7127], [41.8361, 17.0129], [42.8592, 14.2403], [43.6988, 11.4066], [44.3513, 8.5242]]; expected = [[44.9209, 2.3351], [47.5013, -0.0818], [49.9182, 2.4987], [52.4987, 0.0818], [54.9155, 2.6623], [54.8085, 5.9324], [54.3031, 9.5044], [53.5652, 13.0356], [52.598, 16.511], [51.4055, 19.9157], [49.9929, 23.2352], [48.3662, 26.4551], [46.5324, 29.5618], [44.4993, 32.5419], [42.2757, 35.3826], [39.8711, 38.0718], [37.2957, 40.598], [34.5606, 42.9503], [31.6775, 45.1187], [28.6588, 47.0939], [25.5173, 48.8675], [22.2666, 50.4317], [18.9205, 51.7801], [15.4935, 52.9067], [12, 53.8067], [8.4552, 54.4763], [4.8742, 54.9127], [1.2723, 55.1139], [-2.3351, 55.0791], [-5.9324, 54.8085], [-9.5044, 54.3031], [-13.0356, 53.5652], [-16.511, 52.598], [-19.9157, 51.4055], [-23.2352, 49.9929], [-26.4551, 48.3662], [-29.5618, 46.5324], [-32.5419, 44.4993], [-35.3826, 42.2757], [-38.0718, 39.8711], [-40.598, 37.2957], [-42.9503, 34.5606], [-45.1187, 31.6775], [-47.0939, 28.6588], [-48.8675, 25.5173], [-50.4317, 22.2666], [-51.7801, 18.9205], [-52.9067, 15.4935], [-53.8067, 12], [-54.4763, 8.4552], [-54.9127, 4.8742], [-55.1139, 1.2723], [-55.0791, -2.3351], [-54.8085, -5.9324], [-54.3031, -9.5044], [-53.5652, -13.0356], [-52.598, -16.511], [-51.4055, -19.9157], [-49.9929, -23.2352], [-48.3662, -26.4551], [-46.5324, -29.5618], [-44.4993, -32.5419], [-42.2757, -35.3826], [-39.8711, -38.0718], [-39.5245, -34.5533], [-36.006, -34.8998], [-35.6595, -31.3813], [-32.141, -31.7279], [-32.141, -31.7279], [-34.1472, -29.5578], [-36.0073, -27.2612], [-37.7132, -24.8478], [-39.2576, -22.3281], [-40.6338, -19.7127], [-41.8361, -17.0129], [-42.8592, -14.2403], [-43.6988, -11.4066], [-44.3513, -8.5242], [-44.8138, -5.6052], [-45.0845, -2.6623], [-45.1621, 0.2921], [-45.0463, 3.2452], [-44.7376, 6.1844], [-44.2373, 9.0972], [-43.5476, 11.971], [-42.6714, 14.7935], [-41.6125, 17.5526], [-40.3754, 20.2367], [-38.9654, 22.834], [-37.3886, 25.3336], [-35.6517, 27.7247], [-33.762, 29.997], [-31.7279, 32.141], [-29.5578, 34.1472], [-27.2612, 36.0073], [-24.8478, 37.7132], [-22.3281, 39.2576], [-19.7127, 40.6338], [-17.0129, 41.8361], [-14.2403, 42.8592], [-11.4066, 43.6988], [-8.5242, 44.3513], [-5.6052, 44.8138], [-2.6623, 45.0845], [0.2921, 45.1621], [3.2452, 45.0463], [6.1844, 44.7376], [9.0972, 44.2373], [11.971, 43.5476], [14.7935, 42.6714], [17.5526, 41.6125], [20.2367, 40.3754], [22.834, 38.9654], [25.3336, 37.3886], [27.7247, 35.6517], [29.997, 33.762], [32.141, 31.7279], [34.1472, 29.5578], [36.0073, 27.2612], [37.7132, 24.8478], [39.2576, 22.3281], [40.6338, 19.7127], [41.8361, 17.0129], [42.8592, 14.2403], [43.6988, 11.4066], [44.3513, 8.5242]];