def main(args):

    from render.render import Render
    from dddUtils.ioOBJ import load_2d as load

    #from modules.show import show
    from modules.show import show_closed

    data = load(args.fn)

    size = args.size
    one = 1.0 / size
    vertices = data['vertices']
    lines = data['lines']

    render = Render(size, BACK, FRONT)

    render.ctx.set_source_rgba(*FRONT)
    render.ctx.set_line_width(args.width * one)

    out = ''.join(args.fn.split('.')[:-1]) + '.png'

    show_closed(render, vertices[lines[0], :], out, fill=args.closed)
    #for vv in vertices:
    #render.circle(vv[0], vv[1], one, fill=True)

    render.write_to_png(out)

    return
def main(args):

  from render.render import Render
  from dddUtils.ioOBJ import load
  from numpy import array

  data = load(args.fn)

  size = args.size
  one = 1.0/size
  vertices = data['vertices'][:,:2]

  back = [1,1,1,1]
  front = [0,0,0,args.alpha]

  rad = args.rad*one

  vertices -= get_mid(vertices)
  vertices *= args.scale
  vertices += array([[0.5,0.5]])

  render = Render(size, back, front)

  render.ctx.set_source_rgba(*front)
  render.ctx.set_line_width(one)

  out = ''.join(args.fn.split('.')[:-1])+'.png'

  for vv in vertices:
    render.circle(vv[0], vv[1], rad, fill=True)

  render.write_to_png(out)

  return
def main(args):

  from render.render import Render
  from dddUtils.ioOBJ import load_2d as load

  #from modules.show import show
  from modules.show import show_closed

  data = load(args.fn)

  size = args.size
  one = 1.0/size
  vertices = data['vertices']
  lines = data['lines']

  render = Render(size, BACK, FRONT)

  render.ctx.set_source_rgba(*FRONT)
  render.ctx.set_line_width(args.width*one)

  out = ''.join(args.fn.split('.')[:-1])+'.png'

  show_closed(render, vertices[lines[0],:], out, fill=args.closed)
  #for vv in vertices:
    #render.circle(vv[0], vv[1], one, fill=True)

  render.write_to_png(out)


  return
def main(args):

    from render.render import Render
    from dddUtils.ioOBJ import load
    from numpy import array

    data = load(args.fn)

    size = args.size
    one = 1.0 / size
    vertices = data['vertices'][:, :2]

    back = [1, 1, 1, 1]
    front = [0, 0, 0, args.alpha]

    rad = args.rad * one

    vertices -= get_mid(vertices)
    vertices *= args.scale
    vertices += array([[0.5, 0.5]])

    render = Render(size, back, front)

    render.ctx.set_source_rgba(*front)
    render.ctx.set_line_width(one)

    out = ''.join(args.fn.split('.')[:-1]) + '.png'

    for vv in vertices:
        render.circle(vv[0], vv[1], rad, fill=True)

    render.write_to_png(out)

    return
Esempio n. 5
0
def main(args):

  from dddUtils.ioOBJ import load_2d as load
  from render.render import Render

  fn = args.fn
  dot_size = args.dotSize

  data = load(fn)
  vertices = data['vertices']

  render = Render(SIZE, BACK, FRONT)
  draw(render, vertices, dot_size)

  out = fn + '.png'
  render.write_to_png(out)
def main(args):

  from dddUtils.ddd import get_mid_2d as get_mid
  from render.render import Render
  from dddUtils.ioOBJ import load
  from modules.show import show_closed

  from numpy import array

  data = load(args.fn)
  size = args.size

  if args.fill:
    fill = True
  else:
    fill = False

  one = 1.0/size
  vertices = data['vertices']

  print(vertices)

  if args.scale:

    vertices -= get_mid(vertices)
    vertices *= args.scale
    vertices += array([[0.5,0.5]])

  render = Render(size, BACK, FRONT)

  render.ctx.set_source_rgba(*FRONT)
  render.ctx.set_line_width(args.width*one)

  out = ''.join(args.fn.split('.')[:-1])+'.png'

  show_closed(render, vertices, out, fill=fill)

  #render.ctx.set_source_rgba(*[1,0,0,1])
  #for vv in vertices:
    #render.circle(vv[0], vv[1], one*4, fill=False)

  render.write_to_png(out)

  return