Ejemplo n.º 1
0
def test_rotation_form():
    profile = [(0, 0.1), (1, 1), (3, 1.5), (5, 3)]  # in xy-plane
    mesh = rotation_form(count=16, profile=profile,
                         axis=(1, 0, 0))  # rotation axis is the x-axis
    assert len(mesh.vertices) == 16 * 4
    assert len(mesh.faces) == 16 * 3
Ejemplo n.º 2
0
def build_rotation_form(filename, alpha=2 * math.pi, sides=16):
    profile = forms.spline_interpolation([(0, 0.1), (1, 1), (3, 1.5), (5, 3)],
                                         subdivide=8)  # in xy-plane
    mesh = forms.rotation_form(sides, profile, angle=alpha, axis=(1, 0, 0))
    write_mesh(filename, mesh)