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();
相关推荐
sunshine22 girl26 分钟前
Java学习二 基本语法2, 算术运算符
java·学习
anew___42 分钟前
蜂鸣器播放音乐——让 Arduino 唱出旋律
c++·stm32·单片机·嵌入式硬件·c
stolentime2 小时前
洛谷P10515 转圈题解
c++·算法·数学建模·贪心算法
tdtsmt3 小时前
穿戴硬件量产工艺实录:天地通电子智能手表主板 SMT 贴片案
c++
衡石科技3 小时前
Data_Agent记忆机制与经验复用衡石分析智能体会话记忆与长期学习技术解析
人工智能·科技·学习·算法·企业级bi
传奇开心果编程4 小时前
【Xilem基础语法学与练】第7课:Xilem与Masonry底层构建技术解析
学习·rust·前端框架
想要入门的程序猿4 小时前
回调函数学习
java·网络·学习
码上上班5 小时前
iptables学习; firewalld学习;ufw学习
学习
RisunJan5 小时前
丝连族谱 0452 — 功能拆解与使用手册
学习
老王爱玩车5 小时前
深入理解指针2
c语言·开发语言·学习