mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-13 18:24:28 +02:00
update docs
This commit is contained in:
@@ -13,7 +13,6 @@ The `bsearch` function is a general-purpose function to find a value or a list o
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <pixel/px_circle.scad>;
|
|
||||||
use <util/sort.scad>;
|
use <util/sort.scad>;
|
||||||
use <util/bsearch.scad>;
|
use <util/bsearch.scad>;
|
||||||
|
|
||||||
|
@@ -11,11 +11,11 @@ Eliminating duplicate copies of repeating vectors. If `lt` has a large number of
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <pixel/px_circle.scad>;
|
use <voxel/vx_circle.scad>;
|
||||||
use <util/dedup.scad>;
|
use <util/dedup.scad>;
|
||||||
|
|
||||||
pts1 = px_circle(10, filled = true);
|
pts1 = vx_circle(10, filled = true);
|
||||||
pts2 = [for(p = px_circle(5, filled = true)) p + [10, 0]];
|
pts2 = [for(p = vx_circle(5, filled = true)) p + [10, 0]];
|
||||||
|
|
||||||
// simple union
|
// simple union
|
||||||
pts3 = dedup(concat(pts1, pts2));
|
pts3 = dedup(concat(pts1, pts2));
|
||||||
@@ -26,12 +26,12 @@ Eliminating duplicate copies of repeating vectors. If `lt` has a large number of
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
use <pixel/px_circle.scad>;
|
use <voxel/vx_circle.scad>;
|
||||||
use <util/sort.scad>;
|
use <util/sort.scad>;
|
||||||
use <util/dedup.scad>;
|
use <util/dedup.scad>;
|
||||||
|
|
||||||
pts1 = px_circle(20, filled = true);
|
pts1 = vx_circle(20, filled = true);
|
||||||
pts2 = [for(p = px_circle(10, filled = true)) p + [20, 0]];
|
pts2 = [for(p = vx_circle(10, filled = true)) p + [20, 0]];
|
||||||
|
|
||||||
sorted_pts = sort(concat(pts1, pts2), by = "vt");
|
sorted_pts = sort(concat(pts1, pts2), by = "vt");
|
||||||
|
|
||||||
|
@@ -12,11 +12,11 @@ If `lt` contains `elem`, this function returns `true`. If you want to test eleme
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <pixel/px_circle.scad>;
|
use <voxel/vx_circle.scad>;
|
||||||
use <util/sort.scad>;
|
use <util/sort.scad>;
|
||||||
use <util/has.scad>;
|
use <util/has.scad>;
|
||||||
|
|
||||||
pts = px_circle(10);
|
pts = vx_circle(10);
|
||||||
assert(has(pts, [2, -10]));
|
assert(has(pts, [2, -10]));
|
||||||
assert(!has(pts, [0, 0]));
|
assert(!has(pts, [0, 0]));
|
||||||
|
|
||||||
|
@@ -17,14 +17,14 @@ It divides the space into grids. The nucleus of each cell is randomly placed in
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <pixel/px_sphere.scad>;
|
use <voxel/vx_sphere.scad>;
|
||||||
use <noise/nz_worley3.scad>;
|
use <noise/nz_worley3.scad>;
|
||||||
|
|
||||||
grid_w = 10;
|
grid_w = 10;
|
||||||
dist = "border"; // [euclidean, manhattan, chebyshev, border]
|
dist = "border"; // [euclidean, manhattan, chebyshev, border]
|
||||||
seed = 51;
|
seed = 51;
|
||||||
|
|
||||||
points = px_sphere(20);
|
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[0], p[1], p[2], seed, grid_w, dist)];
|
||||||
|
|
||||||
|
@@ -15,14 +15,14 @@ It divides the space into grids. The nucleus of each cell is randomly placed in
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <pixel/px_sphere.scad>;
|
use <voxel/vx_sphere.scad>;
|
||||||
use <noise/nz_worley3s.scad>;
|
use <noise/nz_worley3s.scad>;
|
||||||
|
|
||||||
tile_w = 10;
|
tile_w = 10;
|
||||||
dist = "euclidean"; // [euclidean, manhattan, chebyshev, border]
|
dist = "euclidean"; // [euclidean, manhattan, chebyshev, border]
|
||||||
seed = 51;
|
seed = 51;
|
||||||
|
|
||||||
points = px_sphere(20);
|
points = vx_sphere(20);
|
||||||
cells = nz_worley3s(points, seed, tile_w, dist);
|
cells = nz_worley3s(points, seed, tile_w, dist);
|
||||||
|
|
||||||
for(i = [0:len(cells) - 1]) {
|
for(i = [0:len(cells) - 1]) {
|
||||||
|
@@ -13,7 +13,7 @@ Transforms a point inside a rectangle to a point of an arc.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
use <pixel/px_ascii.scad>;
|
use <voxel/vx_ascii.scad>;
|
||||||
use <ptf/ptf_bend.scad>;
|
use <ptf/ptf_bend.scad>;
|
||||||
|
|
||||||
t = "dotSCAD";
|
t = "dotSCAD";
|
||||||
@@ -22,7 +22,7 @@ Transforms a point inside a rectangle to a point of an arc.
|
|||||||
angle = 180;
|
angle = 180;
|
||||||
|
|
||||||
for(i = [0:len(t) - 1]) {
|
for(i = [0:len(t) - 1]) {
|
||||||
for(pt = px_ascii(t[i], invert = true)) {
|
for(pt = vx_ascii(t[i], invert = true)) {
|
||||||
bended = ptf_bend(size, pt + [i * 8, 0], radius, angle);
|
bended = ptf_bend(size, pt + [i * 8, 0], radius, angle);
|
||||||
translate(bended)
|
translate(bended)
|
||||||
sphere(0.5, $fn = 24);
|
sphere(0.5, $fn = 24);
|
||||||
|
Reference in New Issue
Block a user