pentaprism.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:freecad-pyoptools 作者: cihologramas 项目源码 文件源码
def execute(self,obj):
        import Part,FreeCAD
        l2=obj.S.Value/2.

        q=2*l2*tan(radians(22.5))
        v1 = FreeCAD.Base.Vector(l2,-l2,-l2)
        v2 = FreeCAD.Base.Vector(l2,-l2,l2)
        v3 = FreeCAD.Base.Vector(-l2,-l2,l2+q)
        v4 = FreeCAD.Base.Vector(-l2-q,-l2,l2)
        v5 = FreeCAD.Base.Vector(-l2,-l2,-l2)

        l1= Part.makePolygon([v1,v2,v3,v4,v5,v1])
        F = Part.Face(Part.Wire(l1.Edges))
        d = F.extrude(FreeCAD.Base.Vector(0,2*l2,0))

        obj.Shape = d
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号