mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-04-21 22:51:59 +02:00
update docs
This commit is contained in:
parent
134ca1b364
commit
9478d1ec60
@ -48,7 +48,7 @@ An `init_angle` less than 180 degrees is not recommended because the function us
|
||||
|
||||

|
||||
|
||||
include <archimedean_spiral.scad>;
|
||||
use <archimedean_spiral.scad>;
|
||||
|
||||
t = "3.141592653589793238462643383279502884197169399375105820974944592307816406286";
|
||||
|
||||
@ -60,8 +60,8 @@ An `init_angle` less than 180 degrees is not recommended because the function us
|
||||
);
|
||||
|
||||
for(i = [0: len(points) - 1]) {
|
||||
translate(points[i][0])
|
||||
rotate(points[i][1] + 90)
|
||||
translate(points[i].x)
|
||||
rotate(points[i].y + 90)
|
||||
text(t[i], valign = "center", halign = "center");
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ When having uniform cross sections, you can use [sweep](https://openhome.cc/eGos
|
||||
sects = [
|
||||
for(i = 10; i >= 4; i = i - 1)
|
||||
[
|
||||
for(p = shape_star(15, 12, i % 2 == 1 ? i : i - 1)) ptf_rotate([p[0], p[1], 5 * (i - 4)], i * 10)
|
||||
for(p = shape_star(15, 12, i % 2 == 1 ? i : i - 1)) ptf_rotate([p.x, p.y, 5 * (i - 4)], i * 10)
|
||||
]
|
||||
];
|
||||
loft(sects, slices = 3);
|
||||
@ -28,16 +28,16 @@ When having uniform cross sections, you can use [sweep](https://openhome.cc/eGos
|
||||
difference() {
|
||||
loft(
|
||||
[
|
||||
[for(p = shape_circle(10, $fn = 3)) [p[0], p[1], 15]],
|
||||
[for(p = shape_circle(15, $fn = 24)) [p[0], p[1], 0]]
|
||||
[for(p = shape_circle(10, $fn = 3)) [p.x, p.y, 15]],
|
||||
[for(p = shape_circle(15, $fn = 24)) [p.x, p.y, 0]]
|
||||
],
|
||||
slices = 4
|
||||
);
|
||||
|
||||
loft(
|
||||
[
|
||||
[for(p = shape_circle(8, $fn = 3)) [p[0], p[1], 15.1]],
|
||||
[for(p = shape_circle(13, $fn = 24)) [p[0], p[1], -0.1]]
|
||||
[for(p = shape_circle(8, $fn = 3)) [p.x, p.y, 15.1]],
|
||||
[for(p = shape_circle(13, $fn = 24)) [p.x, p.y, -0.1]]
|
||||
],
|
||||
slices = 4
|
||||
);
|
||||
|
@ -26,8 +26,8 @@ It's an implementation of [Worley noise](https://en.wikipedia.org/wiki/Worley_no
|
||||
|
||||
feature_points = [for(pt_angle = pts_angles) pt_angle[0] + half_size];
|
||||
noised = [
|
||||
for(y = [0:size[1] - 1])
|
||||
for(x = [0:size[0] - 1])
|
||||
for(y = [0:size.y - 1])
|
||||
for(x = [0:size.x - 1])
|
||||
[x, y, nz_cell(feature_points, [x, y])]
|
||||
];
|
||||
|
||||
|
@ -27,12 +27,12 @@ It divides the space into grids. The nucleus of each cell is randomly placed in
|
||||
seed = 51;
|
||||
|
||||
points = [
|
||||
for(y = [0:size[1] - 1])
|
||||
for(x = [0:size[0] - 1])
|
||||
for(y = [0:size.y - 1])
|
||||
for(x = [0:size.x - 1])
|
||||
[x, y]
|
||||
];
|
||||
|
||||
cells = [for(p = points) nz_worley2(p[0], p[1], seed, grid_w, dist)];
|
||||
cells = [for(p = points) nz_worley2(p.x, p.y, seed, grid_w, dist)];
|
||||
|
||||
max_dist = max([for(c = cells) c[2]]);
|
||||
for(i = [0:len(cells) - 1]) {
|
||||
|
@ -25,8 +25,8 @@ It divides the space into grids. The nucleus of each cell is randomly placed in
|
||||
seed = 51;
|
||||
|
||||
points = [
|
||||
for(y = [0:size[1] - 1])
|
||||
for(x = [0:size[0] - 1])
|
||||
for(y = [0:size.y - 1])
|
||||
for(x = [0:size.x - 1])
|
||||
[x, y]
|
||||
];
|
||||
|
||||
|
@ -26,7 +26,7 @@ It divides the space into grids. The nucleus of each cell is randomly placed in
|
||||
|
||||
points = vx_sphere(20);
|
||||
|
||||
cells = [for(p = points) nz_worley3(p[0], p[1], p[2], seed, grid_w, dist)];
|
||||
cells = [for(p = points) nz_worley3(p.x, p.y, p.z, seed, grid_w, dist)];
|
||||
|
||||
max_dist = max([for(c = cells) c[3]]);
|
||||
for(i = [0:len(cells) - 1]) {
|
||||
|
@ -19,13 +19,13 @@ Transform a point inside a rectangle to a point inside a circle. You can use it
|
||||
size = [10, 10];
|
||||
|
||||
rows = [
|
||||
for(y = [0:size[1]])
|
||||
[for(x = [0:size[0]]) [x, y]]
|
||||
for(y = [0:size.y])
|
||||
[for(x = [0:size.x]) [x, y]]
|
||||
];
|
||||
|
||||
columns = [
|
||||
for(x = [0:size[0]])
|
||||
[for(y = [0:size[1]]) [x, y]]
|
||||
for(x = [0:size.x])
|
||||
[for(y = [0:size.y]) [x, y]]
|
||||
];
|
||||
|
||||
for(line = rows) {
|
||||
|
@ -23,13 +23,13 @@ Transforms a point inside a rectangle to a point of a ring. It can create things
|
||||
radius = 5;
|
||||
|
||||
rows = [
|
||||
for(y = [0:size[1]])
|
||||
[for(x = [0:size[0]]) [x, y]]
|
||||
for(y = [0:size.y])
|
||||
[for(x = [0:size.x]) [x, y]]
|
||||
];
|
||||
|
||||
columns = [
|
||||
for(x = [0:size[0]])
|
||||
[for(y = [0:size[1]]) [x, y]]
|
||||
for(x = [0:size.x])
|
||||
[for(y = [0:size.y]) [x, y]]
|
||||
];
|
||||
|
||||
for(line = rows) {
|
||||
|
@ -23,13 +23,13 @@ Transforms a point inside a rectangle to a point of a sphere. It can create thin
|
||||
angle = [180, 270];
|
||||
|
||||
rows = [
|
||||
for(y = [0:size[1]])
|
||||
[for(x = [0:size[0]]) [x, y]]
|
||||
for(y = [0:size.y])
|
||||
[for(x = [0:size.x]) [x, y]]
|
||||
];
|
||||
|
||||
columns = [
|
||||
for(x = [0:size[0]])
|
||||
[for(y = [0:size[1]]) [x, y]]
|
||||
for(x = [0:size.x])
|
||||
[for(y = [0:size.y]) [x, y]]
|
||||
];
|
||||
|
||||
for(line = rows) {
|
||||
|
@ -25,13 +25,13 @@ Transforms a point inside a rectangle to a point of a torus. It can create thing
|
||||
twist = 90;
|
||||
|
||||
rows = [
|
||||
for(y = [0:size[1]])
|
||||
[for(x = [0:size[0]]) [x, y]]
|
||||
for(y = [0:size.y])
|
||||
[for(x = [0:size.x]) [x, y]]
|
||||
];
|
||||
|
||||
columns = [
|
||||
for(x = [0:size[0]])
|
||||
[for(y = [0:size[1]]) [x, y]]
|
||||
for(x = [0:size.x])
|
||||
[for(y = [0:size.y]) [x, y]]
|
||||
];
|
||||
|
||||
for(line = rows) {
|
||||
|
@ -20,13 +20,13 @@ Twist a point along the x-axis. You can use it to create something such as a [tw
|
||||
size = [20, 10];
|
||||
|
||||
rows = [
|
||||
for(y = [0:size[1]])
|
||||
[for(x = [0:size[0]]) [x, y]]
|
||||
for(y = [0:size.y])
|
||||
[for(x = [0:size.x]) [x, y]]
|
||||
];
|
||||
|
||||
columns = [
|
||||
for(x = [0:size[0]])
|
||||
[for(y = [0:size[1]]) [x, y]]
|
||||
for(x = [0:size.x])
|
||||
[for(y = [0:size.y]) [x, y]]
|
||||
];
|
||||
|
||||
for(line = rows) {
|
||||
|
@ -20,13 +20,13 @@ Twist a point along the y-axis. You can use it to create something such as a [tw
|
||||
size = [10, 20];
|
||||
|
||||
rows = [
|
||||
for(y = [0:size[1]])
|
||||
[for(x = [0:size[0]]) [x, y]]
|
||||
for(y = [0:size.y])
|
||||
[for(x = [0:size.x]) [x, y]]
|
||||
];
|
||||
|
||||
columns = [
|
||||
for(x = [0:size[0]])
|
||||
[for(y = [0:size[1]]) [x, y]]
|
||||
for(x = [0:size.x])
|
||||
[for(y = [0:size.y]) [x, y]]
|
||||
];
|
||||
|
||||
for(line = rows) {
|
||||
|
@ -18,8 +18,8 @@ It solidifies two surfaces with triangular mesh.
|
||||
points = [for(i = [0:50]) rands(-300, 300, 2)];
|
||||
triangles = tri_delaunay(points);
|
||||
|
||||
pts = [for(p = points) [p[0], p[1], rands(100, 150, 1)[0]]];
|
||||
pts2 = [for(p = pts) [p[0], p[1], p[2] - 100]];
|
||||
pts = [for(p = points) [p.x, p.y, rands(100, 150, 1)[0]]];
|
||||
pts2 = [for(p = pts) [p.x, p.y, p.z - 100]];
|
||||
|
||||
sf_solidifyT(pts, pts2, triangles = triangles);
|
||||
|
||||
@ -45,8 +45,8 @@ It solidifies two surfaces with triangular mesh.
|
||||
[x, y]
|
||||
];
|
||||
|
||||
points1 = [for(p = pts2d) scale * [p[0], p[1], f(p[0], p[1])]];
|
||||
points2 = [for(p = points1) [p[0], p[1], p[2] - scale * thickness]];
|
||||
points1 = [for(p = pts2d) scale * [p.x, p.y, f(p.x, p.y)]];
|
||||
points2 = [for(p = points1) [p.x, p.y, p.z - scale * thickness]];
|
||||
triangles = tri_delaunay(pts2d);
|
||||
|
||||
|
||||
|
@ -56,7 +56,7 @@ The indexes of the above triangles is:
|
||||
[
|
||||
for(p = section1)
|
||||
let(pt = ptf_rotate(p, [90, 0, 10 * i]))
|
||||
[pt[0], pt[1] , pt[2] + i]
|
||||
[pt.x, pt.y , pt.z + i]
|
||||
]
|
||||
];
|
||||
|
||||
@ -86,7 +86,7 @@ The indexes of the above triangles is:
|
||||
[
|
||||
for(p = section1)
|
||||
let(pt = ptf_rotate(p, [90, 0, 10 * i]))
|
||||
[pt[0], pt[1] , pt[2] + i]
|
||||
[pt.x, pt.y , pt.z + i]
|
||||
]
|
||||
];
|
||||
|
||||
@ -114,7 +114,7 @@ The indexes of the above triangles is:
|
||||
[
|
||||
for(p = section1)
|
||||
let(pt = ptf_rotate(p, [90, 0, 10 * i]))
|
||||
[pt[0], pt[1] , pt[2] + i]
|
||||
[pt.x, pt.y , pt.z + i]
|
||||
]
|
||||
];
|
||||
|
||||
|
@ -16,7 +16,7 @@ Returns points that can be used to draw a voxel-style polygon.
|
||||
|
||||
pentagram = [
|
||||
for(pt = shape_pentagram(15))
|
||||
[round(pt[0]), round(pt[1])]
|
||||
[round(pt.x), round(pt.y)]
|
||||
];
|
||||
|
||||
for(pt = vx_polygon(pentagram)) {
|
||||
|
@ -15,7 +15,7 @@ Given a list of points. `vx_polyline` returns points that can be used to draw a
|
||||
|
||||
pentagram = [
|
||||
for(pt = shape_pentagram(15))
|
||||
[round(pt[0]), round(pt[1])]
|
||||
[round(pt.x), round(pt.y)]
|
||||
];
|
||||
|
||||
for(pt = vx_polyline(concat(pentagram, [pentagram[0]]))) {
|
||||
@ -37,7 +37,7 @@ Given a list of points. `vx_polyline` returns points that can be used to draw a
|
||||
points = [
|
||||
for(pa = points_angles)
|
||||
let(pt = pa[0])
|
||||
[round(pt[0]), round(pt[1]), round(pt[2])]
|
||||
[round(pt.x), round(pt.y), round(pt.z)]
|
||||
];
|
||||
|
||||
for(a = [0:30:330]) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user