Example #1
0
def ldr2png(ldraw_path, png_path, look_at_position, camera_position, png_args):
    """ Implementation of ldr2png """
    verify_camera_look_at(camera_position, look_at_position)

    model, parts = get_model(ldraw_path)

    system = get_coordinate_system(camera_position, look_at_position)

    writer = PNGWriter(camera_position, system, parts)
    writer.write(model, png_path, png_args)
Example #2
0
def ldr2svg(ldraw_path, svg_path, camera_position, look_at_position, svg_args):  # pylint: disable=too-many-arguments
    """ ldr2svg actual implementation """
    verify_camera_look_at(camera_position, look_at_position)

    model, parts = get_model(ldraw_path)

    system = get_coordinate_system(camera_position, look_at_position)

    with open(svg_path, "w") as svg_file:
        from ldraw.writers.svg import SVGWriter
        writer = SVGWriter(camera_position, system, parts)
        writer.write(model, svg_file, svg_args)