def gridExample(): starGrid = cloneGrid(Star(beams=5), 0, 20, 20, 4, 4) starGrid.shift(-50, -50) cookie = Star(radius=30.0, beams=5, iradius=20.0) - Circle(radius=15.0) starCookie = cookie - starGrid writeSVG('StarCookie.svg', (starCookie,)) if hasPDFExport: writePDF('StarCookie.pdf', (starCookie,))
def gridExample(): starGrid = cloneGrid(Star(beams=5), 0, 20, 20, 4, 4) starGrid.shift(-50, -50) cookie = Star(radius=30.0, beams=5, iradius=20.0) - Circle(radius=15.0) starCookie = cookie - starGrid writeSVG('StarCookie.svg', (starCookie,)) if hasPDFExport: writePDF('StarCookie.pdf', (starCookie,))
def testLargeOperations(self): sheet = Rectangle(1000, 500) perf = cloneGrid(Circle(0.5, points=32), 0, 200, 100, 5, 5) perfSheet = sheet - perf #print 'perfSheet has %d points in %d contours' % (perfSheet.nPoints(), len(perfSheet)) circle = Circle(400, points=512) circle.scale(1.0, 0.5) circle.shift(500, 250) perfCircle = circle & perfSheet #print 'perfCircle has %d points in %d contours' % (perfCircle.nPoints(), len(perfCircle)) perfCircle.write('perfcircle.gpf')
def testLargeOperations(self): sheet = Rectangle(1000, 500) perf = cloneGrid(Circle(0.5, points=32), 0, 200, 100, 5, 5) perfSheet = sheet - perf circle = Circle(400, points=512) circle.scale(1.0, 0.5) circle.shift(500, 250) perfCircle = circle & perfSheet perfCircle.write('perfcircle.gpf', ) c, h, p, hf = gpfInfo('perfcircle.gpf') self.assertEqual(c, len(perfCircle)) self.assertEqual(p, perfCircle.nPoints()) self.assertEqual(hf, True)