MCPcopy Create free account
hub / github.com/KLayout/klayout / test_2_Trans

Method test_2_Trans

testdata/python/dbTransTest.py:294–321  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

292
293 # Complex transformation basics
294 def test_2_Trans(self):
295
296 a = pya.Trans()
297 b = pya.Trans( pya.Trans.M135, pya.Point( 17, 5 ))
298 ma = pya.CplxTrans( a, 0.5 )
299 mb = pya.CplxTrans( b, 2.0 )
300 u = pya.CplxTrans( a )
301
302 self.assertEqual( str(ma), "r0 *0.5 0,0" )
303 self.assertEqual( str(mb), "m135 *2 17,5" )
304
305 self.assertEqual( ma == mb, False )
306 self.assertEqual( ma == ma, True )
307 self.assertEqual( ma != mb, True )
308 self.assertEqual( ma != ma, False )
309
310 self.assertEqual( str(mb.inverted()), "m135 *0.5 2.5,8.5" )
311
312 i = mb.dup()
313 i.invert()
314
315 self.assertEqual( str(i), "m135 *0.5 2.5,8.5" )
316 self.assertEqual( i * mb == u, True )
317 self.assertEqual( mb * i == u, True )
318
319 self.assertEqual( str(mb.trans( pya.Point( 1, 0 ))), "17,3" )
320 self.assertEqual( str(mb.ctrans(2)), "4.0" )
321 self.assertEqual( str(i.ctrans(2)), "1.0" )
322
323 # Complex transformation specials
324 def test_3_Trans(self):

Callers

nothing calls this directly

Calls 7

strFunction · 0.85
PointMethod · 0.45
invertedMethod · 0.45
dupMethod · 0.45
invertMethod · 0.45
transMethod · 0.45
ctransMethod · 0.45

Tested by

no test coverage detected