## OpenCascade Primitives BRep - Box 原

eryar

eryar@163.com

Abstract. BRep is short for Boundary Representation. Boundary Representation gives a complete description of an object by associating topological and geometric information for solid modeling. In this case, objects are described by their boundaries. There are two types of information in BRep: Topological information and Geometric information. This paper is concerned with the Box BRep in OpenCascade, and also show how to use Tcl script to dump box BRep info.

Key words. OpenCascade, BRep, Boundary Representation, Box, Winged-Edge Structure

## 1. Introduction

l Vertex: a zero-dimensional shape corresponding to a point in geometry;

l Edge: a shape corresponding to a curve, and bound by a vertex at each extremity;

l Wire: a sequence of edges connected by their vertices;

l Face: part of a plane(in 2D geometry) or a surface(in 3D geometry) bounded by a closed wire;

l Shell: a collection of faces connected by some of the edges their wire boundaries;

l Solid: part of 3D space bound by a shell;

l Compound solid: a collection of solids.

Figure 1.1 Topological Entities in OpenCascade

Figure 1.2 Topological Shape Hierarchy of OpenCascade

Figure 1.3 Orientation of Faces

## 2. Dump Box BRep Info by Tcl

Figure 2.1 Dump Box BRep info in Draw Test Harness

``````#
#
#           File : box.tcl
#         Author : eryar@163.com
#           Date : 2014-03-17 19:00
#        Version : 1.0v
#
#    Description : Dump OpenCascade primitive box topology info to file.
#
#      Key Words : OpenCascade, BRep, Tcl, Box
#
#

# Make the box.
box theBox 1.0 2.0 3.0
set boxInfo [dump theBox]

# Save box BRep info to file.
if [catch {open d:/box.txt w+} theFile] {
puts "Cannot open d:/box.txt for writing: \$theFile"
} else {
puts \$theFile \$boxInfo
flush \$theFile
close \$theFile
}

puts "Dump Info Finished!"``````

Figure 2.2 Run a Tcl File in Draw Test Harness

Figure 2.3 Box BRep Info Generated by Tcl Script

## 3. Box BRep in OpenCascade

l 边的名称，即边的编号Edge Name；

l 边的起止顶点Start vertex and end vertex；

l 相连的两个面 Left face and right face；

l 遍历左面时访问边的顺序The predecessor and successor edges when traversing its left face；

l 遍历右面时访问边的顺序The predecessor and successor edges when traversing its right face；

Figure 3.1 Edge Table of Winged-Edge Structure

Figure 3.2 Complete Edge Table for Pyramid

TopExp::MapShapesAndAncestors()

Figure 3.3 Get Ancestor Shapes in OpenCascade

Figure 3.4 The Box generated by Tcl Script

Figure 3.5 Vertex of the Box BRep

Figure 3.6 Edges of the Box BRep

Figure 3.7 Wire #4 of Box BRep

Figure 3.8 Faces and Shells of Box BRep

Figure 3.9 Parametric Surfaces of the Box

Edge中包含了多种曲线数据，在Box的Edge中就包含两种曲线数据，一种是三维曲线；一种是曲面上的曲线。如下图所示：

Figure 3.10 Curve info of the Edge in Box

PCurve为#4号平面上的#23号参数曲线，由下图可知#4号曲面对应的Face为#7，对应的Wire为#8：

Figure 3.11 Surface of Face

## 5. References

1. OpenCascade, Test Harness User’s Guide 2013

2. OpenCascade, BRep Format Description White Paper, 2013

3. John K. Ousterhout, Tcl and Tk Toolkit, 1993

### eryar

OpenCASCADE Make Primitives-Box eryar@163.com Abstract. By making a simple box to demonstrate the BRep data structure of the OpenCASCADE. The construction method is different fr......

eryar
2014/11/23
242
0

oschina
2016/04/21
3K
2
Building OpenCascade on Windows with Visual Studio

eryar
2013/09/23
518
0

chenchenxixi
2012/07/09
1K
2

2016/10/10
2.3K
3

golang-字符串-地址分析

demo package mainimport "fmt"func main() {str := "map.baidu.com"fmt.Println(&str, str)str = str[0:5]fmt.Println(&str, str)str = "abc"fmt.Println(&s......

4
0
Spring Boot WebFlux 增删改查完整实战 demo

03：WebFlux Web CRUD 实践 前言 上一篇基于功能性端点去创建一个简单服务，实现了 Hello 。这一篇用 Spring Boot WebFlux 的注解控制层技术创建一个 CRUD WebFlux 应用，让开发更方便。这里...

9
0

FreeRTOS列表&列表项的源码解读 第一次看列表与列表项的时候，感觉很像是链表，虽然我自己的链表也不太会，但是就是感觉很像。 在FreeRTOS中，列表与列表项使用得非常多，是FreeRTOS的一个数...

9
0
Java反射

Java 反射 反射是框架设计的灵魂（使用的前提条件：必须先得到代表的字节码的 Class，Class 类 用于表示.class 文件（字节码）） 一、反射的概述 定义：JAVA 反射机制是在运行状态中，对于任...

zzz1122334

9
0

go4it

9
0