def make_prisms(pq, trunc_type): p, q = pq P = models.Polychora((p, 2, 2, q, 2, 2), trunc_type + (1, )) P.build_geometry() P.export_pov() command = template.format("prism.pov", "{}-{}-prism".format(p, q)) call(command, shell=True)
def make_duoprisms(pq, weights=(1.0, 1.0)): p, q = pq P = models.Polychora((p, 2, 2, 2, 2, q), (weights[0], 0, weights[1], 0)) P.build_geometry() P.export_pov() command = template.format("duoprism.pov", "{}-{}-duoprism".format(p, q)) call(command, shell=True)
def make_polychora(coxeter_diagram, trunc_type, output, flat=True): P = models.Polychora(coxeter_diagram, trunc_type) P.build_geometry() P.export_pov() script = "flat_polychora.pov" if flat else "curved_polychora.pov" command = template.format(script, output) call(command, shell=True)
def render_polychora(coxeter_diagram, trunc_type, render_file, output=None): """ The main entrance for rendering 4d polychora. """ coxeter_matrix = helpers.fill_matrix(coxeter_diagram) mirrors = helpers.get_mirrors(coxeter_diagram) P = models.Polychora(coxeter_matrix, mirrors, trunc_type) _render_model(P, render_file, output)
def render_polychora(coxeter_diagram, trunc_type, render_file, description=None): if not description: description = render_file[:-4] P = models.Polychora(coxeter_diagram, trunc_type) P.build_geometry() P.export_pov() command = TEMPLATE.format(render_file, description) subprocess.call(command, shell=True)
def render_polychora(coxeter_diagram, trunc_type, render_file, description=None): """ The main entrance for rendering 4d polychora. """ if not description: description = render_file[:-4] P = models.Polychora(coxeter_diagram, trunc_type) _render_model(P, render_file, description)
def make_120_cell(): P = models.Polychora((5, 2, 2, 3, 2, 3), (1, 0, 0, 0)) P.build_geometry() P.export_pov() command = template.format("dimensions_120_cell.pov", "120-cell") call(command, shell=True)