1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-11 17:24:20 +02:00

update docs

This commit is contained in:
Justin Lin
2021-02-07 17:25:45 +08:00
parent 73c10c356e
commit 2dbb77ed4b
6 changed files with 14 additions and 15 deletions

View File

@@ -13,7 +13,6 @@ The `bsearch` function is a general-purpose function to find a value or a list o
## Examples
use <pixel/px_circle.scad>;
use <util/sort.scad>;
use <util/bsearch.scad>;

View File

@@ -11,11 +11,11 @@ Eliminating duplicate copies of repeating vectors. If `lt` has a large number of
## Examples
use <pixel/px_circle.scad>;
use <voxel/vx_circle.scad>;
use <util/dedup.scad>;
pts1 = px_circle(10, filled = true);
pts2 = [for(p = px_circle(5, filled = true)) p + [10, 0]];
pts1 = vx_circle(10, filled = true);
pts2 = [for(p = vx_circle(5, filled = true)) p + [10, 0]];
// simple union
pts3 = dedup(concat(pts1, pts2));
@@ -26,12 +26,12 @@ Eliminating duplicate copies of repeating vectors. If `lt` has a large number of
![dedup](images/lib2x-dedup-1.JPG)
use <pixel/px_circle.scad>;
use <voxel/vx_circle.scad>;
use <util/sort.scad>;
use <util/dedup.scad>;
pts1 = px_circle(20, filled = true);
pts2 = [for(p = px_circle(10, filled = true)) p + [20, 0]];
pts1 = vx_circle(20, filled = true);
pts2 = [for(p = vx_circle(10, filled = true)) p + [20, 0]];
sorted_pts = sort(concat(pts1, pts2), by = "vt");

View File

@@ -12,11 +12,11 @@ If `lt` contains `elem`, this function returns `true`. If you want to test eleme
## Examples
use <pixel/px_circle.scad>;
use <voxel/vx_circle.scad>;
use <util/sort.scad>;
use <util/has.scad>;
pts = px_circle(10);
pts = vx_circle(10);
assert(has(pts, [2, -10]));
assert(!has(pts, [0, 0]));

View File

@@ -17,14 +17,14 @@ It divides the space into grids. The nucleus of each cell is randomly placed in
## Examples
use <pixel/px_sphere.scad>;
use <voxel/vx_sphere.scad>;
use <noise/nz_worley3.scad>;
grid_w = 10;
dist = "border"; // [euclidean, manhattan, chebyshev, border]
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)];

View File

@@ -15,14 +15,14 @@ It divides the space into grids. The nucleus of each cell is randomly placed in
## Examples
use <pixel/px_sphere.scad>;
use <voxel/vx_sphere.scad>;
use <noise/nz_worley3s.scad>;
tile_w = 10;
dist = "euclidean"; // [euclidean, manhattan, chebyshev, border]
seed = 51;
points = px_sphere(20);
points = vx_sphere(20);
cells = nz_worley3s(points, seed, tile_w, dist);
for(i = [0:len(cells) - 1]) {

View File

@@ -13,7 +13,7 @@ Transforms a point inside a rectangle to a point of an arc.
## Examples
use <pixel/px_ascii.scad>;
use <voxel/vx_ascii.scad>;
use <ptf/ptf_bend.scad>;
t = "dotSCAD";
@@ -22,7 +22,7 @@ Transforms a point inside a rectangle to a point of an arc.
angle = 180;
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);
translate(bended)
sphere(0.5, $fn = 24);