mpacts.geometrygenerators. subdivide

In order to be able to use this module import it like this:

import mpacts.geometrygenerators.subdivide
#or assign it to a shorter name
import mpacts.geometrygenerators.subdivide as sub
mpacts.geometrygenerators.subdivide.find_edge(edge, edges)

returns index of edge in list of edges, or -1 if not found. Edges must be sorted!

mpacts.geometrygenerators.subdivide.subdiv_vertices_edges(ico)

Calculates vertices and edges when subdividing a triangular meshed polyhedron (ico). Edges are lexicographically sorted. The polyhedron is immediately changed!

mpacts.geometrygenerators.subdivide.subdivide(ico)

Subdivides a regular polyhedron - icosahedron or icosphere - to the next level of refinement. The polyhedron is immediately changed! Parameters:

ico is expected to have lists of ‘vertices’ and ‘edges’
mpacts.geometrygenerators.subdivide.triangles_from_edges(ico)

Constructs faces (triangles) from a lexicographically sorted list of edges. The polyhedron is immediately changed!