Merge pull request #1850 from KLayout/wip

Wip
This commit is contained in:
Matthias Köfferlein
2024-09-21 20:33:21 +02:00
committed by GitHub
28 changed files with 816 additions and 161 deletions
+132
View File
@@ -0,0 +1,132 @@
source $drc_test_source
target $drc_test_target
lp = polygons
le = edges
ll = labels
lp.insert(RBA::Box::new(0, 0, 100, 200))
lp.insert(RBA::DBox::new(0.200, 0, 0.300, 0.200))
lp.insert(RBA::Polygon::new(RBA::Box::new(400, 0, 500, 200)))
lp.insert(RBA::DPolygon::new(RBA::DBox::new(0.600, 0, 0.700, 0.200)))
lp.insert(RBA::SimplePolygon::new(RBA::Box::new(800, 0, 900, 200)))
lp.insert(RBA::DSimplePolygon::new(RBA::DBox::new(1.000, 0, 1.100, 0.200)))
lp.insert(RBA::Path::new([ RBA::Point::new(1200, 100), RBA::Point::new(1300, 100) ], 200))
lp.insert(RBA::DPath::new([ RBA::DPoint::new(1.400, 0.1), RBA::DPoint::new(1.500, 0.1) ], 0.2))
begin
lp.insert(RBA::Edge::new(RBA::Point::new(0, 0), RBA::Point::new(100, 100)))
raise Exception::new("Error expected")
rescue => ex
end
begin
lp.insert(RBA::DEdge::new(RBA::DPoint::new(0, 0), RBA::DPoint::new(0.1, 0.1)))
raise Exception::new("Error expected")
rescue => ex
end
begin
lp.insert(RBA::Text::new("ABC", RBA::Trans::new(RBA::Vector::new(0, 0))))
raise Exception::new("Error expected")
rescue => ex
end
begin
lp.insert(RBA::DText::new("XYZ", RBA::DTrans::new(RBA::DVector::new(0, 0.1))))
raise Exception::new("Error expected")
rescue => ex
end
le.insert(RBA::Box::new(0, 0, 100, 200))
le.insert(RBA::DBox::new(0.200, 0, 0.300, 0.200))
le.insert(RBA::Polygon::new(RBA::Box::new(400, 0, 500, 200)))
le.insert(RBA::DPolygon::new(RBA::DBox::new(0.600, 0, 0.700, 0.200)))
le.insert(RBA::SimplePolygon::new(RBA::Box::new(800, 0, 900, 200)))
le.insert(RBA::DSimplePolygon::new(RBA::DBox::new(1.000, 0, 1.100, 0.200)))
le.insert(RBA::Path::new([ RBA::Point::new(1200, 100), RBA::Point::new(1300, 100) ], 200))
le.insert(RBA::DPath::new([ RBA::DPoint::new(1.400, 0.1), RBA::DPoint::new(1.500, 0.1) ], 0.2))
le.insert(RBA::Edge::new(RBA::Point::new(0, 0), RBA::Point::new(100, 100)))
le.insert(RBA::DEdge::new(RBA::DPoint::new(0, 0.1), RBA::DPoint::new(0.1, 0.2)))
begin
le.insert(RBA::Text::new("ABC", RBA::Trans::new(RBA::Vector::new(0, 0))))
raise Exception::new("Error expected")
rescue => ex
end
begin
le.insert(RBA::DText::new("XYZ", RBA::DTrans::new(RBA::DVector::new(0, 0.1))))
raise Exception::new("Error expected")
rescue => ex
end
begin
ll.insert(RBA::Box::new(0, 0, 100, 200))
raise Exception::new("Error expected")
rescue => ex
end
begin
ll.insert(RBA::DBox::new(0.200, 0, 0.300, 0.200))
raise Exception::new("Error expected")
rescue => ex
end
begin
ll.insert(RBA::Polygon::new(RBA::Box::new(400, 0, 500, 200)))
raise Exception::new("Error expected")
rescue => ex
end
begin
ll.insert(RBA::DPolygon::new(RBA::DBox::new(0.600, 0, 0.700, 0.200)))
raise Exception::new("Error expected")
rescue => ex
end
begin
ll.insert(RBA::SimplePolygon::new(RBA::Box::new(800, 0, 900, 200)))
raise Exception::new("Error expected")
rescue => ex
end
begin
ll.insert(RBA::DSimplePolygon::new(RBA::DBox::new(1.000, 0, 1.100, 0.200)))
raise Exception::new("Error expected")
rescue => ex
end
begin
ll.insert(RBA::Path::new([ RBA::Point::new(1200, 100), RBA::Point::new(1300, 100) ], 200))
raise Exception::new("Error expected")
rescue => ex
end
begin
ll.insert(RBA::DPath::new([ RBA::DPoint::new(1.400, 0.1), RBA::DPoint::new(1.500, 0.1) ], 0.2))
raise Exception::new("Error expected")
rescue => ex
end
begin
ll.insert(RBA::Edge::new(RBA::Point::new(0, 0), RBA::Point::new(100, 100)))
raise Exception::new("Error expected")
rescue => ex
end
begin
ll.insert(RBA::DEdge::new(RBA::DPoint::new(0, 0.1), RBA::DPoint::new(0.1, 0.2)))
raise Exception::new("Error expected")
rescue => ex
end
ll.insert(RBA::Text::new("ABC", RBA::Trans::new(RBA::Vector::new(100, 0))))
ll.insert(RBA::DText::new("XYZ", RBA::DTrans::new(RBA::DVector::new(0, 0.1))))
lp.output(1, 0)
le.output(2, 0)
ll.output(3, 0)
Binary file not shown.
Binary file not shown.
+6 -1
View File
@@ -489,7 +489,8 @@ class DBLayoutTests2_TestClass < TestBase
def test_6_Layout_props
ly = RBA::Layout::new
pid = ly.properties_id( { 17 => "a", "b" => [ 1, 5, 7 ] }.to_a )
pid = ly.properties_id({ 17 => "a", "b" => [ 1, 5, 7 ] }.to_a)
assert_equal(ly.properties_id({ 17 => "a", "b" => [ 1, 5, 7 ] }), pid)
ci1 = ly.add_cell( "c1" )
ci2 = ly.add_cell( "c2" )
@@ -1051,6 +1052,10 @@ class DBLayoutTests2_TestClass < TestBase
assert_equal(ly.prop_id, 1)
assert_equal(ly.property("x"), 1)
assert_equal(ly.properties, {"x" => 1})
assert_equal(ly.properties_hash(ly.prop_id), {"x" => 1})
assert_equal(ly.properties_id(ly.properties_hash(ly.prop_id)), ly.prop_id)
assert_equal(ly.properties_array(ly.prop_id), [["x", 1]])
assert_equal(ly.properties_id(ly.properties_array(ly.prop_id)), ly.prop_id)
ly.set_property("x", 17)
assert_equal(ly.prop_id, 2)
assert_equal(ly.property("x"), 17)