120 if ( ( $children * c ) > ( gridx * gridy * gridz ) )
122 log_warn(
"more objects than grid capacity, shapes will overlap.");
127 "children=", $children,
129 ", objects=", $children * c
136 "grid[x,y,z]=[", gridx,
", ", gridy,
", ", gridz,
"]",
137 ", capacity=", gridx * gridy * gridz
146 -( min($children * c, gridx) -1 ) * incrx / 2,
147 -( min(ceil($children * c/gridx), gridy) -1 ) * incry / 2,
148 -( min(ceil($children * c/gridx/gridy), gridz) -1 ) * incrz / 2
157 x = [0 : ($children-1)]
160 j = y * $children + x;
166 incry * (floor(j/gridx)%gridy),
167 incrz * (floor(floor(j/gridx)/gridy)%gridz)
module log_warn(m)
Output warning message to console.
module log_info(m)
Output information message to console.
origin2d
<point-2d> The origin point coordinate in 2d Euclidean space.
origin3d
<point-3d> The origin point coordinate in 3-dimensional Euclidean space.
x_axis2d_uv
<vector-2d> The unit vector of the positive x-axis in 2d Euclidean space.
function angle_ll(l1, l2, s=true)
Compute the angle between two lines or vectors in a 3d or 2d-space.
function defined_e_or(v, i, d)
Return an element of an iterable when it exists or a default value otherwise.
function is_scalar(v)
Test if a value is a single non-iterable value.
function polygon_regular_p(n, r, a, c=origin2d, o=0, vr, cw=true)
Compute coordinates for an n-sided regular polygon in 2D.
function angle(a, from=angle_unit_default, to=angle_unit_base)
Convert an angle from some units to another.