1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-07-31 03:50:27 +02:00

use polyline_join

This commit is contained in:
Justin Lin
2021-11-18 08:08:50 +08:00
parent 7b1095d130
commit 610c9588bd
10 changed files with 41 additions and 33 deletions

View File

@@ -11,21 +11,21 @@ Creates an arc path. You can pass a 2 element vector to define the central angle
## Examples
use <arc_path.scad>;
use <hull_polyline2d.scad>;
$fn = 24;
points = arc_path(radius = 20, angle = [45, 290]);
hull_polyline2d(points, width = 2);
use <arc_path.scad>;
use <polyline_join.scad>;
$fn = 24;
points = arc_path(radius = 20, angle = [45, 290]);
polyline_join(points) circle(1);
![arc_path](images/lib3x-arc_path-1.JPG)
use <arc_path.scad>;
use <hull_polyline2d.scad>;
use <polyline_join.scad>;
$fn = 24;
points = arc_path(radius = 20, angle = 135);
hull_polyline2d(points, width = 2);
polyline_join(points) circle(1);
![arc_path](images/lib3x-arc_path-2.JPG)

View File

@@ -15,7 +15,7 @@ Creates visually even spacing of n points on the surface of the sphere. Successi
## Examples
use <bauer_spiral.scad>;
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
n = 200;
radius = 20;
@@ -26,7 +26,7 @@ Creates visually even spacing of n points on the surface of the sphere. Successi
sphere(1, $fn = 24);
}
hull_polyline3d(pts, 1);
polyline_join(pts) sphere(.5);
![bauer_spiral](images/lib3x-bauer_spiral-1.JPG)

View File

@@ -12,7 +12,7 @@ Given a path, the `bezier_smooth` function uses bazier curves to smooth all corn
## Examples
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
use <bezier_smooth.scad>;
width = 2;
@@ -25,15 +25,15 @@ Given a path, the `bezier_smooth` function uses bazier curves to smooth all corn
[-10, -10, 50]
];
hull_polyline3d(
path_pts, width
);
polyline_join(path_pts)
sphere(width / 2);
smoothed_path_pts = bezier_smooth(path_pts, round_d);
color("red") translate([30, 0, 0]) hull_polyline3d(
smoothed_path_pts, width
);
color("red")
translate([30, 0, 0])
polyline_join(smoothed_path_pts)
sphere(width / 2);
![bezier_smooth](images/lib3x-bezier_smooth-1.JPG)

View File

@@ -1,6 +1,6 @@
# bspline_curve
[B-spline](https://en.wikipedia.org/wiki/B-spline) interpolation using [de Boor's algorithm](https://en.wikipedia.org/wiki/De_Boor%27s_algorithm). This function returns points of the B-spline path. Combined with the `polyline`, `polyline3d` or `hull_polyline3d` module, you can create a B-spline curve.
[B-spline](https://en.wikipedia.org/wiki/B-spline) interpolation using [de Boor's algorithm](https://en.wikipedia.org/wiki/De_Boor%27s_algorithm). This function returns points of the B-spline path.
**Since:** 2.1

View File

@@ -11,7 +11,7 @@ Computes contour polygons by applying [marching squares](https://en.wikipedia.or
## Examples
use <hull_polyline2d.scad>;
use <polyline_join.scad>;
use <surface/sf_thicken.scad>;
use <contours.scad>;
@@ -36,7 +36,8 @@ Computes contour polygons by applying [marching squares](https://en.wikipedia.or
translate([0, 0, z])
linear_extrude(1)
for(isoline = contours(points, z)) {
hull_polyline2d(isoline, width = 1);
polyline_join(isoline)
circle(.5);
}
}

View File

@@ -17,7 +17,7 @@ Draws a curved line from control points. The curve is drawn only from the 2nd co
## Examples
use <curve.scad>;
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
pts = [
[28, 2, 1],
@@ -32,12 +32,14 @@ Draws a curved line from control points. The curve is drawn only from the 2nd co
tightness = 0;
points = curve(t_step, pts, tightness);
hull_polyline3d(points, 1);
polyline_join(points)
sphere(.5);
#for(pt = pts) {
translate(pt)
sphere(1);
}
#hull_polyline3d(pts, .1);
#polyline_join(pts)
sphere(.05);
![curve](images/lib3x-curve-3.JPG)

View File

@@ -31,7 +31,7 @@ Creates visually even spacing of n points on the surface of the sphere. Nearest-
![fibonacci_lattice](images/lib3x-fibonacci_lattice-1.JPG)
use <fibonacci_lattice.scad>;
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
n = 200;
radius = 20;
@@ -49,7 +49,8 @@ Creates visually even spacing of n points on the surface of the sphere. Nearest-
];
for(spiral = spirals) {
hull_polyline3d(spiral, 1);
polyline_join(spiral)
sphere(.5);
}
![fibonacci_lattice](images/lib3x-fibonacci_lattice-2.JPG)

View File

@@ -11,7 +11,7 @@ Drive a turtle with `["forward", length]` or `["turn", angle]`. This function is
## Examples
use <polyline2d.scad>;
use <polyline_join.scad>;
use <turtle/footprints2.scad>;
function arc_cmds(radius, angle, steps) =
@@ -48,7 +48,8 @@ Drive a turtle with `["forward", length]` or `["turn", angle]`. This function is
)
);
polyline2d(poly, width = 1);
polyline_join(poly)
circle(.5);
![footprints2](images/lib3x-footprints2-1.JPG)

View File

@@ -11,7 +11,7 @@ A 3D verion of [footprint2](https://openhome.cc/eGossip/OpenSCAD/lib3x-footprint
## Examples
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
use <turtle/footprints3.scad>;
function xy_arc_cmds(radius, angle, steps) =
@@ -49,7 +49,8 @@ A 3D verion of [footprint2](https://openhome.cc/eGossip/OpenSCAD/lib3x-footprint
)
);
hull_polyline3d(poly, thickness = 1);
polyline_join(poly)
sphere(.5);
![footprints3](images/lib3x-footprints3-1.JPG)

View File

@@ -14,7 +14,7 @@ Gets all points on the path of a spiral around a cylinder. Its `$fa`, `$fs` and
## Examples
use <helix.scad>;
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
$fn = 12;
@@ -30,12 +30,13 @@ Gets all points on the path of a spiral around a cylinder. Its `$fa`, `$fs` and
translate(p) sphere(5);
}
hull_polyline3d(points, 2);
polyline_join(points)
sphere(1);
![helix](images/lib3x-helix-1.JPG)
use <helix.scad>;
use <hull_polyline3d.scad>;
use <polyline_join.scad>;
$fn = 12;
@@ -47,7 +48,8 @@ Gets all points on the path of a spiral around a cylinder. Its `$fa`, `$fs` and
rt_dir = "CLK"
);
hull_polyline3d(points, 2);
polyline_join(points)
sphere(1);
%cylinder(h = 100, r1 = 40, r2 = 20);