FreeCAD二次开发-Part.LineSegment创建直线

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日

原文地址:https://www.cnblogs.com/nxopen2018/p/12608021.html

时间: 2024-10-30 13:36:28

FreeCAD二次开发-Part.LineSegment创建直线的相关文章

FreeCAD二次开发-Part.Face创建面

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) # 创建直

FreeCAD二次开发-face.extrude创建拉伸

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) # 创建直

FreeCAD二次开发-Part.Arc创建圆弧

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) # 创建直

FreeCAD二次开发-Part.makeCylinder创建圆柱

FreeCAD作为一款基于OpenCasCAD内核的开源CAD软件,可以在GitHub上下载源代码.阅读源代码,有助于我们学习CAD软件架构,了解底层几何算法. 由博主Caesar卢尚宇自学整理(纯粹出于对三维CAD软件开发的热爱) # 指定半径和高度b=Part.makeCylinder(20,50)# 显示对象 Part.show(b) 原文地址:https://www.cnblogs.com/nxopen2018/p/12555421.html

FreeCAD二次开发-Part.Shape合并几何元素,生成拓扑形状

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) # 创建直

FreeCAD二次开发-PySide例子QtGui.QInputDialog弹出输入框

FreeCAD作为一款基于OpenCasCAD内核的开源CAD软件,可以在GitHub上下载源代码.阅读源代码,有助于我们学习CAD软件架构,了解底层几何算法. 由博主Caesar卢尚宇自学整理(纯粹出于对三维CAD软件开发的热爱) 内容出自FreeCAD官方社区https://wiki.freecadweb.org/PySide_Beginner_Examples from PySide import QtGui, QtCore reply = QtGui.QInputDialog.getTe

NX二次开发-算法篇-创建最大边界包容盒

1 NX9+VS2012 2 3 #include <uf.h> 4 #include <uf_obj.h> 5 #include <uf_modl.h> 6 #include <uf_part.h> 7 8 UF_initialize(); 9 10 //遍历当前显示部件所有体 11 std::vector<tag_t> SolidVector; 12 tag_t ObjectTag = NULL_TAG; 13 int Type, SubTy

NX二次开发-UFUN建模创建特征组UF_MODL_create_set_of_feature

1 NX11+VS2013 2 3 #include <uf.h> 4 #include <uf_modl.h> 5 6 UF_initialize(); 7 8 //创建块 9 UF_FEATURE_SIGN Sign = UF_NULLSIGN;//设置布尔 10 double Corner_pt[3] = { 0.0, 0.0, 0.0 };//设置原点 11 char *Edge_Len[3] = { "100", "100", &q

FreeCAD二次开发-Gui.Selection.getSelectionEx() 遍历选中的对象

import Part Part.show(Part.makeBox(100,100,100)) Gui.SendMsgToActiveView("ViewFit") length = 0.0 for o in Gui.Selection.getSelectionEx(): for s in o.SubObjects: length += s.Length print "Length of the selected edges:" ,length Caesar卢尚宇