def perform_get_levelset(parser, model): (opt, args) = parser.parse_args() res = pyfx.Vector(*opt.grid_resolution) pad = pyfx.Vector(*opt.padding) print("Resolution: ", common.strvector(res)) print("Padding: ", common.strvector(pad)) print("Threshold: ", opt.threshold) with timer.print_on_finish("Levelset Generation"): levelset = pyfx.Levelset(model, res, pad, opt.threshold) return levelset
def fetch_renderer(opt): renderer = render.Render(quality=render.get_quality( opt.quality, fetch_quality(opt)), scatter=opt.scatter, dsm_step=opt.dsm_step, dsm_size=opt.dsm_size, name=opt.name, frame=opt.frame, light_fov=opt.fov, output=opt.output) for (x, y, z, intensity) in opt.lights: light = pyfx.Light(pyfx.Vector(x, y, z), pyfx.Color(1), intensity) renderer.add_light(light) return renderer
def fetch_translate(opt): if opt.translate == None: return None return pyfx.Vector(*opt.translate)
def fetch_rotation(opt): """Fetch rotation parameters from arguments""" if opt.rotate == None: return None axis = opt.rotate[:3] theta = math.radians(opt.rotate[3]) return (pyfx.Vector(*axis), theta)
def fetch_up(opt): """Fetch up vector.""" return pyfx.Vector(*opt.up)
def fetch_view(opt): """Fetch view vector from arguments.""" return pyfx.Vector(*opt.view)
def fetch_eye(opt): """Fetch eye vector from arguments.""" return pyfx.Vector(*opt.eye)