Open CASCADE学习|布尔运算后消除内部拓扑

在CAD建模中,布尔运算是一种逻辑运算方法,通过这种方法,可以创建、修改或组合几何对象。布尔运算主要包括并集(UNION)、交集(INTERSECT)和差集(SUBTRACT)三种运算。

**并集(UNION):**将两个或多个实体合并成一个整体。在CAD中,可以通过选择并集命令,然后依次选择要求并集的实体,完成并集操作后,这些实体将合并成一个整体。

**交集(INTERSECT):**取两个实体的公共部分保留为新对象,相交以外的部分删除。在CAD中,执行交集命令后,需要先选择第一个对象,然后选择第二个对象,系统会根据这两个对象生成一个新的实体,只包含它们的公共部分。

**差集(SUBTRACT):**从第一个选择的对象中减去第二个选择的对象。在CAD中,执行差集命令后,需要先选择被减对象,然后选择减去的对象,完成后,被减对象中减去减去对象的部分将被删除。

在OCCT中,布尔运算后,往往会出现缝合线。为了消除缝合线,我们需要用到工具类ShapeUpgrade_UnifySameDomain,该工具用于统一一个几何模型上的面和边。应该可以理解为,同一模型,同一面上的边,统一用边界的边来表示,其余的去掉。

This tool tries to unify faces and edges of the shape which lies on the same geometry. Faces/edges considering as 'same-domain' if a group of neighbouring faces/edges lying on coincident surfaces/curves. In this case these faces/edges can be unified into one face/edge. ShapeUpgrade_UnifySameDomain initialized by the shape and the next optional parameters: UnifyFaces - tries to unify all possible faces UnifyEdges - tries to unify all possible edges ConcatBSplines - if this flag set to true then all neighbouring edges which lays on the BSpline or Bezier curves with C1 continuity on their common vertices will be merged into one common edge The output result of tool is an unified shape All the modifications of initial shape are recorded during unifying. Method Generated() can be used to obtain the new (unified) shape from the old one.

复制代码
  TopoDS_Shape fuse = BRepAlgoAPI_Fuse(bigCube, smallCube);//先融合  ShapeUpgrade_UnifySameDomain unif(fuse , false, true, false);  unif.Build();  fuse = unif.Shape();
相关推荐
June`8 分钟前
warp shuffle指令
c++·人工智能·算法·cuda
choumin36 分钟前
C程序能调用extern “C“声明的带默认参数的C++函数吗?
c语言·c++·extern c·默认参数
ThsPool1 小时前
【ENVI二次开发学习整理 02】IDL语言基础与程序设计
学习·中间件
AmyLin_20011 小时前
PDF 色彩保真工程实践【3】上手实践:工程结构、依赖集成与一键构建运行
c++·visualstudio·pdf·zlib·vcpkg·libtiff·cmyk
并不喜欢吃鱼1 小时前
从零开始 C++------ 十六.深度拆解 C++ 智能指针:unique_ptr/shared_ptr/weak_ptr 底层模拟、内存泄漏根治
开发语言·c++
不相心 -w-1 小时前
Cmake的基础用法
linux·开发语言·c++
一只小菜鸡..1 小时前
南京大学 操作系统 (JYY) 学习笔记:文件系统实现——从 FAT、ext2 到现代 B-Tree 黑科技
笔记·科技·学习
深爱水瓶 血影S狂风1 小时前
Linux.NET学习手记(2)
linux·学习·.net
明明真系叻1 小时前
RAG学习(1)
学习·rag
撑伞的鱼99371 小时前
C++开发用什么AI编程工具效果好?2026年实测横评(附选型指南)
开发语言·c++·ai编程·cursor