Open Cascade中的布尔操作

简介: Open Cascade中的布尔操作 Modeling Algorithms Boolean Operations eryar@163.com 布尔操作(Boolean Operations)是通过两个形状(S1,S2)的组合来生成新的形状。

Open Cascade中的布尔操作

Modeling Algorithms Boolean Operations

eryar@163.com

布尔操作(Boolean Operations)是通过两个形状(S1S2)的组合来生成新的形状。布尔操作有如下几种类型:

u 并集操作FusionGets all the points in S1 or S2;

u 交集操作CommonGets all the points in S1 and S2;

u 差集操作Cut S1 by S2Gets all the points in S1 and not in S2;

下图所示为三种布尔操作:

Boolean Operations

1. BRepAlgoAPI_BooleanOperation

BRepAlgoAPI_BooleanOperation是布尔操作的基类。

2. BRepAlgoAPI_Fuse

BRepAlgoAPI_Fuse执行布尔并集操作。如下所示:

 
TopoDS_Shape theBox1 = BRepPrimAPI_MakeBox(50,200,70); 
TopoDS_Shape theBox2 = BRepPrimAPI_MakeBox(-30,150,70); 
TopoDS_Shape FusedShape = BRepAlgoAPI_Fuse(theBox1,theBox2); 
 

Fuse two boxes

3. BRepAlgoAPI_Common

BRepAlgoAPI_Common执行布尔交集操作,如下所示:

 
gp_Ax2 axe(gp_Pnt(10,10,10),gp_Dir(1,2,1)); 
TopoDS_Shape theBox = BRepPrimAPI_MakeBox(axe,60,80,100); 
TopoDS_Shape theWedge = BRepPrimAPI_MakeWedge(60.,100.,80.,20.); 
TopoDS_Shape theCommonSurface = BRepAlgoAPI_Common(theBox,theWedge); 
 

Compute the common surface

4. BRepAlgoAPI_Cut

BRepAlgoAPI_Cut执行布尔差集操作,如下所示:

 
TopoDS_Shape theBox = BRepPrimAPI_MakeBox(200,40,40); 
TopoDS_Shape theSphere = BRepPrimAPI_MakeSphere(gp_Pnt(100,20,20),80); 
TopoDS_Shape ShapeCut = BRepAlgoAPI_Cut(theSphere,theBox); 
 

5. BRepAlgoAPI_Section

 

Open Cascade中的布尔操作 Modeling Algorithms-Boolean Operations

目录
相关文章
|
7月前
|
SQL 数据处理 数据库
DELETE 和 TRUNCATE 语句之间的详细区别
【8月更文挑战第31天】
915 0
|
数据库 索引 Python
SQLAlchemy列参数的使用和query函数的使用
SQLAlchemy列参数的使用和query函数的使用
|
SQL 数据库 数据库管理
sql数据定义语句(cascade,set,null,no action的区别)
sql数据定义语句(cascade,set,null,no action的区别)
301 0
|
XML API 数据格式
Schema 约束 API 查看(一)| 学习笔记
快速学习 Schema 约束 API 查看。
OPEN CASCADE编译视频
为了帮助OPEN CASCADE新手顺利编译OPEN CASCADE源码,特录制了一个视频, 有了这个视频,OPEN CASCADE的编译再也不麻烦啦!
1170 0
|
算法 C++
Function Set in OPEN CASCADE
Function Set in OPEN CASCADE eryar@163.com Abstract. The common math algorithms library provides a C++ implementation of the most frequently used mathematical algorithms.
1089 0