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();
相关推荐
WW_千谷山4_sch3 小时前
洛谷B3688:[语言月赛202212]旋转排列(新解法:deque双端队列)
数据结构·c++·算法
-To be number.wan3 小时前
Python数据分析:SciPy科学计算
python·学习·数据分析
漂流瓶jz4 小时前
UVA-11214 守卫棋盘 题解答案代码 算法竞赛入门经典第二版
c++·算法·dfs·aoapc·算法竞赛入门经典·迭代加深搜索·八皇后
fpcc5 小时前
并行编程实战——CUDA编程的Enhancing Memory Allocation
c++·cuda
白太岁5 小时前
通信:(3) 高并发网络通信:epoll + 边沿触发 + 非阻塞 IO + tcp
c语言·网络·c++·网络协议·tcp/ip
楼田莉子5 小时前
C++项目:日志&&线程池
linux·c++·学习·visual studio code
weixin_421585015 小时前
表示学习发展历程
学习
tankeven6 小时前
HJ93 数组分组
c++·算法
EmbedLinX6 小时前
嵌入式Linux之U-Boot
linux·服务器·笔记·学习
汉克老师7 小时前
GESP2024年3月认证C++二级( 第一部分选择题(9-15))
c++·循环结构·分支结构·gesp二级·gesp2级