mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-03 07:43:24 +02:00
Smooth bug (#740)
* Smoothing function: provide ability to keep horizontal/vertical lines (important for cut lines) * Introducting API compatibility macros for generic plugins.
This commit is contained in:
Vendored
BIN
Binary file not shown.
Vendored
+3
@@ -289,6 +289,9 @@ class DBPolygonTests(unittest.TestCase):
|
||||
p = pya.Polygon( [ pya.Point.new(0, 0), pya.Point.new(10, 50), pya.Point.new(0, 100), pya.Point.new(200, 100), pya.Point.new(200, 0) ])
|
||||
self.assertEqual(str(p.smooth(5)), "(0,0;10,50;0,100;200,100;200,0)")
|
||||
self.assertEqual(str(p.smooth(15)), "(0,0;0,100;200,100;200,0)")
|
||||
p = pya.Polygon( [ pya.Point.new(0, 0), pya.Point.new(10, 50), pya.Point.new(10, 100), pya.Point.new(200, 100), pya.Point.new(200, 0) ])
|
||||
self.assertEqual(str(p.smooth(15, False)), "(0,0;10,100;200,100;200,0)")
|
||||
self.assertEqual(str(p.smooth(15, True)), "(0,0;10,50;10,100;200,100;200,0)")
|
||||
|
||||
# Ellipse constructor
|
||||
p = pya.Polygon.ellipse( pya.Box(-10000, -20000, 30000, 40000), 200 )
|
||||
|
||||
Vendored
+3
@@ -304,6 +304,9 @@ class DBPolygon_TestClass < TestBase
|
||||
p = RBA::Polygon::new( [ RBA::Point.new(0, 0), RBA::Point.new(10, 50), RBA::Point.new(0, 100), RBA::Point.new(200, 100), RBA::Point.new(200, 0) ])
|
||||
assert_equal(p.smooth(5).to_s, "(0,0;10,50;0,100;200,100;200,0)")
|
||||
assert_equal(p.smooth(15).to_s, "(0,0;0,100;200,100;200,0)")
|
||||
p = RBA::Polygon::new( [ RBA::Point.new(0, 0), RBA::Point.new(10, 50), RBA::Point.new(10, 100), RBA::Point.new(200, 100), RBA::Point.new(200, 0) ])
|
||||
assert_equal(p.smooth(15, false).to_s, "(0,0;10,100;200,100;200,0)")
|
||||
assert_equal(p.smooth(15, true).to_s, "(0,0;10,50;10,100;200,100;200,0)")
|
||||
|
||||
# Ellipse constructor
|
||||
p = RBA::Polygon::ellipse( RBA::Box::new(-10000, -20000, 30000, 40000), 200 )
|
||||
|
||||
Reference in New Issue
Block a user