OCCT-Tutorials_and_Demos_01:Novice_Guide
Tutorials and Demos 01
原文链接: https://dev.opencascade.org/doc/overview/html/samples__novice_guide.html
Novice Guide 新手向导
Modeling with OCCT: Key differences OCCT建模:关键区别
Open CASCADE Technology (OCCT) is an object-oriented C++ framework designed for rapid production of sophisticated CAD/CAM/CAE applications. In other words, it provides endless possibilities for raw 2D and 3D modeling in C++ environment. Unlike end-user software, it is used by the application developers and therefore strongly differs from the most popular CAD/CAM/CAE software packages. OCCT provides building blocks enough for modeling, editing, visualization, and data interoperability of 2D and 3D objects.
Open CASCADE Technology(OCCT)是一个面向对象的C框架,用于快速生成复杂的CAD/CAM/CAE应用程序。换句话说,它为C环境中的原始2D和3D建模提供了无尽的可能性。与最终用户软件不同,它由应用程序开发人员使用,因此与最流行的CAD/CAM/CAE软件包有很大不同。OCCT为2D和3D对象的建模、编辑、可视化和数据互操作性提供了足够的构建块。
By using OCCT, users can create the objects of their desire (or edit already existing ones) using raw code commands. It is a more complicated process than using GUI-based software, but it provides much more flexibility than even script-based manipulations that are available within existing CAD/CAM/CAE applications. However, to fully grasp the possibilities of OCCT it is best for the user to have previous experience in C++ at least at a basic level.
通过使用OCCT,用户可以使用原始代码命令创建他们想要的对象(或编辑已经存在的对象)。这是一个比使用基于GUI的软件更复杂的过程,但它提供了比现有CAD/CAM/CAE应用程序中可用的基于脚本的操作更大的灵活性。然而,为了充分掌握OCCT的可能性,用户最好至少在基本水平上有C++的经验。
Understanding the principles 理解原则
If you don’t have any programming skills, grasping the full magnitude of OCCT workflow is still an option. The documentation for OCCT contains several entry points for new users. It will not explain all OCCT classes but will help to comprehend the workflow and help start thinking in terms of Open CASCADE Technology.
如果你没有任何编程技能,掌握OCCT工作流程的全部规模仍然是一个选择。OCCT的文档包含新用户的几个入口点。它不会解释所有OCCT类,但有助于理解工作流,并有助于开始思考开放式CASCADE技术。
The most basic workflow is described in the OCCT Tutorial - this is an excellent starting point for new users. In this tutorial you will create a solid model step-by-step using different classes and methods. Each step of the tutorial contains code snippets and images.
OCCT教程中描述了最基本的工作流程——这是新用户的绝佳起点。在本教程中,您将使用不同的类和方法逐步创建实体模型。教程的每个步骤都包含代码片段和图像。
The basics involved in the modeling process are explained. When the basics of OCCT are clear, the next logical step is to check out sample applications and examine those that suit your needs. For these, the best starting point is OCCTOverview located in /samples/qt subfolder of OCCT installation.
解释了建模过程中涉及的基础知识。当OCCT的基础知识清楚后,下一个逻辑步骤是检查示例应用程序并检查那些适合您需要的应用程序。对于这些,最好的起点是OCCT安装的/samples/qt子文件夹中的OCCTOverview。
This sample provides code examples for several actions as well as visualization of these code snippets output. The Overview interface is dynamically changing based on selected Category at the menu. Additional menu buttons will appear, providing users with subcategories and relevant commands to select one of the actions. The result will appear in the viewer window, the code will appear at the top right, and in several cases the output will be produced at the bottom right window.
此示例提供了几个操作的代码示例以及这些代码片段输出的可视化。“概述”界面根据菜单中选择的“类别”进行动态更改。将出现其他菜单按钮,为用户提供子类别和相关命令以选择其中一个操作。结果将显示在查看器窗口中,代码将显示在右上角,在某些情况下,输出将在右下角窗口生成。
The 3D viewer window has a row of preset interface buttons to customize the visual output.
3D查看器窗口有一行预设界面按钮,用于自定义视觉输出。
Those buttons can be grouped into three types, left to right:
这些按钮可以从左到右分为三种类型:
-
View controls: Fit all and Isometric, will center the view and reset the camera angles respectively;
-
Display mode customization: HLR, e.g. “Hidden line removal” (works only when shading is disabled) can be turned on and off; solid models may be displayed either in Shading or Wireframe modes. Transparency level may be set for models in shading mode;
-
The last four buttons in a row are beautifiers enabling Ray-tracing engine and configuring it’s parameters.
-
视图控件:Fit all和Isometric,将视图居中并分别重置相机角度;
-
显示模式自定义:可以打开和关闭HLR,例如“隐藏线删除”(仅在禁用着色时有效);实体模型可以以着色或线框模式显示。可以为处于着色模式的模型设置透明度级别;
-
一行中的最后四个按钮是启用光线跟踪引擎并配置其参数的美化器。
At the bottom left of the screen the orientation cube (trihedron) is located. The trihedron interactively shows the position of the camera in relation to the XYZ axis of the displayed data. The sides of the trihedron are labeled to help with orientation. Click on a side of the box to orient the camera view along the preferred axis.
方向立方体(三面体)位于屏幕的左下方。三面体以交互方式显示相机相对于显示数据的XYZ轴的位置。三面体的边被标记以帮助定向。单击框的一侧以沿首选轴调整相机视图的方向。
The 2D viewer window lacks most of these elements and only have Fit all button.
2D查看器窗口缺少大多数这些元素,只有“全部拟合”按钮。
The Geometry category of the Overview focuses on primitive objects like dots, lines (including vectors) or planes. These objects will appear in the viewer after the subcategory is selected. This section will demonstrate these entities both in 2D and 3D view mode and provide basic examples of parametric creation and data analysis.
“概述”的“几何体”类别侧重于基本体对象,如点、线(包括矢量)或平面。选择子类别后,这些对象将显示在查看器中。本节将在二维和三维视图模式下演示这些实体,并提供参数化创建和数据分析的基本示例。
The usage of the functions shown in the Overview is described more thoroughly at the Modeling data section of the documentation. Additionally, Modeling Algorithms are used in more complex cases.
概述中所示功能的使用在文档的建模数据部分进行了更详细的描述。此外,建模算法用于更复杂的情况。
The Topology section of the Overview demonstrates the functions used in 3D operations. Multiple use cases are provided, including different object intersections, modifying and calculations. Some of these use cases are described in the documentation, such as Inspector usage.
概述的拓扑部分演示了3D操作中使用的功能。提供了多种用例,包括不同的对象相交、修改和计算。文档中描述了其中一些用例,例如Inspector用法。
The subsections are grouped as shown on the screenshot before. Most shapes and primitive objects are introduced and then followed by a set of operations and interactions.
子部分按前面屏幕截图所示进行分组。大多数形状和基本对象都被引入,然后是一组操作和交互。
The Triangulation segment allows computing the number of triangles on a shape.
三角形分段允许计算形状上的三角形数。
This may be inspected via Poly_Triangulation Class Reference - a part of the Reference manual, an overall Open CASCADE code guide that may be used to inspect the key points in classes and their connections.
这可以通过Poly_Triangulation Class Reference进行检查,这是参考手册的一部分,是一个完整的开放式CASCADE代码指南,可用于检查类中的关键点及其连接。
The triangulation uses some of Mesh-related classes - see full description at Mesh documentation section.
三角测量使用一些与网格相关的类-请参见网格文档部分的完整描述。
The Data exchange section provides examples of how to export and import files of several different formats.
数据交换部分提供了如何导出和导入几种不同格式的文件的示例。
The OCAF section gives an introduction for the Open CASCADE Application Framework functionality. To test these functions, create an object first (box or cylinder). After that, the object may be modified and saved. Actions are recorded and may be undone or redone.
OCAF部分介绍了开放式CASCADE应用程序框架功能。要测试这些功能,请先创建一个对象(长方体或圆柱体)。之后,可以修改和保存对象。操作已记录,可以撤消或重做。
Viewers section demonstrates examples of the 2D and 3D visualization outputs. Check Visualization section of the documentation for a detailed description. In addition to these two samples, there are much more that might be of use to a new user based on their particular use case.
查看器部分演示了2D和3D可视化输出的示例。有关详细说明,请查看文档的可视化部分。除了这两个示例之外,根据新用户的特定用例,还有更多的示例可能对他们有用。
Check Readme files in the sample directories to learn more about samples compilation.
查看示例目录中的自述文件以了解有关示例编译的更多信息。
Note: source code for OCCTOverview is stored at ‘samples/qt/OCCTOverview/src’ folder in your OCCT root, and the source code files for examples presented in subsections are stored at ‘samples/OCCTOverview/code folder’. Several utility classes that are not presented in the example window may be found in example source code files.
注意:OCCTOverview的源代码存储在OCCT根目录中的“samples/qt/OCTOverview/src”文件夹中,子节中所示示例的源代码文件存储在“samples/OCCTOverview/code文件夹”中。示例窗口中未显示的几个实用程序类可以在示例源代码文件中找到。
The overall classes introduction may be found in the Foundation Classes section of the documentation. The “Introduction” section contains short descriptions of the most massive entries in the documentation.
总体类介绍可以在文档的基础类部分找到。“简介”部分包含文档中最大量条目的简短描述。
Additional assistance 其他协助
There are several places that may be of use for new users. The first one is Training & E-learning page that lists available trainings and describes their specifics.
有几个地方可能对新用户有用。第一个是培训和电子学习页面,其中列出了可用的培训并描述了其具体内容。
The second one is the Overview documentation (this document is a part of it) - here you can find information that suits most of the use cases. This may seem overwhelming at first, but if you have the clear understanding of what do you seek, you will most likely find the required information.
第二个是概述文档(该文档是其中的一部分)-在这里您可以找到适合大多数用例的信息。起初,这可能会让人不知所措,但如果你清楚地了解自己想要什么,你很可能会找到所需的信息。
Aside from the Overview documentation itself, the Reference manual is present. Use it to check classes descriptions, dependencies and examples. Additionally, there is a Forum where you can contact the OCCT community and developers.
除了概述文档本身,还提供了参考手册。使用它检查类描述、依赖关系和示例。此外,还有一个论坛,您可以在这里联系OCCT社区和开发人员。