mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-07-31 20:10:36 +02:00
use shape_circle
This commit is contained in:
@@ -13,11 +13,11 @@ Puts children along the given path. If there's only one child, it will put the c
|
|||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <along_with.scad>;
|
use <along_with.scad>;
|
||||||
use <circle_path.scad>;
|
use <shape_circle.scad>;
|
||||||
|
|
||||||
$fn = 24;
|
$fn = 24;
|
||||||
|
|
||||||
points = circle_path(radius = 50);
|
points = shape_circle(radius = 50);
|
||||||
|
|
||||||
along_with(points)
|
along_with(points)
|
||||||
sphere(5);
|
sphere(5);
|
||||||
@@ -25,11 +25,11 @@ Puts children along the given path. If there's only one child, it will put the c
|
|||||||

|

|
||||||
|
|
||||||
use <along_with.scad>;
|
use <along_with.scad>;
|
||||||
use <circle_path.scad>;
|
use <shape_circle.scad>;
|
||||||
|
|
||||||
$fn = 24;
|
$fn = 24;
|
||||||
|
|
||||||
points = circle_path(radius = 50);
|
points = shape_circle(radius = 50);
|
||||||
|
|
||||||
along_with(points) {
|
along_with(points) {
|
||||||
linear_extrude(10, center = true) text("A", valign = "center", halign = "center");
|
linear_extrude(10, center = true) text("A", valign = "center", halign = "center");
|
||||||
|
@@ -38,14 +38,14 @@ When using this module, you should use points to represent the 2D shape. If your
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <circle_path.scad>;
|
use <shape_circle.scad>;
|
||||||
use <golden_spiral_extrude.scad>;
|
use <golden_spiral_extrude.scad>;
|
||||||
|
|
||||||
$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(
|
||||||
|
29
docs/lib2x-shape_circle.md
Normal file
29
docs/lib2x-shape_circle.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# shape_circle
|
||||||
|
|
||||||
|
Sometimes you need all points on the path of a circle. Here's the function. Its `$fa`, `$fs` and `$fn` parameters are consistent with the `circle` module.
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
- `radius` : The radius of the circle.
|
||||||
|
- `n` : The number of points you want. It's not greater than the fragments of the circle.
|
||||||
|
- `$fa`, `$fs`, `$fn` : Check [the circle module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#circle) for more details.
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
use <shape_circle.scad>;
|
||||||
|
|
||||||
|
$fn = 24;
|
||||||
|
|
||||||
|
points = shape_circle(radius = 50);
|
||||||
|
polygon(points);
|
||||||
|
|
||||||
|
leng = len(points);
|
||||||
|
step_angle = 360 / leng;
|
||||||
|
for(i = [0:leng - 1]) {
|
||||||
|
translate(points[i])
|
||||||
|
rotate([90, 0, 90 + i * step_angle])
|
||||||
|
linear_extrude(1, center = true)
|
||||||
|
text("A", valign = "center", halign = "center");
|
||||||
|
}
|
||||||
|
|
||||||
|

|
@@ -14,13 +14,13 @@ When using this function, you should use points to represent the 2D stroke.
|
|||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
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>;
|
||||||
|
|
||||||
$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);
|
||||||
polygon(
|
polygon(
|
||||||
shape_path_extend(stroke1, path_pts1)
|
shape_path_extend(stroke1, path_pts1)
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user