mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-01-16 21:58:27 +01:00
commit
1761afff77
@ -95,10 +95,10 @@ function half_of(p, v=UP, cp) =
|
|||||||
assert(is_vector(v,2) || (is_vector(v,3) && v.z==0),"Must give 2-vector")
|
assert(is_vector(v,2) || (is_vector(v,3) && v.z==0),"Must give 2-vector")
|
||||||
assert(!all_zero(v), "Vector v must be nonzero")
|
assert(!all_zero(v), "Vector v must be nonzero")
|
||||||
let(
|
let(
|
||||||
bounds = pointlist_bounds(move(-cp,p)),
|
v=unit(v),
|
||||||
L = 2*max(flatten(bounds)),
|
bounds = pointlist_bounds(is_region(p)?flatten(p):p),
|
||||||
n = unit(v),
|
L = 2*max(norm(bounds[0]-cp), norm(bounds[1]-cp)),
|
||||||
u = [-n.y,n.x],
|
u = [-v.y,v.x],
|
||||||
box = [cp+u*L, cp+(v+u)*L, cp+(v-u)*L, cp-u*L]
|
box = [cp+u*L, cp+(v+u)*L, cp+(v-u)*L, cp-u*L]
|
||||||
)
|
)
|
||||||
intersection(box,p)
|
intersection(box,p)
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
BOSL_VERSION = [2,0,672];
|
|
||||||
|
BOSL_VERSION = [2,0,674];
|
||||||
|
|
||||||
|
|
||||||
// Section: BOSL Library Version Functions
|
// Section: BOSL Library Version Functions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user