mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-06 20:06:42 +02:00
Make is_path() test for more than one point in a path.
This commit is contained in:
@@ -341,8 +341,8 @@ function in_front_of_plane(plane, point) =
|
|||||||
// Usage:
|
// Usage:
|
||||||
// is_path(x);
|
// is_path(x);
|
||||||
// Description:
|
// Description:
|
||||||
// Returns true if the given item looks like a path.
|
// Returns true if the given item looks like a path. A path is defined as a list of two or more points.
|
||||||
function is_path(x) = is_list(x) && is_vector(x.x);
|
function is_path(x) = is_list(x) && is_vector(x.x) && len(x)>1;
|
||||||
|
|
||||||
|
|
||||||
// Function: is_closed_path()
|
// Function: is_closed_path()
|
||||||
@@ -572,7 +572,7 @@ function polygon_clockwise(path) =
|
|||||||
// Usage:
|
// Usage:
|
||||||
// is_region(x);
|
// is_region(x);
|
||||||
// Description:
|
// Description:
|
||||||
// Returns true if the given item looks like a region, which is a list of paths.
|
// Returns true if the given item looks like a region. A region is defined as a list of zero or more paths.
|
||||||
function is_region(x) = is_list(x) && is_path(x.x);
|
function is_region(x) = is_list(x) && is_path(x.x);
|
||||||
|
|
||||||
|
|
||||||
@@ -1288,6 +1288,7 @@ module region(r)
|
|||||||
// heightfield = The 2D rectangular array of heights.
|
// 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.
|
// 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
|
// 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:
|
// Example:
|
||||||
// heightfield(size=[100,100], bottom=-20, heightfield=[
|
// heightfield(size=[100,100], bottom=-20, heightfield=[
|
||||||
// for (x=[-180:4:180]) [for(y=[-180:4:180]) 10*cos(3*norm([x,y]))]
|
// for (x=[-180:4:180]) [for(y=[-180:4:180]) 10*cos(3*norm([x,y]))]
|
||||||
|
Reference in New Issue
Block a user