mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-22 13:43:34 +02:00
Fixed broken line-plane intersections. Attachment enhanced vnf_polyhedron().
This commit is contained in:
@@ -53,7 +53,7 @@ test_tri_functions();
|
||||
//test__general_plane_line_intersection();
|
||||
//test_plane_line_angle();
|
||||
//test_plane_line_intersection();
|
||||
//test_polygon_line_intersection();
|
||||
test_polygon_line_intersection();
|
||||
//test_plane_intersection();
|
||||
test_coplanar();
|
||||
test_points_on_plane();
|
||||
@@ -542,6 +542,17 @@ module test_distance_from_plane() {
|
||||
*test_distance_from_plane();
|
||||
|
||||
|
||||
module test_polygon_line_intersection() {
|
||||
poly1 = [[50,50,50], [50,-50,50], [-50,-50,50]];
|
||||
assert_approx(polygon_line_intersection(poly1, [CENTER, UP]), [0,0,50]);
|
||||
assert_approx(polygon_line_intersection(poly1, [CENTER, UP+RIGHT]), [50,0,50]);
|
||||
assert_approx(polygon_line_intersection(poly1, [CENTER, UP+BACK+RIGHT]), [50,50,50]);
|
||||
assert_approx(polygon_line_intersection(poly1, [[0,0,50], [1,0,50]]), [[[0,0,50], [50,0,50]]]);
|
||||
assert_approx(polygon_line_intersection(poly1, [[0,0,0], [1,0,0]]), undef);
|
||||
}
|
||||
*test_polygon_line_intersection();
|
||||
|
||||
|
||||
module test_coplanar() {
|
||||
assert(coplanar([ [5,5,1],[0,0,1],[-1,-1,1] ]) == false);
|
||||
assert(coplanar([ [5,5,1],[0,0,0],[-1,-1,1] ]) == true);
|
||||
|
Reference in New Issue
Block a user