def shapeGen():
	x, y = yield
	(x,y) = yield vibes.drawArrow([x-1, y-1], [x+1, y+1], 0.6, 'k[k]')
	(x,y) = yield vibes.drawAUV(x,y,45,2, 'k[y]')
	(x,y) = yield vibes.drawBox(x-1,x+1,y-2,y+2, "[b]")
	(x,y) = yield vibes.drawBoxesUnion([[x-1,x,y-2,y], [x-0.5,x+1,y-0.5,y+2]], "[r]")
	(x,y) = yield vibes.drawCircle(x,y,1, "g[m]")
	(x,y) = yield vibes.drawEllipse(x,y,2,1,45, color="r[darkCyan]")
	(x,y) = yield vibes.drawLine([[x-0.5, y-1], [x+1, y+0.5]], "k")
	(x,y) = yield vibes.drawPie( (x-2, y-2), (1,2.5), [20,70] , "y[cyan]")
	(x,y) = yield vibes.drawPolygon([[x-1,y-1], [x, y+1], [ x+1, y-1]], "k[orange]")
	(x,y) = yield vibes.drawRing(x,y, 1,2, '[red]')
	# (x,y) = yield vibes.drawPie( (x, y), (1,2), [0,360] , "y[cyan]")
	(x,y) = yield vibes.drawVehicle( x, y, 20, 1, "[darkBlue]")
	(x,y) = yield vibes.drawPoint( x,y, 1, "[k]")
	(x,y) = yield vibes.drawText( x,y, "Text", 1)
Beispiel #2
0
def shapeGen():
    x, y = yield
    (x, y) = yield vibes.drawArrow([x - 1, y - 1], [x + 1, y + 1], 0.6, 'k[k]')
    (x, y) = yield vibes.drawAUV(x, y, 45, 2, 'k[y]')
    (x, y) = yield vibes.drawBox(x - 1, x + 1, y - 2, y + 2, "[b]")
    (x, y) = yield vibes.drawBoxesUnion(
        [[x - 1, x, y - 2, y], [x - 0.5, x + 1, y - 0.5, y + 2]], "[r]")
    (x, y) = yield vibes.drawCircle(x, y, 1, "g[m]")
    (x, y) = yield vibes.drawEllipse(x, y, 2, 1, 45, color="r[darkCyan]")
    (x, y) = yield vibes.drawLine([[x - 0.5, y - 1], [x + 1, y + 0.5]], "k")
    (x, y) = yield vibes.drawPie((x - 2, y - 2), (1, 2.5), [20, 70], "y[cyan]")
    (x,
     y) = yield vibes.drawPolygon([[x - 1, y - 1], [x, y + 1], [x + 1, y - 1]],
                                  "k[orange]")
    (x, y) = yield vibes.drawRing(x, y, 1, 2, '[red]')
    # (x,y) = yield vibes.drawPie( (x, y), (1,2), [0,360] , "y[cyan]")
    (x, y) = yield vibes.drawVehicle(x, y, 20, 1, "[darkBlue]")
    (x, y) = yield vibes.drawPoint(x, y, 1, "[k]")
    (x, y) = yield vibes.drawText(x, y, "Text", 1)
Beispiel #3
0
    # pdc = test3(m)
    # #vibes.clearFigure()
    # SIVIA(X0, pdc, 0.5)
    # 
    # for m_ in m:
    #     vibes.drawCircle(m_[0].mid(), m_[1].mid(), 0.2, '[k]')
    # vibes.drawArrow([-15, -15], [-15, -10], 1, 'w[w]')
    # vibes.drawArrow([-15, -15], [-10, -15], 1, 'w[w]')
    
    
    for t in range(10):
        time1 = time.time()
        m= [[cx1 , cy1 ],[cx2, cy2],[cx3, cy3]]
        pdc = (m,100,True)
        vibes.clearFigure()
        box = pyIbex.SIVIAtest(X0,m,100,1,True)
        print(type(box),len(box))
        for m_ in m:
            vibes.drawCircle(m_[0].mid(), m_[1].mid(), 0.5, '[k]')
        vibes.drawArrow([-15, -15], [-15, -10], 1, 'w[w]')
        vibes.drawArrow([-15, -15], [-10, -15], 1, 'w[w]')
        vibes.drawBoxesUnion(listBoxToDraw(box),'[r]')
        cx1,cy1,v1,p1 = subMove(cx1,cy1,v1,p1,u1,h)
        cx2,cy2,v2,p2 = subMove(cx2,cy2,v2,p2,u2,h)
        cx3,cy3,v3,p3 = subMove(cx3,cy3,v3,p3,u3,h)
        print(time.time()-time1)
        time.sleep(3)

        
    vibes.endDrawing()
    
    # simulation
    h=0.7
    

    vibes.beginDrawing()
    vibes.newFigure('Zone de non detection')
    vibes.setFigureProperties({'x':500, 'y':100, 'width':800, 'height':800})    
    
    for t in range(10):
        time1 = time.time()
        m= [[cx1 , cy1 ],[cx2, cy2],[cx3, cy3]]
        vibes.clearFigure()
        lbox = pyIbex.fSIVIAtest(X0,m,rang2,epsilon,efficient)
        print(type(lbox),len(lbox))
        vibes.drawBoxesUnion(listBoxToDraw(lbox[0]),'[r]')
        vibes.drawBoxesUnion(listBoxToDraw(lbox[1]),'[b]')
        vibes.drawBoxesUnion(listBoxToDraw(lbox[2]),'[orange]')
        vibes.drawBoxesUnion(listBoxToDraw(lbox[3]),'[y]')
        for m_ in m:
            vibes.drawCircle(m_[0].mid(), m_[1].mid(), 0.5, '[k]')
        vibes.drawArrow([-15, -15], [-15, -10], 1, 'w[w]')
        vibes.drawArrow([-15, -15], [-10, -15], 1, 'w[w]')
        cx1,cy1,v1,p1 = subMove(cx1,cy1,v1,p1,u1,h)
        cx2,cy2,v2,p2 = subMove(cx2,cy2,v2,p2,u2,h)
        cx3,cy3,v3,p3 = subMove(cx3,cy3,v3,p3,u3,h)
        print(time.time()-time1)
        time.sleep(3)

        
    vibes.endDrawing()