Ejemplo n.º 1
0
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,))
Ejemplo n.º 2
0
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,))
Ejemplo n.º 3
0
 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')
Ejemplo n.º 4
0
 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)