网络营销网站 优帮云,代理记账包含哪些业务,余杭门户网站,网站建设需Open CASCADE#xff08;简称OCC#xff09;平台是是一个开源的C类库#xff0c;OCC主要用于开发二维和三维几何建模应用程序#xff0c;包括通用的或专业的计算机辅助设计CAD系统、制造或分析领域的应用程序、仿真应用程序或图形演示工具。 PythonOCC是对Open CASCADE的封…Open CASCADE简称OCC平台是是一个开源的C类库OCC主要用于开发二维和三维几何建模应用程序包括通用的或专业的计算机辅助设计CAD系统、制造或分析领域的应用程序、仿真应用程序或图形演示工具。 PythonOCC是对Open CASCADE的封装。PythonOCC按照官方描述3D CAD/CAE/PLM DEVELOPMENT FRAMEWORK FOR THE PYTHON PROGRAMMING LANGUAGE. 即用于开发CAD/CAE/CAM程序的一个Python框架。PythonOCC的下载地址为http://www.pythonocc.org/download/ 学习一个框架先从最简单的Hello world程序开始下面用PythonOCC创建一个最简单的立方体并显示出来。 1 2 This examples creates and displays a simple box.3 4 5 # The first line loads the init_display function, necessary to6 # enable the builtin simple gui provided with pythonocc7 from OCC.Display.SimpleGui import init_display8 9 # Then we import the class that instanciates a box
10 # Here the BRepPrimAPI module means Boundary Representation Primitive API.
11 # It provides an API for creation of basic geometries like spheres,cones etc
12 from OCC.BRepPrimAPI import BRepPrimAPI_MakeBox
13
14 # Following line initializes the display
15 # By default, the init_display function looks for a Qt based Gui (PyQt, PySide)
16 display, start_display, add_menu, add_function_to_menu init_display()
17
18 # The BRepPrimAPI_MakeBox class is initialized with the 3 parameters of the box: widht, height, depth
19 my_box BRepPrimAPI_MakeBox(10., 20., 30.).Shape()
20
21 # Then the box shape is sent to the renderer
22 display.DisplayShape(my_box, updateTrue)
23
24 # At last, we enter the gui mainloop
25 start_display() 显示结果如下按键盘上的WSH键可以在线框模型面模型和消隐线模型之间切换。按住左键移动鼠标可以旋转物体鼠标中键用于缩放按住鼠标中键可以平移物体 参考 http://www.pythonocc.org/ http://www.vrplumber.com/py3d.py https://github.com/tpaviot/pythonocc-core/blob/5b7ac9167e50e302cea534c5c7777ca2432f6d09/doc/examples/helloworld.rst转载于:https://www.cnblogs.com/21207-iHome/p/5241151.html