Updated tests with 'enclosed' rule

This commit is contained in:
Matthias Koefferlein 2021-11-09 00:32:23 +01:00
parent 319efc1f95
commit ac1167278e
11 changed files with 21 additions and 0 deletions

View File

@ -43,4 +43,5 @@ l1.drc(isolated(projection, not_opposite) < 1.0).output(144, 0)
# enclosing, overlap
l2.drc(enclosing(l1, projection) < 1.0).polygons.output(150, 0)
l1.drc(overlap(l2, projection) < 2.0).polygons.output(151, 0)
l1.drc(enclosed(l2, projection) < 1.0).polygons.output(152, 0)

Binary file not shown.

Binary file not shown.

View File

@ -33,9 +33,17 @@ l2.separation(l1, projection, 1.0, whole_edges).output(211, 0)
l1.drc(enclosing(l2, projection) < 1.0).output(400, 0)
l1.drc(enclosing(l2, whole_edges, projection) < 1.0).output(401, 0)
l1.drc(enclosing(l2, projection) >= 1.0).output(402, 0)
l2.drc(enclosed(l1, projection) < 1.0).output(403, 0)
l2.drc(enclosed(l1, whole_edges, projection) < 1.0).output(404, 0)
l2.drc(enclosed(l1, projection) >= 1.0).output(405, 0)
l1.enclosing(l2, projection, 1.0).output(410, 0)
l1.enclosing(l2, projection, 1.0, whole_edges).output(411, 0)
l2.enclosed(l1, projection, 1.0).output(412, 0)
l2.enclosed(l1, projection, 1.0, whole_edges).output(413, 0)
l1.drc(overlap(l2, projection) < 1.0).output(500, 0)
l1.drc(overlap(l2, whole_edges, projection) < 1.0).output(501, 0)
l1.drc(overlap(l2, projection) >= 1.0).output(502, 0)

Binary file not shown.

Binary file not shown.

View File

@ -134,6 +134,10 @@ def run_testsuite(dm, ic, tiled = false, hier = false)
a.enclosing(b, 0.5, whole_edges).second_edges.extended_out(0.01).output(lb + 1, dm)
a.enclosing(b, 0.5, whole_edges).edges.extended_out(0.01).output(lb + 2, dm)
b.enclosed(a, 0.5, whole_edges).second_edges.extended_out(0.01).output(lb + 3, dm)
b.enclosed(a, 0.5, whole_edges).first_edges.extended_out(0.01).output(lb + 4, dm)
b.enclosed(a, 0.5, whole_edges).edges.extended_out(0.01).output(lb + 5, dm)
lb += 10 #150
message "--- hulls, holes #{lb}"
@ -323,6 +327,8 @@ def run_testsuite(dm, ic, tiled = false, hier = false)
else
a.enclosing(b, 0.5, euclidian, projection_limits(0, 0.4)).polygons.output(lb + 7, dm)
end
b.enclosed(a, 0.5, euclidian, projection_limits(nil, 0.4)).polygons.output(lb + 8, dm)
lb += 10 #220
message "--- enclosing (edges) #{lb}"
@ -343,6 +349,8 @@ def run_testsuite(dm, ic, tiled = false, hier = false)
ae.enclosing(be, 0.5, euclidian, projection_limits(0, 0.4)).polygons.output(lb + 7, dm)
end
be.enclosed(ae, 0.5, euclidian, whole_edges).polygons.output(lb + 8, dm)
lb += 10 #230
message "--- isolated #{lb}"

Binary file not shown.

Binary file not shown.

View File

@ -398,6 +398,8 @@ class DBEdges_TestClass < TestBase
r3b = RBA::Edges::new(RBA::Box::new(-10, -10, 10, 10))
assert_equal(r2.inside_check(r3, 15).to_s, "(120,20;120,380)/(110,9;110,391)")
# "enclosed" alias
assert_equal(r2.enclosed_check(r3, 15).to_s, "(120,20;120,380)/(110,9;110,391)")
assert_equal(r2.inside_check(r3, 15, false, RBA::Edges::Projection, nil, nil, nil).to_s, "(120,20;120,380)/(110,20;110,380)")
assert_equal(r2.inside_check(r3, 15, true, RBA::Edges::Projection, nil, nil, nil).to_s, "(120,20;120,380)/(110,0;110,400)")
assert_equal(r2.inside_check(r3, 15, true, RBA::Edges::Projection, 0.0, nil, nil).to_s, "")

View File

@ -454,6 +454,8 @@ class DBRegion_TestClass < TestBase
r3b = RBA::Region::new(RBA::Box::new(-10, -10, 10, 10))
assert_equal(r2.inside_check(r3, 15).to_s, "(120,20;120,380)/(110,9;110,391)")
# "enclosed" alias
assert_equal(r2.enclosed_check(r3, 15).to_s, "(120,20;120,380)/(110,9;110,391)")
assert_equal(r2.inside_check(r3, 15, false, RBA::Region::Projection, nil, nil, nil).to_s, "(120,20;120,380)/(110,20;110,380)")
assert_equal(r2.inside_check(r3, 15, true, RBA::Region::Projection, nil, nil, nil).to_s, "(120,20;120,380)/(110,0;110,400)")
assert_equal(r2.inside_check(r3, 15, true, RBA::Region::Projection, 0.0, nil, nil).to_s, "")