Ejemplo n.º 1
0
  elif keys[pygame.K_ESCAPE]:
    screen.fill(BG)
    pygame.display.flip()
    bspline.clear()
    nurbs.clear()
    ctrl_x = []
    ctrl_y = []
    spline = True
    got_c1 = False
    time.sleep(0.3)

  if spline and len(ctrl_x) == 9:
    if bspline.update(ctrl_x, ctrl_y):
      spline = False
      screen.fill(BG)
      bspline.draw(iterative=True)
      ctrl_x = []
      ctrl_y = []
    else:
      print('erro Bspline', len(ctrl_x))
  elif (not spline) and len(ctrl_x) == 8:
    if nurbs.update(ctrl_x, ctrl_y, weights):
      spline = True
      nurbs.draw(iterative=True)
    else:
      print('erro NURBS', len(ctrl_x))


  if spline:
    m1, m2, m3 = pygame.mouse.get_pressed()
    if m1 == 1: