update to 3.0
@@ -59,9 +59,9 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
|
|||||||
- [function_grapher](https://openhome.cc/eGossip/OpenSCAD/lib3x-function_grapher.html)
|
- [function_grapher](https://openhome.cc/eGossip/OpenSCAD/lib3x-function_grapher.html)
|
||||||
- [hull_polyline3d](https://openhome.cc/eGossip/OpenSCAD/lib3x-hull_polyline3d.html)
|
- [hull_polyline3d](https://openhome.cc/eGossip/OpenSCAD/lib3x-hull_polyline3d.html)
|
||||||
- [line3d](https://openhome.cc/eGossip/OpenSCAD/lib3x-line3d.html)
|
- [line3d](https://openhome.cc/eGossip/OpenSCAD/lib3x-line3d.html)
|
||||||
- [loft](https://openhome.cc/eGossip/OpenSCAD/lib2x-loft.html)
|
- [loft](https://openhome.cc/eGossip/OpenSCAD/lib3x-loft.html)
|
||||||
- [polyhedron_hull](https://openhome.cc/eGossip/OpenSCAD/lib2x-polyhedron_hull.html)
|
- [polyhedron_hull](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedron_hull.html)
|
||||||
- [polyline3d](https://openhome.cc/eGossip/OpenSCAD/lib2x-polyline3d.html)
|
- [polyline3d](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyline3d.html)
|
||||||
- [rounded_cube](https://openhome.cc/eGossip/OpenSCAD/lib2x-rounded_cube.html)
|
- [rounded_cube](https://openhome.cc/eGossip/OpenSCAD/lib2x-rounded_cube.html)
|
||||||
- [rounded_cylinder](https://openhome.cc/eGossip/OpenSCAD/lib2x-rounded_cylinder.html)
|
- [rounded_cylinder](https://openhome.cc/eGossip/OpenSCAD/lib2x-rounded_cylinder.html)
|
||||||
- [starburst](https://openhome.cc/eGossip/OpenSCAD/lib2x-starburst.html)
|
- [starburst](https://openhome.cc/eGossip/OpenSCAD/lib2x-starburst.html)
|
||||||
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB |
@@ -43,7 +43,7 @@ When having uniform cross sections, you can use [sweep](https://openhome.cc/eGos
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
@@ -22,4 +22,4 @@ Create a convex polyhedron by hulling a list of points. It avoids using `hull` a
|
|||||||
[0, 0, -1]
|
[0, 0, -1]
|
||||||
]);
|
]);
|
||||||
|
|
||||||

|

|
@@ -5,7 +5,7 @@ Creates a polyline from a list of `[x, y, z]` coordinates.
|
|||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
- `points` : The list of `[x, y, z]` points of the polyline. The points are indexed from 0 to n-1.
|
- `points` : The list of `[x, y, z]` points of the polyline. The points are indexed from 0 to n-1.
|
||||||
- `thickness` : The line thickness.
|
- `diameter` : The line diameter.
|
||||||
- `startingStyle` : The end-cap style of the starting point. The value must be `"CAP_BUTT"`, `"CAP_CIRCLE"` or `"CAP_SPHERE"`. The default value is `"CAP_CIRCLE"`.
|
- `startingStyle` : The end-cap style of the starting point. The value must be `"CAP_BUTT"`, `"CAP_CIRCLE"` or `"CAP_SPHERE"`. The default value is `"CAP_CIRCLE"`.
|
||||||
- `endingStyle` : The end-cap style of the ending point. The value must be `"CAP_BUTT"`, `"CAP_CIRCLE"` or `"CAP_SPHERE"`. The default value is `"CAP_CIRCLE"`.
|
- `endingStyle` : The end-cap style of the ending point. The value must be `"CAP_BUTT"`, `"CAP_CIRCLE"` or `"CAP_SPHERE"`. The default value is `"CAP_CIRCLE"`.
|
||||||
- `$fa`, `$fs`, `$fn` : Used by the `circle` or `sphere` module internally. Check [the circle module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#circle) or [the sphere module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#sphere) for more details. The final fragments of a circle will be a multiple of 4 to fit edges if possible.
|
- `$fa`, `$fs`, `$fn` : Used by the `circle` or `sphere` module internally. Check [the circle module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#circle) or [the sphere module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#sphere) for more details. The final fragments of a circle will be a multiple of 4 to fit edges if possible.
|
||||||
@@ -21,11 +21,11 @@ Creates a polyline from a list of `[x, y, z]` coordinates.
|
|||||||
[-5, 3, 3],
|
[-5, 3, 3],
|
||||||
[5, 5, 4]
|
[5, 5, 4]
|
||||||
],
|
],
|
||||||
thickness = 1,
|
diameter = 1,
|
||||||
$fn = 24
|
$fn = 24
|
||||||
);
|
);
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <polyline3d.scad>;
|
use <polyline3d.scad>;
|
||||||
|
|
||||||
@@ -36,12 +36,12 @@ Creates a polyline from a list of `[x, y, z]` coordinates.
|
|||||||
[-5, 3, 3],
|
[-5, 3, 3],
|
||||||
[5, 5, 4]
|
[5, 5, 4]
|
||||||
],
|
],
|
||||||
thickness = 1,
|
diameter = 1,
|
||||||
endingStyle = "CAP_SPHERE",
|
endingStyle = "CAP_SPHERE",
|
||||||
$fn = 24
|
$fn = 24
|
||||||
);
|
);
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <polyline3d.scad>;
|
use <polyline3d.scad>;
|
||||||
|
|
||||||
@@ -52,13 +52,13 @@ Creates a polyline from a list of `[x, y, z]` coordinates.
|
|||||||
[-5, 3, 3],
|
[-5, 3, 3],
|
||||||
[5, 5, 4]
|
[5, 5, 4]
|
||||||
],
|
],
|
||||||
thickness = 1,
|
diameter = 1,
|
||||||
startingStyle = "CAP_SPHERE",
|
startingStyle = "CAP_SPHERE",
|
||||||
endingStyle = "CAP_SPHERE",
|
endingStyle = "CAP_SPHERE",
|
||||||
$fn = 24
|
$fn = 24
|
||||||
);
|
);
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <polyline3d.scad>;
|
use <polyline3d.scad>;
|
||||||
|
|
||||||
@@ -71,6 +71,6 @@ Creates a polyline from a list of `[x, y, z]` coordinates.
|
|||||||
for(a = [0:fa:360 * circles])
|
for(a = [0:fa:360 * circles])
|
||||||
[r * cos(a), r * sin(a), h / (360 / fa) * (a / fa)]
|
[r * cos(a), r * sin(a), h / (360 / fa) * (a / fa)]
|
||||||
];
|
];
|
||||||
polyline3d(points, thickness = 1, $fn = 24);
|
polyline3d(points, diameter = 1, $fn = 24);
|
||||||
|
|
||||||

|

|
@@ -3,7 +3,7 @@ use <line3d.scad>;
|
|||||||
/* [Basic] */
|
/* [Basic] */
|
||||||
|
|
||||||
stick_leng = 80;
|
stick_leng = 80;
|
||||||
stick_thickness = 5;
|
stick_diameter = 5;
|
||||||
inner_square_leng = 60;
|
inner_square_leng = 60;
|
||||||
leng_diff = 1.75;
|
leng_diff = 1.75;
|
||||||
min_leng = 13;
|
min_leng = 13;
|
||||||
@@ -15,7 +15,7 @@ cap_style = "CAP_CIRCLE"; // [CAP_BUTT, CAP_CIRCLE, CAP_SPHERE]
|
|||||||
angle_offset = 5;
|
angle_offset = 5;
|
||||||
layer_offset = 1.2;
|
layer_offset = 1.2;
|
||||||
|
|
||||||
module stick_square(inner_square_leng, stick_leng, stick_thickness, cap_style) {
|
module stick_square(inner_square_leng, stick_leng, stick_diameter, cap_style) {
|
||||||
diff_leng = stick_leng - inner_square_leng;
|
diff_leng = stick_leng - inner_square_leng;
|
||||||
half_inner_square_leng = inner_square_leng / 2;
|
half_inner_square_leng = inner_square_leng / 2;
|
||||||
half_stick_leng = stick_leng / 2;
|
half_stick_leng = stick_leng / 2;
|
||||||
@@ -24,7 +24,7 @@ module stick_square(inner_square_leng, stick_leng, stick_thickness, cap_style) {
|
|||||||
line3d(
|
line3d(
|
||||||
[0, -half_stick_leng, 0],
|
[0, -half_stick_leng, 0],
|
||||||
[0, half_stick_leng, 0],
|
[0, half_stick_leng, 0],
|
||||||
stick_thickness,
|
stick_diameter,
|
||||||
cap_style,
|
cap_style,
|
||||||
cap_style
|
cap_style
|
||||||
);
|
);
|
||||||
@@ -38,7 +38,7 @@ module stick_square(inner_square_leng, stick_leng, stick_thickness, cap_style) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sticks();
|
sticks();
|
||||||
translate([0, 0, stick_thickness])
|
translate([0, 0, stick_diameter])
|
||||||
rotate(90)
|
rotate(90)
|
||||||
sticks();
|
sticks();
|
||||||
}
|
}
|
||||||
@@ -71,10 +71,10 @@ module spiral_stack(orig_leng, orig_height, current_leng, leng_diff, min_leng, a
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
height = stick_thickness * layer_offset;
|
height = stick_diameter * layer_offset;
|
||||||
$fn = stick_fn;
|
$fn = stick_fn;
|
||||||
|
|
||||||
spiral_stack(inner_square_leng, stick_thickness * 2, inner_square_leng, leng_diff, min_leng, angle_offset)
|
spiral_stack(inner_square_leng, stick_diameter * 2, inner_square_leng, leng_diff, min_leng, angle_offset)
|
||||||
stick_square(
|
stick_square(
|
||||||
inner_square_leng,
|
inner_square_leng,
|
||||||
stick_leng,
|
stick_leng,
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
* @copyright Justin Lin, 2020
|
* @copyright Justin Lin, 2020
|
||||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
* @license https://opensource.org/licenses/lgpl-3.0.html
|
||||||
*
|
*
|
||||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-loft.html
|
* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-loft.html
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
* @copyright Justin Lin, 2020
|
* @copyright Justin Lin, 2020
|
||||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
* @license https://opensource.org/licenses/lgpl-3.0.html
|
||||||
*
|
*
|
||||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-polyhedron_hull.html
|
* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedron_hull.html
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
@@ -4,13 +4,13 @@
|
|||||||
* @copyright Justin Lin, 2017
|
* @copyright Justin Lin, 2017
|
||||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
* @license https://opensource.org/licenses/lgpl-3.0.html
|
||||||
*
|
*
|
||||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-polyline3d.html
|
* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-polyline3d.html
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
use <line3d.scad>;
|
use <line3d.scad>;
|
||||||
|
|
||||||
module polyline3d(points, thickness, startingStyle = "CAP_CIRCLE", endingStyle = "CAP_CIRCLE") {
|
module polyline3d(points, diameter, startingStyle = "CAP_CIRCLE", endingStyle = "CAP_CIRCLE") {
|
||||||
leng_pts = len(points);
|
leng_pts = len(points);
|
||||||
|
|
||||||
s_styles = [startingStyle, "CAP_BUTT"];
|
s_styles = [startingStyle, "CAP_BUTT"];
|
||||||
@@ -27,11 +27,11 @@ module polyline3d(points, thickness, startingStyle = "CAP_CIRCLE", endingStyle =
|
|||||||
p1Style = styles[0];
|
p1Style = styles[0];
|
||||||
p2Style = styles[1];
|
p2Style = styles[1];
|
||||||
|
|
||||||
line3d(p1, p2, thickness,
|
line3d(p1, p2, diameter,
|
||||||
p1Style = p1Style, p2Style = p2Style);
|
p1Style = p1Style, p2Style = p2Style);
|
||||||
|
|
||||||
// hook for testing
|
// hook for testing
|
||||||
test_polyline3d_line3d_segment(index, p1, p2, thickness, p1Style, p2Style);
|
test_polyline3d_line3d_segment(index, p1, p2, diameter, p1Style, p2Style);
|
||||||
}
|
}
|
||||||
|
|
||||||
module polyline3d_inner(index) {
|
module polyline3d_inner(index) {
|
||||||
@@ -42,7 +42,7 @@ module polyline3d(points, thickness, startingStyle = "CAP_CIRCLE", endingStyle =
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(leng_pts == 2) {
|
if(leng_pts == 2) {
|
||||||
line3d(points[0], points[1], thickness, startingStyle, endingStyle);
|
line3d(points[0], points[1], diameter, startingStyle, endingStyle);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
polyline3d_inner(1);
|
polyline3d_inner(1);
|
||||||
@@ -50,6 +50,6 @@ module polyline3d(points, thickness, startingStyle = "CAP_CIRCLE", endingStyle =
|
|||||||
}
|
}
|
||||||
|
|
||||||
// override it to test
|
// override it to test
|
||||||
module test_polyline3d_line3d_segment(index, point1, point2, thickness, p1Style, p2Style) {
|
module test_polyline3d_line3d_segment(index, point1, point2, diameter, p1Style, p2Style) {
|
||||||
|
|
||||||
}
|
}
|