示例#1
0
def render_star_polyhedra(coxeter_diagram,
                          trunc_type,
                          extra_relations=(),
                          render_file="star-polyhedra.pov",
                          output=None):
    coxeter_matrix = helpers.fill_matrix([x.numerator for x in coxeter_diagram])
    mirrors = helpers.get_mirrors(coxeter_diagram)
    P = models.Polyhedra(coxeter_matrix, mirrors, trunc_type, extra_relations)
    _render_model(P, render_file, output)
示例#2
0
def render_polyhedra(coxeter_diagram,
                     trunc_type,
                     render_file="polyhedra.pov",
                     output=None,
                     snub=False):
    """
    The main entrance for rendering 3d polyhedra.
    """
    coxeter_matrix = helpers.fill_matrix(coxeter_diagram)
    mirrors = helpers.get_mirrors(coxeter_diagram)
    if snub:
        P = models.Snub(coxeter_matrix, mirrors, trunc_type)
    else:
        P = models.Polyhedra(coxeter_matrix, mirrors, trunc_type)

    _render_model(P, render_file, output)
示例#3
0
def render_polyhedra(coxeter_diagram,
                     trunc_type,
                     render_file="polyhedra.pov",
                     description=None,
                     snub=False):
    if snub:
        P = models.Snub(coxeter_diagram, trunc_type)
    else:
        P = models.Polyhedra(coxeter_diagram, trunc_type)

    if not description:
        description = render_file[:-4]

    P.build_geometry()
    P.export_pov()
    command = TEMPLATE.format(render_file, description)
    subprocess.call(command, shell=True)
示例#4
0
def render_polyhedra(coxeter_diagram,
                     trunc_type,
                     render_file="polyhedra.pov",
                     description=None,
                     snub=False):
    """
    The main entrance for rendering 3d polyhedra.
    """
    if snub:
        P = models.Snub(coxeter_diagram, trunc_type)
    else:
        P = models.Polyhedra(coxeter_diagram, trunc_type)

    if not description:
        description = render_file[:-4]

    _render_model(P, render_file, description)
示例#5
0
def make_polyhedra(coxeter_diagram, trunc_type, output):
    P = models.Polyhedra(coxeter_diagram, trunc_type)
    P.build_geometry()
    P.export_pov()
    command = template.format("polyhedra.pov", output)
    call(command, shell=True)