def execute(self,obj):
import Part,FreeCAD
dist = obj.distribution.lower()
if dist not in ["polar","cartesian"]:
obj.distribution="polar"
print "Ray Distribution not understood, changing it to polar"
if dist == "polar":
r=5*tan(radians(obj.angle))
d=[]
for x in linspace(-obj.xSize/2,obj.xSize/2,obj.Nx):
for y in linspace(-obj.ySize/2,obj.ySize/2,obj.Ny):
d.append(Part.makeCone(0,r,5,FreeCAD.Vector(x,y,0)))
else: #Todo: Cambiar cono a piramide
r=5*tan(radians(obj.angle))
d = []
for x in linspace(-obj.xSize/2,obj.xSize/2,obj.Nx):
for y in linspace(-obj.ySize/2,obj.ySize/2,obj.Ny):
d.append(Part.makeCone(0,r,5,FreeCAD.Vector(x,y,0)))
obj.Shape = Part.makeCompound(d)
评论列表
文章目录