Compare commits

..

No commits in common. "7ced0fb8bacc67692ed987ef51bf2b919c3bf7d2" and "9c4a219f9bdb3ac53a47e759dd702856b32b4abe" have entirely different histories.

View file

@ -1,7 +1,7 @@
#! /usr/bin/python3 #! /usr/bin/python3
from sys import argv, stdout, stderr from sys import argv, stdout, stderr
from math import pi as π, floor from math import pi as π
from math import atan, atan2 from math import atan, atan2
import numpy import numpy
from numpy import sqrt, sin, cos, tan, array, arange, empty, cross, newaxis from numpy import sqrt, sin, cos, tan, array, arange, empty, cross, newaxis
@ -270,23 +270,12 @@ def box(x=1.0, y=1.0, z=1.0):
plane(vector(y= y), vector(x=1), vector(z=1)), plane(vector(y= y), vector(x=1), vector(z=1)),
]) ])
def prism(n=6, a=1.0, z=1.0, φ=0.0, n1=0, n2=None): def prism(n=6, a=1.0, z=1.0, φ=0.0):
p = [ p = [
plane(vector(z=-z), vector(x=1), vector(y=1)), plane(vector(z=-z), vector(x=1), vector(y=1)),
plane(vector(z= z), vector(y=1), vector(x=1)), plane(vector(z= z), vector(y=1), vector(x=1)),
] ]
if n2 is None: φ = 2*π * arange(int(n))/n + φ
n2 = n
else:
c = cos(2*π/n * n1)
s = sin(2*π/n * n1)
p.append(plane(vector(), vector(c,s), vector(z=-1)))
c = cos(2*π/n * n2)
s = sin(2*π/n * n2)
p.append(plane(vector(), vector(c,s), vector(z= 1)))
φ += 2*π/n * arange(int(floor(n1+0.4999)),
int(floor(n2+1.5001)) )
p.extend([ p.extend([
plane( plane(
vector(a*c, a*s), vector(a*c, a*s),