1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-19 04:51:26 +02:00

update to 3.0

This commit is contained in:
Justin Lin
2021-02-19 11:24:34 +08:00
parent b110c3964d
commit 89c682a809
14 changed files with 28 additions and 28 deletions

View File

@@ -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)
- [hull_polyline3d](https://openhome.cc/eGossip/OpenSCAD/lib3x-hull_polyline3d.html)
- [line3d](https://openhome.cc/eGossip/OpenSCAD/lib3x-line3d.html)
- [loft](https://openhome.cc/eGossip/OpenSCAD/lib2x-loft.html)
- [polyhedron_hull](https://openhome.cc/eGossip/OpenSCAD/lib2x-polyhedron_hull.html)
- [polyline3d](https://openhome.cc/eGossip/OpenSCAD/lib2x-polyline3d.html)
- [loft](https://openhome.cc/eGossip/OpenSCAD/lib3x-loft.html)
- [polyhedron_hull](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedron_hull.html)
- [polyline3d](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyline3d.html)
- [rounded_cube](https://openhome.cc/eGossip/OpenSCAD/lib2x-rounded_cube.html)
- [rounded_cylinder](https://openhome.cc/eGossip/OpenSCAD/lib2x-rounded_cylinder.html)
- [starburst](https://openhome.cc/eGossip/OpenSCAD/lib2x-starburst.html)

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

@@ -43,7 +43,7 @@ When having uniform cross sections, you can use [sweep](https://openhome.cc/eGos
);
}
![loft](images/lib2x-loft-1.JPG)
![loft](images/lib3x-loft-1.JPG)

View File

@@ -22,4 +22,4 @@ Create a convex polyhedron by hulling a list of points. It avoids using `hull` a
[0, 0, -1]
]);
![polyhedron_hull](images/lib2x-polyhedron_hull-1.JPG)
![polyhedron_hull](images/lib3x-polyhedron_hull-1.JPG)

View File

@@ -5,7 +5,7 @@ Creates a polyline from a list of `[x, y, z]` coordinates.
## Parameters
- `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"`.
- `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.
@@ -21,11 +21,11 @@ Creates a polyline from a list of `[x, y, z]` coordinates.
[-5, 3, 3],
[5, 5, 4]
],
thickness = 1,
diameter = 1,
$fn = 24
);
![polyline3d](images/lib2x-polyline3d-1.JPG)
![polyline3d](images/lib3x-polyline3d-1.JPG)
use <polyline3d.scad>;
@@ -36,12 +36,12 @@ Creates a polyline from a list of `[x, y, z]` coordinates.
[-5, 3, 3],
[5, 5, 4]
],
thickness = 1,
diameter = 1,
endingStyle = "CAP_SPHERE",
$fn = 24
);
![polyline3d](images/lib2x-polyline3d-2.JPG)
![polyline3d](images/lib3x-polyline3d-2.JPG)
use <polyline3d.scad>;
@@ -52,13 +52,13 @@ Creates a polyline from a list of `[x, y, z]` coordinates.
[-5, 3, 3],
[5, 5, 4]
],
thickness = 1,
diameter = 1,
startingStyle = "CAP_SPHERE",
endingStyle = "CAP_SPHERE",
$fn = 24
);
![polyline3d](images/lib2x-polyline3d-3.JPG)
![polyline3d](images/lib3x-polyline3d-3.JPG)
use <polyline3d.scad>;
@@ -71,6 +71,6 @@ Creates a polyline from a list of `[x, y, z]` coordinates.
for(a = [0:fa:360 * circles])
[r * cos(a), r * sin(a), h / (360 / fa) * (a / fa)]
];
polyline3d(points, thickness = 1, $fn = 24);
polyline3d(points, diameter = 1, $fn = 24);
![polyline3d](images/lib2x-polyline3d-4.JPG)
![polyline3d](images/lib3x-polyline3d-4.JPG)

View File

@@ -3,7 +3,7 @@ use <line3d.scad>;
/* [Basic] */
stick_leng = 80;
stick_thickness = 5;
stick_diameter = 5;
inner_square_leng = 60;
leng_diff = 1.75;
min_leng = 13;
@@ -15,7 +15,7 @@ cap_style = "CAP_CIRCLE"; // [CAP_BUTT, CAP_CIRCLE, CAP_SPHERE]
angle_offset = 5;
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;
half_inner_square_leng = inner_square_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(
[0, -half_stick_leng, 0],
[0, half_stick_leng, 0],
stick_thickness,
stick_diameter,
cap_style,
cap_style
);
@@ -38,7 +38,7 @@ module stick_square(inner_square_leng, stick_leng, stick_thickness, cap_style) {
}
sticks();
translate([0, 0, stick_thickness])
translate([0, 0, stick_diameter])
rotate(90)
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;
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(
inner_square_leng,
stick_leng,

View File

@@ -4,7 +4,7 @@
* @copyright Justin Lin, 2020
* @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
*
**/

View File

@@ -4,7 +4,7 @@
* @copyright Justin Lin, 2020
* @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
*
**/

View File

@@ -4,13 +4,13 @@
* @copyright Justin Lin, 2017
* @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>;
module polyline3d(points, thickness, startingStyle = "CAP_CIRCLE", endingStyle = "CAP_CIRCLE") {
module polyline3d(points, diameter, startingStyle = "CAP_CIRCLE", endingStyle = "CAP_CIRCLE") {
leng_pts = len(points);
s_styles = [startingStyle, "CAP_BUTT"];
@@ -27,11 +27,11 @@ module polyline3d(points, thickness, startingStyle = "CAP_CIRCLE", endingStyle =
p1Style = styles[0];
p2Style = styles[1];
line3d(p1, p2, thickness,
line3d(p1, p2, diameter,
p1Style = p1Style, p2Style = p2Style);
// 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) {
@@ -42,7 +42,7 @@ module polyline3d(points, thickness, startingStyle = "CAP_CIRCLE", endingStyle =
}
if(leng_pts == 2) {
line3d(points[0], points[1], thickness, startingStyle, endingStyle);
line3d(points[0], points[1], diameter, startingStyle, endingStyle);
}
else {
polyline3d_inner(1);
@@ -50,6 +50,6 @@ module polyline3d(points, thickness, startingStyle = "CAP_CIRCLE", endingStyle =
}
// 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) {
}