mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-19 04:51:26 +02:00
add doc
This commit is contained in:
BIN
docs/images/lib2x-vrn2_space-1.JPG
Normal file
BIN
docs/images/lib2x-vrn2_space-1.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 49 KiB |
BIN
docs/images/lib2x-vrn2_space-2.JPG
Normal file
BIN
docs/images/lib2x-vrn2_space-2.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 56 KiB |
42
docs/lib2x-vrn2_space.md
Normal file
42
docs/lib2x-vrn2_space.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# vrn2_space
|
||||
|
||||
Creats a [Voronoi diagram](https://en.wikipedia.org/wiki/Voronoi_diagram) in the first quadrant. You specify a space and a grid width. The center of each cell will be distributed in each grid randomly.
|
||||
|
||||
**Since:** 2.4
|
||||
|
||||
## Parameters
|
||||
|
||||
- `size` : 2 value array [x, y], rectangle with dimensions x and y.
|
||||
- `grid_w` : The width of each grid. If it can split `size` equally, the voronoi diagram is seamless at the junction of top-bottom and left-right.
|
||||
- `seed` : Seed value for random number generator for repeatable results.
|
||||
- `spacing` : Distance between cells. Default to 1.
|
||||
- `r`, `delta`, `chamfer` : The outlines of each cell can be moved outward or inward. These parameters have the same effect as [`offset`](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset).
|
||||
- `region_type` : The initial shape for each cell can be `"square"` or `"circle"`. Default to `"square"`.
|
||||
|
||||
## Examples
|
||||
|
||||
use <voronoi/vrn2_space.scad>;
|
||||
|
||||
vrn2_space(
|
||||
size = [40, 20],
|
||||
grid_w = 5
|
||||
);
|
||||
|
||||

|
||||
|
||||
use <bend_extrude.scad>;
|
||||
use <voronoi/vrn2_space.scad>;
|
||||
|
||||
size = [60, 20];
|
||||
|
||||
bend_extrude(size = size, thickness = 1, angle = 360)
|
||||
difference() {
|
||||
square(size);
|
||||
vrn2_space(
|
||||
size = size,
|
||||
grid_w = 5,
|
||||
seed = 1
|
||||
);
|
||||
}
|
||||
|
||||

|
Reference in New Issue
Block a user