mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-17 20:11:50 +02:00
update demo
This commit is contained in:
@@ -3,6 +3,8 @@ use <util/rand.scad>;
|
|||||||
use <experimental/pnoise2.scad>;
|
use <experimental/pnoise2.scad>;
|
||||||
use <experimental/marching_squares.scad>;
|
use <experimental/marching_squares.scad>;
|
||||||
|
|
||||||
|
style = "ISOLINES"; // [ISOLINES, ISOBANDS]
|
||||||
|
|
||||||
seed = rand(0, 256);
|
seed = rand(0, 256);
|
||||||
points = [
|
points = [
|
||||||
for(y = [0:.2:10]) [
|
for(y = [0:.2:10]) [
|
||||||
@@ -10,10 +12,19 @@ points = [
|
|||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
for(row = marching_squares(points, 0.1)) {
|
if(style == "ISOLINES") {
|
||||||
|
for(row = marching_squares(points, 0.1)) {
|
||||||
for(line = row) {
|
for(line = row) {
|
||||||
p0 = [line[0][0], line[0][1]];
|
p0 = [line[0][0], line[0][1]];
|
||||||
p1 = [line[1][0], line[1][1]];
|
p1 = [line[1][0], line[1][1]];
|
||||||
hull_polyline2d([p0, p1], width = .1);
|
hull_polyline2d([p0, p1], width = .1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for(row = marching_squares(points, [-.2, .2])) {
|
||||||
|
for(iso_band = row) {
|
||||||
|
polygon([for(p = iso_band) [p[0], p[1]]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user