mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-04 05:47:43 +02:00
del semicolon of use/include
This commit is contained in:
@@ -18,13 +18,13 @@ OpenSCAD uses three library locations, the installation library, built-in librar
|
|||||||
|
|
||||||
Every public module/function has the same name as the .scad file. Here's an example using the `line2d` module:
|
Every public module/function has the same name as the .scad file. Here's an example using the `line2d` module:
|
||||||
|
|
||||||
use <line2d.scad>;
|
use <line2d.scad>
|
||||||
|
|
||||||
line2d(p1 = [0, 0], p2 = [5, 0], width = 1);
|
line2d(p1 = [0, 0], p2 = [5, 0], width = 1);
|
||||||
|
|
||||||
The library uses directories to categorize some modules/functions. For example, vx_circle.scad exists in `voxel` directory. Prefix the directory name when using `vx_circle`.
|
The library uses directories to categorize some modules/functions. For example, vx_circle.scad exists in `voxel` directory. Prefix the directory name when using `vx_circle`.
|
||||||
|
|
||||||
use <voxel/vx_circle.scad>;
|
use <voxel/vx_circle.scad>
|
||||||
|
|
||||||
points = vx_circle(radius = 10);
|
points = vx_circle(radius = 10);
|
||||||
for(pt = points) {
|
for(pt = points) {
|
||||||
|
@@ -12,8 +12,8 @@ If you want to place objects precisely, their points and angles are required. Wh
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <along_with.scad>;
|
use <along_with.scad>
|
||||||
use <shape_circle.scad>;
|
use <shape_circle.scad>
|
||||||
|
|
||||||
$fn = 24;
|
$fn = 24;
|
||||||
|
|
||||||
@@ -24,8 +24,8 @@ If you want to place objects precisely, their points and angles are required. Wh
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <along_with.scad>;
|
use <along_with.scad>
|
||||||
use <shape_circle.scad>;
|
use <shape_circle.scad>
|
||||||
|
|
||||||
$fn = 24;
|
$fn = 24;
|
||||||
|
|
||||||
@@ -44,8 +44,8 @@ If you want to place objects precisely, their points and angles are required. Wh
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <along_with.scad>;
|
use <along_with.scad>
|
||||||
use <golden_spiral.scad>;
|
use <golden_spiral.scad>
|
||||||
|
|
||||||
pts_angles = golden_spiral(
|
pts_angles = golden_spiral(
|
||||||
from = 5,
|
from = 5,
|
||||||
@@ -63,8 +63,8 @@ If you want to place objects precisely, their points and angles are required. Wh
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <bezier_curve.scad>;
|
use <bezier_curve.scad>
|
||||||
use <along_with.scad>;
|
use <along_with.scad>
|
||||||
|
|
||||||
module scales() {
|
module scales() {
|
||||||
module one_scale() {
|
module one_scale() {
|
||||||
|
@@ -11,7 +11,7 @@ Returns the angle between two vectors.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <angle_between.scad>;
|
use <angle_between.scad>
|
||||||
|
|
||||||
assert(angle_between([0, 1], [1, 0]) == 90);
|
assert(angle_between([0, 1], [1, 0]) == 90);
|
||||||
assert(angle_between([0, 1, 0], [1, 0, 0]) == 90);
|
assert(angle_between([0, 1, 0], [1, 0, 0]) == 90);
|
||||||
|
@@ -13,7 +13,7 @@ Creates an arc. You can pass a 2 element vector to define the central angle. Its
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <arc.scad>;
|
use <arc.scad>
|
||||||
|
|
||||||
$fn = 24;
|
$fn = 24;
|
||||||
arc(radius = 20, angle = [45, 290], width = 2);
|
arc(radius = 20, angle = [45, 290], width = 2);
|
||||||
@@ -21,7 +21,7 @@ Creates an arc. You can pass a 2 element vector to define the central angle. Its
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <arc.scad>;
|
use <arc.scad>
|
||||||
|
|
||||||
$fn = 24;
|
$fn = 24;
|
||||||
arc(radius = 20, angle = [45, 290], width = 2, width_mode = "LINE_OUTWARD");
|
arc(radius = 20, angle = [45, 290], width = 2, width_mode = "LINE_OUTWARD");
|
||||||
@@ -29,7 +29,7 @@ Creates an arc. You can pass a 2 element vector to define the central angle. Its
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <arc.scad>;
|
use <arc.scad>
|
||||||
|
|
||||||
$fn = 24;
|
$fn = 24;
|
||||||
arc(radius = 20, angle = [45, 290], width = 2, width_mode = "LINE_INWARD");
|
arc(radius = 20, angle = [45, 290], width = 2, width_mode = "LINE_INWARD");
|
||||||
|
@@ -11,8 +11,8 @@ Creates an arc path. You can pass a 2 element vector to define the central angle
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <arc_path.scad>;
|
use <arc_path.scad>
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
|
|
||||||
$fn = 24;
|
$fn = 24;
|
||||||
points = arc_path(radius = 20, angle = [45, 290]);
|
points = arc_path(radius = 20, angle = [45, 290]);
|
||||||
@@ -21,8 +21,8 @@ Creates an arc path. You can pass a 2 element vector to define the central angle
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <arc_path.scad>;
|
use <arc_path.scad>
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
|
|
||||||
$fn = 24;
|
$fn = 24;
|
||||||
points = arc_path(radius = 20, angle = 135);
|
points = arc_path(radius = 20, angle = 135);
|
||||||
|
@@ -16,8 +16,8 @@ An `init_angle` less than 180 degrees is not recommended because the function us
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <polyline2d.scad>;
|
use <polyline2d.scad>
|
||||||
use <archimedean_spiral.scad>;
|
use <archimedean_spiral.scad>
|
||||||
|
|
||||||
points_angles = archimedean_spiral(
|
points_angles = archimedean_spiral(
|
||||||
arm_distance = 10,
|
arm_distance = 10,
|
||||||
@@ -32,7 +32,7 @@ An `init_angle` less than 180 degrees is not recommended because the function us
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <archimedean_spiral.scad>;
|
use <archimedean_spiral.scad>
|
||||||
|
|
||||||
points_angles = archimedean_spiral(
|
points_angles = archimedean_spiral(
|
||||||
arm_distance = 10,
|
arm_distance = 10,
|
||||||
@@ -48,7 +48,7 @@ An `init_angle` less than 180 degrees is not recommended because the function us
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <archimedean_spiral.scad>;
|
use <archimedean_spiral.scad>
|
||||||
|
|
||||||
t = "3.141592653589793238462643383279502884197169399375105820974944592307816406286";
|
t = "3.141592653589793238462643383279502884197169399375105820974944592307816406286";
|
||||||
|
|
||||||
|
@@ -14,7 +14,7 @@ When using this module, you should use points to represent the 2D shape. If your
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <archimedean_spiral_extrude.scad>;
|
use <archimedean_spiral_extrude.scad>
|
||||||
|
|
||||||
shape_pts = [
|
shape_pts = [
|
||||||
[5, 0],
|
[5, 0],
|
||||||
|
@@ -14,8 +14,8 @@ Creates visually even spacing of n points on the surface of the sphere. Successi
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <bauer_spiral.scad>;
|
use <bauer_spiral.scad>
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
|
|
||||||
n = 200;
|
n = 200;
|
||||||
radius = 20;
|
radius = 20;
|
||||||
|
@@ -12,7 +12,7 @@ Bends a 3D object into an arc shape.
|
|||||||
|
|
||||||
The containing cube of the target object should be laid down on the x-y plane. For example.
|
The containing cube of the target object should be laid down on the x-y plane. For example.
|
||||||
|
|
||||||
use <bend.scad>;
|
use <bend.scad>
|
||||||
|
|
||||||
x = 9.25;
|
x = 9.25;
|
||||||
y = 9.55;
|
y = 9.55;
|
||||||
@@ -25,7 +25,7 @@ The containing cube of the target object should be laid down on the x-y plane. F
|
|||||||
|
|
||||||
Once you have the size of the containing cube, you can use it as the `size` argument of the `bend` module.
|
Once you have the size of the containing cube, you can use it as the `size` argument of the `bend` module.
|
||||||
|
|
||||||
use <bend.scad>;
|
use <bend.scad>
|
||||||
|
|
||||||
x = 9.25;
|
x = 9.25;
|
||||||
y = 9.55;
|
y = 9.55;
|
||||||
@@ -41,7 +41,7 @@ Once you have the size of the containing cube, you can use it as the `size` argu
|
|||||||
|
|
||||||
The arc shape is smoother if the `frags` value is larger.
|
The arc shape is smoother if the `frags` value is larger.
|
||||||
|
|
||||||
use <bend.scad>;
|
use <bend.scad>
|
||||||
|
|
||||||
x = 9.25;
|
x = 9.25;
|
||||||
y = 9.55;
|
y = 9.55;
|
||||||
|
@@ -25,7 +25,7 @@ The containing square of the target shape should be laid down on the x-y plane.
|
|||||||
|
|
||||||
Once you have the size of the containing square, you can use it as the `size` argument of the `bend_extrude` module.
|
Once you have the size of the containing square, you can use it as the `size` argument of the `bend_extrude` module.
|
||||||
|
|
||||||
use <bend_extrude.scad>;
|
use <bend_extrude.scad>
|
||||||
|
|
||||||
x = 9.25;
|
x = 9.25;
|
||||||
y = 9.55;
|
y = 9.55;
|
||||||
|
@@ -11,8 +11,8 @@ Given a set of control points, the `bezier_curve` function returns points of the
|
|||||||
|
|
||||||
If you have four control points:
|
If you have four control points:
|
||||||
|
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
use <bezier_curve.scad>;
|
use <bezier_curve.scad>
|
||||||
|
|
||||||
t_step = 0.05;
|
t_step = 0.05;
|
||||||
radius = 2;
|
radius = 2;
|
||||||
|
@@ -12,8 +12,8 @@ Given a path, the `bezier_smooth` function uses bazier curves to smooth all corn
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
use <bezier_smooth.scad>;
|
use <bezier_smooth.scad>
|
||||||
|
|
||||||
width = 2;
|
width = 2;
|
||||||
round_d = 15;
|
round_d = 15;
|
||||||
@@ -37,7 +37,7 @@ Given a path, the `bezier_smooth` function uses bazier curves to smooth all corn
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <bezier_smooth.scad>;
|
use <bezier_smooth.scad>
|
||||||
|
|
||||||
round_d = 10;
|
round_d = 10;
|
||||||
|
|
||||||
|
@@ -12,7 +12,7 @@ Move 2D outlines outward or inward by a given amount. Each point of the offsette
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <bijection_offset.scad>;
|
use <bijection_offset.scad>
|
||||||
|
|
||||||
shape = [
|
shape = [
|
||||||
[15, 0],
|
[15, 0],
|
||||||
@@ -32,9 +32,9 @@ Move 2D outlines outward or inward by a given amount. Each point of the offsette
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <bijection_offset.scad>;
|
use <bijection_offset.scad>
|
||||||
use <path_extrude.scad>;
|
use <path_extrude.scad>
|
||||||
use <bezier_curve.scad>;
|
use <bezier_curve.scad>
|
||||||
|
|
||||||
shape = [
|
shape = [
|
||||||
[5, 0],
|
[5, 0],
|
||||||
|
@@ -13,8 +13,8 @@ A general-purpose function to search a value in a sorted list.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/sorted.scad>;
|
use <util/sorted.scad>
|
||||||
use <util/binary_search.scad>;
|
use <util/binary_search.scad>
|
||||||
|
|
||||||
points = [[1, 1], [3, 4], [7, 2], [5, 2]];
|
points = [[1, 1], [3, 4], [7, 2], [5, 2]];
|
||||||
lt = sorted(points); // [[1, 1], [3, 4], [5, 2], [7, 2]]
|
lt = sorted(points); // [[1, 1], [3, 4], [5, 2], [7, 2]]
|
||||||
|
@@ -12,14 +12,14 @@ Creates a box (container) from a 2D object.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <box_extrude.scad>;
|
use <box_extrude.scad>
|
||||||
|
|
||||||
box_extrude(height = 30, shell_thickness = 2)
|
box_extrude(height = 30, shell_thickness = 2)
|
||||||
circle(r = 30);
|
circle(r = 30);
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <box_extrude.scad>;
|
use <box_extrude.scad>
|
||||||
|
|
||||||
box_extrude(height = 30, shell_thickness = 2)
|
box_extrude(height = 30, shell_thickness = 2)
|
||||||
text("XD", size = 40, font = "Cooper Black");
|
text("XD", size = 40, font = "Cooper Black");
|
||||||
|
@@ -11,8 +11,8 @@ The `bsearch` function is a general-purpose function to search a value in a list
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/sort.scad>;
|
use <util/sort.scad>
|
||||||
use <util/bsearch.scad>;
|
use <util/bsearch.scad>
|
||||||
|
|
||||||
points = [[1, 1], [3, 4], [7, 2], [5, 2]];
|
points = [[1, 1], [3, 4], [7, 2], [5, 2]];
|
||||||
sorted = sort(points, by = "vt"); // [[1, 1], [5, 2], [7, 2], [3, 4]]
|
sorted = sort(points, by = "vt"); // [[1, 1], [5, 2], [7, 2], [3, 4]]
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <bspline_curve.scad>;
|
use <bspline_curve.scad>
|
||||||
|
|
||||||
points = [
|
points = [
|
||||||
[-10, 0],
|
[-10, 0],
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <bspline_curve.scad>;
|
use <bspline_curve.scad>
|
||||||
|
|
||||||
points = [
|
points = [
|
||||||
[-10, 0],
|
[-10, 0],
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <bspline_curve.scad>;
|
use <bspline_curve.scad>
|
||||||
|
|
||||||
points = [
|
points = [
|
||||||
[-10, 0],
|
[-10, 0],
|
||||||
|
@@ -11,6 +11,6 @@ Choose an element from the given list randomly.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/choose.scad>;
|
use <util/choose.scad>
|
||||||
|
|
||||||
echo(choose([1, 2, 3, 4]));
|
echo(choose([1, 2, 3, 4]));
|
@@ -10,7 +10,7 @@ Sometimes you need all points on the path of a circle. Here's the function. Its
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <circle_path.scad>;
|
use <circle_path.scad>
|
||||||
|
|
||||||
$fn = 24;
|
$fn = 24;
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@ Create a cone for rotatable models.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <part/cone.scad>;
|
use <part/cone.scad>
|
||||||
|
|
||||||
radius = 2.5;
|
radius = 2.5;
|
||||||
length = 2;
|
length = 2;
|
||||||
@@ -41,7 +41,7 @@ Create a cone for rotatable models.
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <part/cone.scad>;
|
use <part/cone.scad>
|
||||||
|
|
||||||
radius = 2.5;
|
radius = 2.5;
|
||||||
length = 2;
|
length = 2;
|
||||||
|
@@ -17,7 +17,7 @@ Create a connector peg.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <part/connector_peg.scad>;
|
use <part/connector_peg.scad>
|
||||||
|
|
||||||
radius = 2.5;
|
radius = 2.5;
|
||||||
spacing = 0.5;
|
spacing = 0.5;
|
||||||
@@ -37,7 +37,7 @@ Create a connector peg.
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <part/connector_peg.scad>;
|
use <part/connector_peg.scad>
|
||||||
|
|
||||||
radius = 2.5;
|
radius = 2.5;
|
||||||
spacing = 0.5;
|
spacing = 0.5;
|
||||||
|
@@ -11,8 +11,8 @@ If `lt` contains `elem`, this function returns `true`.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <voxel/vx_circle.scad>;
|
use <voxel/vx_circle.scad>
|
||||||
use <util/contains.scad>;
|
use <util/contains.scad>
|
||||||
|
|
||||||
pts = vx_circle(10);
|
pts = vx_circle(10);
|
||||||
assert(contains(pts, [2, -10]));
|
assert(contains(pts, [2, -10]));
|
||||||
|
@@ -11,9 +11,9 @@ Computes contour polygons by applying [marching squares](https://en.wikipedia.or
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
use <surface/sf_thicken.scad>;
|
use <surface/sf_thicken.scad>
|
||||||
use <contours.scad>;
|
use <contours.scad>
|
||||||
|
|
||||||
min_value = 1;
|
min_value = 1;
|
||||||
max_value = 360;
|
max_value = 360;
|
||||||
|
@@ -12,9 +12,9 @@ Given a 2D shape, points and angles along the path, this function will return al
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <sweep.scad>;
|
use <sweep.scad>
|
||||||
use <cross_sections.scad>;
|
use <cross_sections.scad>
|
||||||
use <archimedean_spiral.scad>;
|
use <archimedean_spiral.scad>
|
||||||
|
|
||||||
shape_pts = [
|
shape_pts = [
|
||||||
[-2, -10],
|
[-2, -10],
|
||||||
|
@@ -14,7 +14,7 @@ Uses spherical coordinate system to create a crystal ball.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <crystal_ball.scad>;
|
use <crystal_ball.scad>
|
||||||
|
|
||||||
crystal_ball(radius = 6);
|
crystal_ball(radius = 6);
|
||||||
|
|
||||||
|
@@ -16,8 +16,8 @@ Draws a curved line from control points. The curve is drawn only from the 2nd co
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <curve.scad>;
|
use <curve.scad>
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
|
|
||||||
pts = [
|
pts = [
|
||||||
[28, 2, 1],
|
[28, 2, 1],
|
||||||
|
@@ -10,6 +10,6 @@ Converts a radian measurement to the corresponding value in degrees.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/degrees.scad>;
|
use <util/degrees.scad>
|
||||||
|
|
||||||
assert(degrees(PI) == 180);
|
assert(degrees(PI) == 180);
|
||||||
|
@@ -10,7 +10,7 @@ Extrudes a 2D object along the path of an ellipse from 0 to 180 degrees. The sem
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <ellipse_extrude.scad>;
|
use <ellipse_extrude.scad>
|
||||||
|
|
||||||
semi_minor_axis = 5;
|
semi_minor_axis = 5;
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ Extrudes a 2D object along the path of an ellipse from 0 to 180 degrees. The sem
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <ellipse_extrude.scad>;
|
use <ellipse_extrude.scad>
|
||||||
|
|
||||||
semi_minor_axis = 5;
|
semi_minor_axis = 5;
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ Extrudes a 2D object along the path of an ellipse from 0 to 180 degrees. The sem
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <ellipse_extrude.scad>;
|
use <ellipse_extrude.scad>
|
||||||
|
|
||||||
semi_minor_axis = 5;
|
semi_minor_axis = 5;
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ Extrudes a 2D object along the path of an ellipse from 0 to 180 degrees. The sem
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <ellipse_extrude.scad>;
|
use <ellipse_extrude.scad>
|
||||||
|
|
||||||
semi_minor_axis = 10;
|
semi_minor_axis = 10;
|
||||||
|
|
||||||
|
@@ -11,7 +11,7 @@ The `every` function tests whether all elements in the list pass the test implem
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/every.scad>;
|
use <util/every.scad>
|
||||||
|
|
||||||
biggerThanZero = function(elem) elem > 0;
|
biggerThanZero = function(elem) elem > 0;
|
||||||
assert(every([1, 30, 39, 29, 10, 13], biggerThanZero));
|
assert(every([1, 30, 39, 29, 10, 13], biggerThanZero));
|
@@ -14,7 +14,7 @@ Creates visually even spacing of n points on the surface of the sphere. Nearest-
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <fibonacci_lattice.scad>;
|
use <fibonacci_lattice.scad>
|
||||||
|
|
||||||
n = 200;
|
n = 200;
|
||||||
radius = 20;
|
radius = 20;
|
||||||
@@ -30,8 +30,8 @@ Creates visually even spacing of n points on the surface of the sphere. Nearest-
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <fibonacci_lattice.scad>;
|
use <fibonacci_lattice.scad>
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
|
|
||||||
n = 200;
|
n = 200;
|
||||||
radius = 20;
|
radius = 20;
|
||||||
|
@@ -11,6 +11,6 @@ Generate a Fibonacci sequence.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/fibseq.scad>;
|
use <util/fibseq.scad>
|
||||||
|
|
||||||
echo(fibseq(1, 10)); // ECHO: [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
|
echo(fibseq(1, 10)); // ECHO: [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
|
||||||
|
@@ -11,6 +11,6 @@ Returns the index of the first element in the list that satisfies the testing fu
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/find_index.scad>;
|
use <util/find_index.scad>
|
||||||
|
|
||||||
assert(find_index([10, 20, 30, 40], function(e) e > 10) == 1);
|
assert(find_index([10, 20, 30, 40], function(e) e > 10) == 1);
|
@@ -11,7 +11,7 @@ returns a new list with all sub-list elements concatenated into it recursively u
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/flat.scad>;
|
use <util/flat.scad>
|
||||||
|
|
||||||
vt = [[[[1, 2], [3, 4]], [[5, 6], [7, 8]]]];
|
vt = [[[[1, 2], [3, 4]], [[5, 6], [7, 8]]]];
|
||||||
|
|
||||||
|
@@ -11,8 +11,8 @@ Drive a turtle with `["forward", length]` or `["turn", angle]`. This function is
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
use <turtle/footprints2.scad>;
|
use <turtle/footprints2.scad>
|
||||||
|
|
||||||
function arc_cmds(radius, angle, steps) =
|
function arc_cmds(radius, angle, steps) =
|
||||||
let(
|
let(
|
||||||
|
@@ -11,8 +11,8 @@ A 3D verion of [footprint2](https://openhome.cc/eGossip/OpenSCAD/lib3x-footprint
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
use <turtle/footprints3.scad>;
|
use <turtle/footprints3.scad>
|
||||||
|
|
||||||
function xy_arc_cmds(radius, angle, steps) =
|
function xy_arc_cmds(radius, angle, steps) =
|
||||||
let(
|
let(
|
||||||
|
@@ -13,7 +13,7 @@ It returns a vector of `[[x, y], angle]`.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <golden_spiral.scad>;
|
use <golden_spiral.scad>
|
||||||
|
|
||||||
pts_angles = golden_spiral(
|
pts_angles = golden_spiral(
|
||||||
from = 3,
|
from = 3,
|
||||||
@@ -28,7 +28,7 @@ It returns a vector of `[[x, y], angle]`.
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <golden_spiral.scad>;
|
use <golden_spiral.scad>
|
||||||
|
|
||||||
pts_angles = golden_spiral(
|
pts_angles = golden_spiral(
|
||||||
from = 5,
|
from = 5,
|
||||||
|
@@ -17,7 +17,7 @@ When using this module, you should use points to represent the 2D shape. If your
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <golden_spiral_extrude.scad>;
|
use <golden_spiral_extrude.scad>
|
||||||
|
|
||||||
shape_pts = [
|
shape_pts = [
|
||||||
[2, -10],
|
[2, -10],
|
||||||
@@ -38,8 +38,8 @@ When using this module, you should use points to represent the 2D shape. If your
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <shape_circle.scad>;
|
use <shape_circle.scad>
|
||||||
use <golden_spiral_extrude.scad>;
|
use <golden_spiral_extrude.scad>
|
||||||
|
|
||||||
$fn = 12;
|
$fn = 12;
|
||||||
|
|
||||||
|
@@ -12,9 +12,9 @@ If `lt` contains `elem`, this function returns `true`. If you want to test eleme
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <voxel/vx_circle.scad>;
|
use <voxel/vx_circle.scad>
|
||||||
use <util/sort.scad>;
|
use <util/sort.scad>
|
||||||
use <util/has.scad>;
|
use <util/has.scad>
|
||||||
|
|
||||||
pts = vx_circle(10);
|
pts = vx_circle(10);
|
||||||
assert(has(pts, [2, -10]));
|
assert(has(pts, [2, -10]));
|
||||||
|
@@ -21,14 +21,14 @@ This function maps keys to values. You can use the following to process the retu
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/map/hashmap.scad>;
|
use <util/map/hashmap.scad>
|
||||||
use <util/map/hashmap_len.scad>;
|
use <util/map/hashmap_len.scad>
|
||||||
use <util/map/hashmap_put.scad>;
|
use <util/map/hashmap_put.scad>
|
||||||
use <util/map/hashmap_get.scad>;
|
use <util/map/hashmap_get.scad>
|
||||||
use <util/map/hashmap_del.scad>;
|
use <util/map/hashmap_del.scad>
|
||||||
use <util/map/hashmap_keys.scad>;
|
use <util/map/hashmap_keys.scad>
|
||||||
use <util/map/hashmap_values.scad>;
|
use <util/map/hashmap_values.scad>
|
||||||
use <util/map/hashmap_entries.scad>;
|
use <util/map/hashmap_entries.scad>
|
||||||
|
|
||||||
m1 = hashmap([["k1", 10], ["k2", 20], ["k3", 30]]);
|
m1 = hashmap([["k1", 10], ["k2", 20], ["k3", 30]]);
|
||||||
assert(hashmap_len(m1) == 3);
|
assert(hashmap_len(m1) == 3);
|
||||||
@@ -45,8 +45,8 @@ This function maps keys to values. You can use the following to process the retu
|
|||||||
|
|
||||||
Want to simulate class-based OO in OpenSCAD? Here's my experiment.
|
Want to simulate class-based OO in OpenSCAD? Here's my experiment.
|
||||||
|
|
||||||
use <util/map/hashmap.scad>;
|
use <util/map/hashmap.scad>
|
||||||
use <util/map/hashmap_get.scad>;
|
use <util/map/hashmap_get.scad>
|
||||||
|
|
||||||
function methods(mths) = hashmap(mths);
|
function methods(mths) = hashmap(mths);
|
||||||
function _(name, instance) = hashmap_get(instance, name);
|
function _(name, instance) = hashmap_get(instance, name);
|
||||||
|
@@ -13,9 +13,9 @@ This function deletes the mapping for the specified key from a [util/map/hashmap
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/map/hashmap.scad>;
|
use <util/map/hashmap.scad>
|
||||||
use <util/map/hashmap_get.scad>;
|
use <util/map/hashmap_get.scad>
|
||||||
use <util/map/hashmap_del.scad>;
|
use <util/map/hashmap_del.scad>
|
||||||
|
|
||||||
m1 = hashmap([["k1", 10], ["k2", 20], ["k3", 30]]);
|
m1 = hashmap([["k1", 10], ["k2", 20], ["k3", 30]]);
|
||||||
m2 = hashmap_del(m1, "k1");
|
m2 = hashmap_del(m1, "k1");
|
||||||
|
@@ -10,8 +10,8 @@ Returns a list containing all `[key, value]`s in a [util/map/hashmap](https://op
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/map/hashmap.scad>;
|
use <util/map/hashmap.scad>
|
||||||
use <util/map/hashmap_entries.scad>;
|
use <util/map/hashmap_entries.scad>
|
||||||
|
|
||||||
m = hashmap([["k1", 10], ["k2", 20], ["k3", 30]]);
|
m = hashmap([["k1", 10], ["k2", 20], ["k3", 30]]);
|
||||||
echo(hashmap_entries(m)); // a list contains ["k1", 10], ["k2", 20], ["k3", 30]
|
echo(hashmap_entries(m)); // a list contains ["k1", 10], ["k2", 20], ["k3", 30]
|
||||||
|
@@ -13,8 +13,8 @@ This function gets the value of the specified key from a [util/map/hashmap](http
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/map/hashmap.scad>;
|
use <util/map/hashmap.scad>
|
||||||
use <util/map/hashmap_get.scad>;
|
use <util/map/hashmap_get.scad>
|
||||||
|
|
||||||
m = hashmap([["k1", 10], ["k2", 20], ["k3", 30]]);
|
m = hashmap([["k1", 10], ["k2", 20], ["k3", 30]]);
|
||||||
assert(hashmap_get(m, "k2") == 20);
|
assert(hashmap_get(m, "k2") == 20);
|
@@ -10,8 +10,8 @@ Returns a list containing all keys in a [util/map/hashmap](https://openhome.cc/e
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/map/hashmap.scad>;
|
use <util/map/hashmap.scad>
|
||||||
use <util/map/hashmap_keys.scad>;
|
use <util/map/hashmap_keys.scad>
|
||||||
|
|
||||||
m = hashmap([["k1", 10], ["k2", 20], ["k3", 30]]);
|
m = hashmap([["k1", 10], ["k2", 20], ["k3", 30]]);
|
||||||
|
|
||||||
|
@@ -10,8 +10,8 @@ Returns the length of a [util/map/hashmap](https://openhome.cc/eGossip/OpenSCAD/
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/map/hashmap.scad>;
|
use <util/map/hashmap.scad>
|
||||||
use <util/map/hashmap_len.scad>;
|
use <util/map/hashmap_len.scad>
|
||||||
|
|
||||||
m = hashmap([["k1", 10], ["k2", 20], ["k3", 30]]);
|
m = hashmap([["k1", 10], ["k2", 20], ["k3", 30]]);
|
||||||
assert(hashmap_len(m) == 3);
|
assert(hashmap_len(m) == 3);
|
@@ -14,9 +14,9 @@ Puts a key/value pair to a [util/map/hashmap](https://openhome.cc/eGossip/OpenSC
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/map/hashmap.scad>;
|
use <util/map/hashmap.scad>
|
||||||
use <util/map/hashmap_put.scad>;
|
use <util/map/hashmap_put.scad>
|
||||||
use <util/map/hashmap_get.scad>;
|
use <util/map/hashmap_get.scad>
|
||||||
|
|
||||||
m1 = hashmap([["k1", 10], ["k2", 20], ["k3", 30]]);
|
m1 = hashmap([["k1", 10], ["k2", 20], ["k3", 30]]);
|
||||||
|
|
||||||
|
@@ -10,8 +10,8 @@ Returns a list containing all values in a [util/map/hashmap](https://openhome.cc
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/map/hashmap.scad>;
|
use <util/map/hashmap.scad>
|
||||||
use <util/map/hashmap_values.scad>;
|
use <util/map/hashmap_values.scad>
|
||||||
|
|
||||||
m = hashmap([["k1", 10], ["k2", 20], ["k3", 30]]);
|
m = hashmap([["k1", 10], ["k2", 20], ["k3", 30]]);
|
||||||
|
|
||||||
|
@@ -19,12 +19,12 @@ This function models the mathematical set, backed by a hash table. You can use t
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/set/hashset.scad>;
|
use <util/set/hashset.scad>
|
||||||
use <util/set/hashset_add.scad>;
|
use <util/set/hashset_add.scad>
|
||||||
use <util/set/hashset_has.scad>;
|
use <util/set/hashset_has.scad>
|
||||||
use <util/set/hashset_del.scad>;
|
use <util/set/hashset_del.scad>
|
||||||
use <util/set/hashset_len.scad>;
|
use <util/set/hashset_len.scad>
|
||||||
use <util/set/hashset_elems.scad>;
|
use <util/set/hashset_elems.scad>
|
||||||
|
|
||||||
s1 = hashset([1, 2, 3, 4, 5, 2, 3, 5]);
|
s1 = hashset([1, 2, 3, 4, 5, 2, 3, 5]);
|
||||||
assert(hashset_len(s1) == 5);
|
assert(hashset_len(s1) == 5);
|
||||||
|
@@ -13,9 +13,9 @@ This function adds an element to a [util/set/hashset](https://openhome.cc/eGossi
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/set/hashset.scad>;
|
use <util/set/hashset.scad>
|
||||||
use <util/set/hashset_add.scad>;
|
use <util/set/hashset_add.scad>
|
||||||
use <util/set/hashset_has.scad>;
|
use <util/set/hashset_has.scad>
|
||||||
|
|
||||||
s1 = hashset([1, 2, 3, 4, 5]);
|
s1 = hashset([1, 2, 3, 4, 5]);
|
||||||
s2 = hashset_add(s1, 9);
|
s2 = hashset_add(s1, 9);
|
||||||
|
@@ -13,9 +13,9 @@ This function dels an element from a [util/set/hashset](https://openhome.cc/eGos
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/set/hashset.scad>;
|
use <util/set/hashset.scad>
|
||||||
use <util/set/hashset_del.scad>;
|
use <util/set/hashset_del.scad>
|
||||||
use <util/set/hashset_has.scad>;
|
use <util/set/hashset_has.scad>
|
||||||
|
|
||||||
s1 = hashset([1, 2, 3, 4, 5]);
|
s1 = hashset([1, 2, 3, 4, 5]);
|
||||||
s2 = hashset_del(s1, 3);
|
s2 = hashset_del(s1, 3);
|
||||||
|
@@ -10,8 +10,8 @@ Returns a list containing all elements in a [util/set/hashset](https://openhome.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/set/hashset.scad>;
|
use <util/set/hashset.scad>
|
||||||
use <util/set/hashset_elems.scad>;
|
use <util/set/hashset_elems.scad>
|
||||||
|
|
||||||
s = hashset([1, 2, 3, 4, 5]);
|
s = hashset([1, 2, 3, 4, 5]);
|
||||||
assert(hashset_elems(s) == [1, 2, 3, 4, 5]);
|
assert(hashset_elems(s) == [1, 2, 3, 4, 5]);
|
||||||
|
@@ -13,8 +13,8 @@ Returns `true` if a [util/set/hashset](https://openhome.cc/eGossip/OpenSCAD/lib3
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/set/hashset.scad>;
|
use <util/set/hashset.scad>
|
||||||
use <util/set/hashset_has.scad>;
|
use <util/set/hashset_has.scad>
|
||||||
|
|
||||||
s = hashset([1, 2, 3, 4, 5]);
|
s = hashset([1, 2, 3, 4, 5]);
|
||||||
assert(hashset_has(s, 3));
|
assert(hashset_has(s, 3));
|
||||||
|
@@ -10,8 +10,8 @@ Returns the length of the elements in a [util/set/hashset](https://openhome.cc/e
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/set/hashset.scad>;
|
use <util/set/hashset.scad>
|
||||||
use <util/set/hashset_len.scad>;
|
use <util/set/hashset_len.scad>
|
||||||
|
|
||||||
s = hashset([1, 2, 3, 4, 5]);
|
s = hashset([1, 2, 3, 4, 5]);
|
||||||
assert(hashset_len(s) == 5);
|
assert(hashset_len(s) == 5);
|
||||||
|
@@ -13,8 +13,8 @@ Gets all points on the path of a spiral around a cylinder. Its `$fa`, `$fs` and
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <helix.scad>;
|
use <helix.scad>
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
|
|
||||||
$fn = 12;
|
$fn = 12;
|
||||||
|
|
||||||
@@ -36,8 +36,8 @@ Gets all points on the path of a spiral around a cylinder. Its `$fa`, `$fs` and
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <helix.scad>;
|
use <helix.scad>
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
|
|
||||||
$fn = 12;
|
$fn = 12;
|
||||||
|
|
||||||
|
@@ -21,7 +21,7 @@ Its `$fa`, `$fs` and `$fn` parameters are consistent with the `cylinder` module.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <helix_extrude.scad>;
|
use <helix_extrude.scad>
|
||||||
|
|
||||||
shape_pts = [
|
shape_pts = [
|
||||||
[5, -2],
|
[5, -2],
|
||||||
@@ -43,7 +43,7 @@ Its `$fa`, `$fs` and `$fn` parameters are consistent with the `cylinder` module.
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <helix_extrude.scad>;
|
use <helix_extrude.scad>
|
||||||
|
|
||||||
r1 = 40;
|
r1 = 40;
|
||||||
r2 = 20;
|
r2 = 20;
|
||||||
|
@@ -10,7 +10,7 @@ This module creates hexagons in a hexagon.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <hexagons.scad>;
|
use <hexagons.scad>
|
||||||
|
|
||||||
radius = 20;
|
radius = 20;
|
||||||
spacing = 2;
|
spacing = 2;
|
||||||
@@ -20,7 +20,7 @@ This module creates hexagons in a hexagon.
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <hexagons.scad>;
|
use <hexagons.scad>
|
||||||
|
|
||||||
radius = 20;
|
radius = 20;
|
||||||
spacing = 2;
|
spacing = 2;
|
||||||
|
@@ -8,7 +8,7 @@ Hollows out a 2D object.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <hollow_out.scad>;
|
use <hollow_out.scad>
|
||||||
|
|
||||||
hollow_out(shell_thickness = 1)
|
hollow_out(shell_thickness = 1)
|
||||||
circle(r = 3, $fn = 48);
|
circle(r = 3, $fn = 48);
|
||||||
|
@@ -12,7 +12,7 @@ Checks whether a point is on a line.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <in_polyline.scad>;
|
use <in_polyline.scad>
|
||||||
|
|
||||||
pts = [
|
pts = [
|
||||||
[0, 0],
|
[0, 0],
|
||||||
@@ -27,7 +27,7 @@ Checks whether a point is on a line.
|
|||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
use <in_polyline.scad>;
|
use <in_polyline.scad>
|
||||||
|
|
||||||
pts = [
|
pts = [
|
||||||
[10, 0, 10],
|
[10, 0, 10],
|
||||||
|
@@ -13,8 +13,8 @@ Checks whether a point is inside a shape.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <shape_taiwan.scad>;
|
use <shape_taiwan.scad>
|
||||||
use <in_shape.scad>;
|
use <in_shape.scad>
|
||||||
|
|
||||||
points = shape_taiwan(30);
|
points = shape_taiwan(30);
|
||||||
|
|
||||||
|
@@ -17,7 +17,7 @@ Create a joint_T for rotatable models.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <part/joint_T.scad>;
|
use <part/joint_T.scad>
|
||||||
|
|
||||||
$fn = 48;
|
$fn = 48;
|
||||||
|
|
||||||
|
@@ -12,6 +12,6 @@ Linear interpolate the vector v1 to v2.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/lerp.scad>;
|
use <util/lerp.scad>
|
||||||
|
|
||||||
assert(lerp([0, 0, 0], [100, 100, 100], 0.5) == [50, 50, 50]);
|
assert(lerp([0, 0, 0], [100, 100, 100], 0.5) == [50, 50, 50]);
|
@@ -13,7 +13,7 @@ Creates a line from two points. When the end points are `CAP_ROUND`, you can use
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <line2d.scad>;
|
use <line2d.scad>
|
||||||
|
|
||||||
$fn = 24;
|
$fn = 24;
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ Creates a 3D line from two points.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <line3d.scad>;
|
use <line3d.scad>
|
||||||
|
|
||||||
line3d(
|
line3d(
|
||||||
p1 = [0, 0, 0],
|
p1 = [0, 0, 0],
|
||||||
@@ -24,7 +24,7 @@ Creates a 3D line from two points.
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <line3d.scad>;
|
use <line3d.scad>
|
||||||
|
|
||||||
line3d(
|
line3d(
|
||||||
p1 = [0, 0, 0],
|
p1 = [0, 0, 0],
|
||||||
@@ -37,7 +37,7 @@ Creates a 3D line from two points.
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <line3d.scad>;
|
use <line3d.scad>
|
||||||
|
|
||||||
line3d(
|
line3d(
|
||||||
p1 = [0, 0, 0],
|
p1 = [0, 0, 0],
|
||||||
|
@@ -13,7 +13,7 @@ Find the intersection of two line segments. Return `[]` if lines don't intersect
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <lines_intersection.scad>;
|
use <lines_intersection.scad>
|
||||||
|
|
||||||
line1 = [[0, 0], [0, 10]];
|
line1 = [[0, 0], [0, 10]];
|
||||||
line2 = [[5, 0], [-5, 5]];
|
line2 = [[5, 0], [-5, 5]];
|
||||||
|
@@ -11,10 +11,10 @@ When having uniform cross sections, you can use [sweep](https://openhome.cc/eGos
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <shape_star.scad>;
|
use <shape_star.scad>
|
||||||
use <shape_circle.scad>;
|
use <shape_circle.scad>
|
||||||
use <ptf/ptf_rotate.scad>;
|
use <ptf/ptf_rotate.scad>
|
||||||
use <loft.scad>;
|
use <loft.scad>
|
||||||
|
|
||||||
sects = [
|
sects = [
|
||||||
for(i = 10; i >= 4; i = i - 1)
|
for(i = 10; i >= 4; i = i - 1)
|
||||||
|
@@ -28,8 +28,8 @@
|
|||||||
|
|
||||||
[lsystem2-collections.scad](https://github.com/JustinSDK/dotSCAD/blob/master/examples/turtle/lsystem2_collection.scad) collects several L-system grammars. Here's one of them.
|
[lsystem2-collections.scad](https://github.com/JustinSDK/dotSCAD/blob/master/examples/turtle/lsystem2_collection.scad) collects several L-system grammars. Here's one of them.
|
||||||
|
|
||||||
use <turtle/lsystem2.scad>;
|
use <turtle/lsystem2.scad>
|
||||||
use <line2d.scad>;
|
use <line2d.scad>
|
||||||
|
|
||||||
for(line = fern()) {
|
for(line = fern()) {
|
||||||
line2d(
|
line2d(
|
||||||
@@ -56,8 +56,8 @@
|
|||||||
|
|
||||||
// a stochastic L-system
|
// a stochastic L-system
|
||||||
|
|
||||||
use <turtle/lsystem2.scad>;
|
use <turtle/lsystem2.scad>
|
||||||
use <line2d.scad>;
|
use <line2d.scad>
|
||||||
|
|
||||||
for(line = weed()) {
|
for(line = weed()) {
|
||||||
line2d(
|
line2d(
|
||||||
|
@@ -32,8 +32,8 @@
|
|||||||
|
|
||||||
[lsystem3-collections.scad](https://github.com/JustinSDK/dotSCAD/blob/master/examples/turtle/lsystem3_collection.scad) collects several L-system grammars. Here's one of them.
|
[lsystem3-collections.scad](https://github.com/JustinSDK/dotSCAD/blob/master/examples/turtle/lsystem3_collection.scad) collects several L-system grammars. Here's one of them.
|
||||||
|
|
||||||
use <turtle/lsystem3.scad>;
|
use <turtle/lsystem3.scad>
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
|
|
||||||
for(line = hilbert_curve()) {
|
for(line = hilbert_curve()) {
|
||||||
polyline_join([line[0], line[1]])
|
polyline_join([line[0], line[1]])
|
||||||
@@ -56,8 +56,8 @@
|
|||||||
|
|
||||||
// a stochastic L-system
|
// a stochastic L-system
|
||||||
|
|
||||||
use <turtle/lsystem3.scad>;
|
use <turtle/lsystem3.scad>
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
|
|
||||||
for(line = vine()) {
|
for(line = vine()) {
|
||||||
polyline_join([line[0], line[1]])
|
polyline_join([line[0], line[1]])
|
||||||
|
@@ -10,7 +10,7 @@ It can calculate a determinant, a special number that can be calculated from a s
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <matrix/m_determinant.scad>;
|
use <matrix/m_determinant.scad>
|
||||||
|
|
||||||
assert(
|
assert(
|
||||||
m_determinant([
|
m_determinant([
|
||||||
|
@@ -10,7 +10,7 @@ Generate a 4x4 transformation matrix which can pass into `multmatrix` to mirror
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <matrix/m_mirror.scad>;
|
use <matrix/m_mirror.scad>
|
||||||
|
|
||||||
rotate([0, 0, 10])
|
rotate([0, 0, 10])
|
||||||
cube([3, 2, 1]);
|
cube([3, 2, 1]);
|
||||||
|
@@ -11,7 +11,7 @@ Generate a 4x4 transformation matrix which can pass into `multmatrix` to rotate
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <matrix/m_rotation.scad>;
|
use <matrix/m_rotation.scad>
|
||||||
|
|
||||||
point = [20, 0, 0];
|
point = [20, 0, 0];
|
||||||
a = [0, -45, 45];
|
a = [0, -45, 45];
|
||||||
@@ -25,7 +25,7 @@ Generate a 4x4 transformation matrix which can pass into `multmatrix` to rotate
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <matrix/m_rotation.scad>;
|
use <matrix/m_rotation.scad>
|
||||||
|
|
||||||
v = [10, 10, 10];
|
v = [10, 10, 10];
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@ Generate a 4x4 transformation matrix which can pass into `multmatrix` to scale i
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <matrix/m_scaling.scad>;
|
use <matrix/m_scaling.scad>
|
||||||
|
|
||||||
cube(10);
|
cube(10);
|
||||||
translate([15, 0, 0])
|
translate([15, 0, 0])
|
||||||
|
@@ -12,7 +12,7 @@ Generate a 4x4 transformation matrix which can pass into `multmatrix` to shear a
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <matrix/m_shearing.scad>;
|
use <matrix/m_shearing.scad>
|
||||||
|
|
||||||
color("red") {
|
color("red") {
|
||||||
multmatrix(m_shearing(sx = [1, 0]))
|
multmatrix(m_shearing(sx = [1, 0]))
|
||||||
|
@@ -10,7 +10,7 @@ Generate a 4x4 transformation matrix which can pass into `multmatrix` to transla
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <matrix/m_translation.scad>;
|
use <matrix/m_translation.scad>
|
||||||
|
|
||||||
cube(2, center = true);
|
cube(2, center = true);
|
||||||
multmatrix(m_translation([5, 0, 0]))
|
multmatrix(m_translation([5, 0, 0]))
|
||||||
|
@@ -10,7 +10,7 @@ It transposes a matrix.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <matrix/m_transpose.scad>;
|
use <matrix/m_transpose.scad>
|
||||||
|
|
||||||
original_m = [
|
original_m = [
|
||||||
[1, 2, 3, 4],
|
[1, 2, 3, 4],
|
||||||
|
@@ -12,9 +12,9 @@ Given a 2D path, this function constructs a mid-point smoothed version by joinin
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
use <shape_taiwan.scad>;
|
use <shape_taiwan.scad>
|
||||||
use <midpt_smooth.scad>;
|
use <midpt_smooth.scad>
|
||||||
|
|
||||||
taiwan = shape_taiwan(50);
|
taiwan = shape_taiwan(50);
|
||||||
smoothed = midpt_smooth(taiwan, 20, true);
|
smoothed = midpt_smooth(taiwan, 20, true);
|
||||||
|
@@ -9,7 +9,7 @@ Creates multi-line text from a list of strings. Parameters are the same as the b
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <multi_line_text.scad>;
|
use <multi_line_text.scad>
|
||||||
|
|
||||||
multi_line_text(
|
multi_line_text(
|
||||||
["Welcome", "to", "Taiwan"],
|
["Welcome", "to", "Taiwan"],
|
||||||
|
@@ -13,8 +13,8 @@ Creates a hamiltonian path from a maze. The path is the result of maze traversal
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <maze/mz_hamiltonian.scad>;
|
use <maze/mz_hamiltonian.scad>
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
|
|
||||||
rows = 5;
|
rows = 5;
|
||||||
columns = 10;
|
columns = 10;
|
||||||
|
@@ -15,9 +15,9 @@ It's a helper for creating wall data from maze cells. You can transform wall poi
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <maze/mz_square_cells.scad>;
|
use <maze/mz_square_cells.scad>
|
||||||
use <maze/mz_hex_walls.scad>;
|
use <maze/mz_hex_walls.scad>
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
|
|
||||||
rows = 10;
|
rows = 10;
|
||||||
columns = 12;
|
columns = 12;
|
||||||
|
@@ -13,9 +13,9 @@ It's a helper for creating wall data from maze cells. You can transform wall poi
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <maze/mz_square.scad>;
|
use <maze/mz_square.scad>
|
||||||
use <maze/mz_hexwalls.scad>;
|
use <maze/mz_hexwalls.scad>
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
|
|
||||||
rows = 10;
|
rows = 10;
|
||||||
columns = 12;
|
columns = 12;
|
||||||
|
@@ -24,8 +24,8 @@ The cell data is seperated from views. You can use cell data to construct [diffe
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <maze/mz_square.scad>;
|
use <maze/mz_square.scad>
|
||||||
use <line2d.scad>;
|
use <line2d.scad>
|
||||||
|
|
||||||
rows = 10;
|
rows = 10;
|
||||||
columns = 10;
|
columns = 10;
|
||||||
|
@@ -24,8 +24,8 @@ The cell data is seperated from views. You can use cell data to construct [diffe
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <maze/mz_square_cells.scad>;
|
use <maze/mz_square_cells.scad>
|
||||||
use <line2d.scad>;
|
use <line2d.scad>
|
||||||
|
|
||||||
rows = 10;
|
rows = 10;
|
||||||
columns = 10;
|
columns = 10;
|
||||||
|
@@ -11,9 +11,9 @@ It's a helper for getting data from a square-maze cell.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <maze/mz_square_cells.scad>;
|
use <maze/mz_square_cells.scad>
|
||||||
use <maze/mz_square_get.scad>;
|
use <maze/mz_square_get.scad>
|
||||||
use <line2d.scad>;
|
use <line2d.scad>
|
||||||
|
|
||||||
rows = 10;
|
rows = 10;
|
||||||
columns = 10;
|
columns = 10;
|
||||||
|
@@ -12,10 +12,10 @@ It's a helper for initializing cell data of a maze.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <maze/mz_square_initialize.scad>;
|
use <maze/mz_square_initialize.scad>
|
||||||
use <maze/mz_square_cells.scad>;
|
use <maze/mz_square_cells.scad>
|
||||||
use <maze/mz_square_walls.scad>;
|
use <maze/mz_square_walls.scad>
|
||||||
use <polyline2d.scad>;
|
use <polyline2d.scad>
|
||||||
|
|
||||||
rows = 10;
|
rows = 10;
|
||||||
columns = 10;
|
columns = 10;
|
||||||
@@ -32,10 +32,10 @@ It's a helper for initializing cell data of a maze.
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <maze/mz_square_cells.scad>;
|
use <maze/mz_square_cells.scad>
|
||||||
use <maze/mz_square_walls.scad>;
|
use <maze/mz_square_walls.scad>
|
||||||
use <maze/mz_square_initialize.scad>;
|
use <maze/mz_square_initialize.scad>
|
||||||
use <polyline2d.scad>;
|
use <polyline2d.scad>
|
||||||
|
|
||||||
mask = [
|
mask = [
|
||||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
|
@@ -15,9 +15,9 @@ It's a helper for creating wall data from maze cells. You can transform wall poi
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <maze/mz_square_cells.scad>;
|
use <maze/mz_square_cells.scad>
|
||||||
use <maze/mz_square_walls.scad>;
|
use <maze/mz_square_walls.scad>
|
||||||
use <polyline2d.scad>;
|
use <polyline2d.scad>
|
||||||
|
|
||||||
rows = 10;
|
rows = 10;
|
||||||
columns = 10;
|
columns = 10;
|
||||||
|
@@ -13,9 +13,9 @@ It's a helper for creating wall data from maze cells. You can transform wall poi
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <maze/mz_square.scad>;
|
use <maze/mz_square.scad>
|
||||||
use <maze/mz_squarewalls.scad>;
|
use <maze/mz_squarewalls.scad>
|
||||||
use <polyline2d.scad>;
|
use <polyline2d.scad>
|
||||||
|
|
||||||
rows = 10;
|
rows = 10;
|
||||||
columns = 10;
|
columns = 10;
|
||||||
|
@@ -24,8 +24,8 @@ The value of `type` is the wall type of the cell. It can be `0`, `1`, `2` or `3`
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <maze/mz_theta.scad>;
|
use <maze/mz_theta.scad>
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
|
|
||||||
rings = 8;
|
rings = 8;
|
||||||
beginning_number = 8;
|
beginning_number = 8;
|
||||||
|
@@ -24,8 +24,8 @@ The value of `type` is the wall type of the cell. It can be `0`, `1`, `2` or `3`
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <maze/mz_theta_cells.scad>;
|
use <maze/mz_theta_cells.scad>
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
|
|
||||||
rows = 8;
|
rows = 8;
|
||||||
beginning_number = 8;
|
beginning_number = 8;
|
||||||
|
@@ -11,9 +11,9 @@ It's a helper for getting data from a theta-maze cell.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <maze/mz_theta_cells.scad>;
|
use <maze/mz_theta_cells.scad>
|
||||||
use <maze/mz_theta_get.scad>;
|
use <maze/mz_theta_get.scad>
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
|
|
||||||
rows = 8;
|
rows = 8;
|
||||||
beginning_number = 8;
|
beginning_number = 8;
|
||||||
|
@@ -12,8 +12,8 @@ It's an implementation of [Worley noise](https://en.wikipedia.org/wiki/Worley_no
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <noise/nz_cell.scad>;
|
use <noise/nz_cell.scad>
|
||||||
use <golden_spiral.scad>;
|
use <golden_spiral.scad>
|
||||||
|
|
||||||
size = [100, 50];
|
size = [100, 50];
|
||||||
half_size = size / 2;
|
half_size = size / 2;
|
||||||
|
@@ -11,9 +11,9 @@ Returns the 1D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) value
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
use <util/rand.scad>;
|
use <util/rand.scad>
|
||||||
use <noise/nz_perlin1.scad>;
|
use <noise/nz_perlin1.scad>
|
||||||
|
|
||||||
seed = rand(0, 255);
|
seed = rand(0, 255);
|
||||||
polyline_join([for(x = [0:.1:10]) [x, nz_perlin1(x, seed)]])
|
polyline_join([for(x = [0:.1:10]) [x, nz_perlin1(x, seed)]])
|
||||||
|
@@ -11,8 +11,8 @@ Returns 1D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) values at
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
use <noise/nz_perlin1s.scad>;
|
use <noise/nz_perlin1s.scad>
|
||||||
|
|
||||||
xs = [for(x = [0:.1:10]) x];
|
xs = [for(x = [0:.1:10]) x];
|
||||||
ys = nz_perlin1s(xs);
|
ys = nz_perlin1s(xs);
|
||||||
|
@@ -12,11 +12,11 @@ Returns the 2D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) value
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/rand.scad>;
|
use <util/rand.scad>
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>
|
||||||
use <surface/sf_thicken.scad>;
|
use <surface/sf_thicken.scad>
|
||||||
use <noise/nz_perlin2.scad>;
|
use <noise/nz_perlin2.scad>
|
||||||
use <contours.scad>;
|
use <contours.scad>
|
||||||
|
|
||||||
seed = rand(0, 255);
|
seed = rand(0, 255);
|
||||||
points = [
|
points = [
|
||||||
|
@@ -11,8 +11,8 @@ Returns 2D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) values at
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/rand.scad>;
|
use <util/rand.scad>
|
||||||
use <noise/nz_perlin2s.scad>;
|
use <noise/nz_perlin2s.scad>
|
||||||
|
|
||||||
seed = rand(0, 255);
|
seed = rand(0, 255);
|
||||||
|
|
||||||
|
@@ -13,8 +13,8 @@ Returns the 3D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) value
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/rand.scad>;
|
use <util/rand.scad>
|
||||||
use <noise/nz_perlin3.scad>;
|
use <noise/nz_perlin3.scad>
|
||||||
|
|
||||||
seed = rand(0, 255);
|
seed = rand(0, 255);
|
||||||
noised = [
|
noised = [
|
||||||
|
@@ -11,9 +11,9 @@ Returns 3D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) values at
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/rand.scad>;
|
use <util/rand.scad>
|
||||||
use <noise/nz_perlin2s.scad>;
|
use <noise/nz_perlin2s.scad>
|
||||||
use <noise/nz_perlin3s.scad>;
|
use <noise/nz_perlin3s.scad>
|
||||||
|
|
||||||
points = [
|
points = [
|
||||||
for(y = [0:.2:10])
|
for(y = [0:.2:10])
|
||||||
|
@@ -18,8 +18,8 @@ It divides the space into grids. The nucleus of each cell is randomly placed in
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <noise/nz_worley2.scad>;
|
use <noise/nz_worley2.scad>
|
||||||
use <util/dedup.scad>;
|
use <util/dedup.scad>
|
||||||
|
|
||||||
size = [100, 50];
|
size = [100, 50];
|
||||||
grid_w = 10;
|
grid_w = 10;
|
||||||
|
@@ -17,7 +17,7 @@ It divides the space into grids. The nucleus of each cell is randomly placed in
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <noise/nz_worley2s.scad>;
|
use <noise/nz_worley2s.scad>
|
||||||
|
|
||||||
size = [100, 50];
|
size = [100, 50];
|
||||||
grid_w = 10;
|
grid_w = 10;
|
||||||
|
@@ -17,8 +17,8 @@ It divides the space into grids. The nucleus of each cell is randomly placed in
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <voxel/vx_sphere.scad>;
|
use <voxel/vx_sphere.scad>
|
||||||
use <noise/nz_worley3.scad>;
|
use <noise/nz_worley3.scad>
|
||||||
|
|
||||||
grid_w = 10;
|
grid_w = 10;
|
||||||
dist = "border"; // [euclidean, manhattan, chebyshev, border]
|
dist = "border"; // [euclidean, manhattan, chebyshev, border]
|
||||||
|
@@ -15,8 +15,8 @@ It divides the space into grids. The nucleus of each cell is randomly placed in
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <voxel/vx_sphere.scad>;
|
use <voxel/vx_sphere.scad>
|
||||||
use <noise/nz_worley3s.scad>;
|
use <noise/nz_worley3s.scad>
|
||||||
|
|
||||||
grid_w = 10;
|
grid_w = 10;
|
||||||
dist = "euclidean"; // [euclidean, manhattan, chebyshev, border]
|
dist = "euclidean"; // [euclidean, manhattan, chebyshev, border]
|
||||||
|
@@ -8,7 +8,7 @@ Parses the string argument as an number.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <util/parse_number.scad>;
|
use <util/parse_number.scad>
|
||||||
|
|
||||||
assert((parse_number("10") + 1) == 11);
|
assert((parse_number("10") + 1) == 11);
|
||||||
assert((parse_number("-1.1") + 1) == -0.1);
|
assert((parse_number("-1.1") + 1) == -0.1);
|
||||||
|
@@ -16,8 +16,8 @@ When using this module, you should use points to represent the 2D shape. If your
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <path_extrude.scad>;
|
use <path_extrude.scad>
|
||||||
use <bezier_curve.scad>;
|
use <bezier_curve.scad>
|
||||||
|
|
||||||
t_step = 0.05;
|
t_step = 0.05;
|
||||||
width = 2;
|
width = 2;
|
||||||
@@ -43,8 +43,8 @@ When using this module, you should use points to represent the 2D shape. If your
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <path_extrude.scad>;
|
use <path_extrude.scad>
|
||||||
use <bezier_curve.scad>;
|
use <bezier_curve.scad>
|
||||||
|
|
||||||
t_step = 0.05;
|
t_step = 0.05;
|
||||||
|
|
||||||
@@ -75,8 +75,8 @@ When using this module, you should use points to represent the 2D shape. If your
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <path_extrude.scad>;
|
use <path_extrude.scad>
|
||||||
use <bezier_curve.scad>;
|
use <bezier_curve.scad>
|
||||||
|
|
||||||
t_step = 0.05;
|
t_step = 0.05;
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ When using this module, you should use points to represent the 2D shape. If your
|
|||||||
|
|
||||||
If you want to extrude a shape along a path precisely, providing enough information about how to rotate sections is necessary. If you want to extrude a shape along a helix, `helix_extrude` is more suitable because it knows how to dig out necessary data for rotating sections precisely.
|
If you want to extrude a shape along a path precisely, providing enough information about how to rotate sections is necessary. If you want to extrude a shape along a helix, `helix_extrude` is more suitable because it knows how to dig out necessary data for rotating sections precisely.
|
||||||
|
|
||||||
use <helix_extrude.scad>;
|
use <helix_extrude.scad>
|
||||||
|
|
||||||
shape_pts = [
|
shape_pts = [
|
||||||
[0,0],
|
[0,0],
|
||||||
@@ -141,8 +141,8 @@ If you want to extrude a shape along a path precisely, providing enough informat
|
|||||||
|
|
||||||
If you have only points, what `path_extrude` can do is to **guess** data about rotations. The different algorithm will dig out different data. For example:
|
If you have only points, what `path_extrude` can do is to **guess** data about rotations. The different algorithm will dig out different data. For example:
|
||||||
|
|
||||||
use <helix.scad>;
|
use <helix.scad>
|
||||||
use <path_extrude.scad>;
|
use <path_extrude.scad>
|
||||||
|
|
||||||
shape_pts = [
|
shape_pts = [
|
||||||
[0,0],
|
[0,0],
|
||||||
@@ -165,8 +165,8 @@ You might think this is wrong. Actually, it's not. It's the correct/default beha
|
|||||||
|
|
||||||
The `method` parameter is default to `"AXIS_ANGLE"`, a way to guess information from points. It accepts `"EULER_ANGLE"`, too.
|
The `method` parameter is default to `"AXIS_ANGLE"`, a way to guess information from points. It accepts `"EULER_ANGLE"`, too.
|
||||||
|
|
||||||
use <helix.scad>;
|
use <helix.scad>
|
||||||
use <path_extrude.scad>;
|
use <path_extrude.scad>
|
||||||
|
|
||||||
shape_pts = [
|
shape_pts = [
|
||||||
[0,0],
|
[0,0],
|
||||||
@@ -189,7 +189,7 @@ You might think this is wrong. Actually, it's not. It's the correct/default beha
|
|||||||
|
|
||||||
`"EULER_ANGLE"` will generate an abrupt when the path is exactly vertical. [The problem happened in (older) Blender, too.](https://download.blender.org/documentation/htmlI/ch09s04.html)
|
`"EULER_ANGLE"` will generate an abrupt when the path is exactly vertical. [The problem happened in (older) Blender, too.](https://download.blender.org/documentation/htmlI/ch09s04.html)
|
||||||
|
|
||||||
use <path_extrude.scad>;
|
use <path_extrude.scad>
|
||||||
|
|
||||||
shape_pts = [[5, -5], [5, 5], [-5, 5], [-5, -5]];
|
shape_pts = [[5, -5], [5, 5], [-5, 5], [-5, -5]];
|
||||||
|
|
||||||
@@ -213,7 +213,7 @@ You might think this is wrong. Actually, it's not. It's the correct/default beha
|
|||||||
|
|
||||||
The problem doesn't happen when `method` is `"AXIS_ANGLE"`.
|
The problem doesn't happen when `method` is `"AXIS_ANGLE"`.
|
||||||
|
|
||||||
use <path_extrude.scad>;
|
use <path_extrude.scad>
|
||||||
|
|
||||||
shape_pts = [[5, -5], [5, 5], [-5, 5], [-5, -5]];
|
shape_pts = [[5, -5], [5, 5], [-5, 5], [-5, -5]];
|
||||||
|
|
||||||
@@ -241,9 +241,9 @@ So, which is the correct method? Both methods are correct when you provide only
|
|||||||
|
|
||||||
`"EULER_ANGLE"`, however, generates the same section at the same point. This means that you don't have to adjust sections if you want to extrude along a closed path. It's an advantage when extruding. For example:
|
`"EULER_ANGLE"`, however, generates the same section at the same point. This means that you don't have to adjust sections if you want to extrude along a closed path. It's an advantage when extruding. For example:
|
||||||
|
|
||||||
use <shape_pentagram.scad>;
|
use <shape_pentagram.scad>
|
||||||
use <path_extrude.scad>;
|
use <path_extrude.scad>
|
||||||
use <torus_knot.scad>;
|
use <torus_knot.scad>
|
||||||
|
|
||||||
p = 2;
|
p = 2;
|
||||||
q = 3;
|
q = 3;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user