标签:shape src info ges 形状 技术 div lin code
from FreeCAD import Base
# 点坐标
V1 = Base.Vector(0,10,0)
V2 = Base.Vector(30,10,0)
V3 = Base.Vector(30,-10,0)
V4 = Base.Vector(0,-10,0)
VC1 = Base.Vector(-10,0,0)
VC2 = Base.Vector(40,0,0)
# 创建圆弧
C1 = Part.Arc(V1,VC1,V4)
C2 = Part.Arc(V2,VC2,V3)
# 创建直线
L1 = Part.LineSegment(V1,V2)
L2 = Part.LineSegment(V3,V4)
# 合并几何元素,生成拓扑形状
S1 = Part.Shape([C1,L1,C2,L2])
# 得到拓扑形状的边
W = Part.Wire(S1.Edges)
# 创建面
face=Part.Face(W)
# 创建拉伸
P = face.extrude(Base.Vector(0,0,10))
# 显示拉伸
Part.show(P)
Caesar卢尚宇
2020年3月31日
FreeCAD二次开发-Part.Shape合并几何元素,生成拓扑形状
标签:shape src info ges 形状 技术 div lin code
原文地址:https://www.cnblogs.com/nxopen2018/p/12608030.html