From 81fd73588f68b4e253753e41e3110a3e89a9162e Mon Sep 17 00:00:00 2001 From: Revar Desmera Date: Sun, 14 Jul 2019 15:10:13 -0700 Subject: [PATCH] Moved heightfield() to shapes.scad. --- geometry.scad | 107 -------------------------------------------------- shapes.scad | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+), 107 deletions(-) diff --git a/geometry.scad b/geometry.scad index 326e942..ecef45b 100644 --- a/geometry.scad +++ b/geometry.scad @@ -1275,112 +1275,5 @@ module region(r) } -// Module: heightfield() -// Usage: -// heightfield(heightfield, [size], [bottom]); -// Description: -// Given a regular rectangular 2D grid of scalar values, generates a 3D surface where the height at -// any given point is the scalar value for that position. -// Arguments: -// heightfield = The 2D rectangular array of heights. -// size = The [X,Y] size of the surface to create. If given as a scalar, use it for both X and Y sizes. -// bottom = The Z coordinate for the bottom of the heightfield object to create. Must be less than the minimum heightfield value. Default: 0 -// convexity = Max number of times a line could intersect a wall of the surface being formed. -// Example: -// heightfield(size=[100,100], bottom=-20, heightfield=[ -// for (x=[-180:4:180]) [for(y=[-180:4:180]) 10*cos(3*norm([x,y]))] -// ]); -// Example: -// intersection() { -// heightfield(size=[100,100], heightfield=[ -// for (x=[-180:5:180]) [for(y=[-180:5:180]) 10+5*cos(3*x)*sin(3*y)] -// ]); -// cylinder(h=50,d=100); -// } -module heightfield(heightfield, size=[100,100], bottom=0, convexity=10) -{ - size = is_num(size)? [size,size] : point2d(size); - dim = array_dim(heightfield); - assert(dim.x!=undef); - assert(dim.y!=undef); - assert(bottom