OpenCASCADE Performance Test
OpenCASCADE Performance Test
Abstract. Use the Draw Test Harness to test the performance of OpenCASCADE by Tcl scripts. From the test result, you will check whether the OpenCASCADE meet your need.
Key Words. OpenCASCADE, Performance Test, Draw Test Harness, Tcl/Tk
1. Introduction
OpenCASCADE开发平台提供了3D曲面和实体造型,CAD数据交换及可视化的功能。作为C++的开发库,OpenCASCADE最适于处理3D造型的CAD,制造、测量(CAM)及数值仿真(CAE)等软件的开发。
Draw Test Harness使用Tcl封装了OpenCASCADE的很多命令,通过编写Tcl脚本,可以方便地测试OpenCASCADE相应的功能。
本文主要介绍使用Tcl/Tk脚本在Draw Test Harness中测试OpenCASCADE的网格及可视化的性能。
![]()
Figure 1.1 Test 1000 Spheres
2.Mesh Test
实体形状显示需要被网格化,网格化速度的快慢直接影响显示的速度。所以先测试一下OpenCASCADE的网格剖分算法的速度。相应的Tcl脚本如下所示:
#
# Copyright (c) 2014 eryar All Rights Reserved.
#
# File : testocc.tcl
# Author : eryar@163.com
# Date : 2014-09-25 18:10
# Version : 1.0v
#
# Description : Test the OpenCASCADE performance.
# pload MODELING VISUALIZATION set shapeCount
set count
set distance #psphere s 3.0
#restore data/occ/CrankArm.brep s
#restore data/occ/Moto.brep s
restore data/occ/F1.brep s puts "\nMeshing the $shapeCount shapes..."
chrono aTimer start
for {set i } {$i < $shapeCount} {incr i } {
copy s s$i set dx [expr ($i%$count)*$distance]
set dy [expr ($i/$count)*$distance]
set dz 0.0 ttranslate s$i $dx $dy $dz # mesh the shape
incmesh s$i
}
chrono aTimer show
下面对上述代码进行简单分析:
v 用pload命令加载所需要的建模及可视化模块;
v 用restore命令加载一个brep文件到形状变量s;
v 用chrono打开一个计时器aTimer;
v 用ttranslate来阵列复制形状s得到的形状;
v 用incmesh来对形状进行网格化;
![]()
Figure 2.1 Mesh 100 F1
上述Tcl测试了网格化100辆F1赛车的时间如上图所示。可以修改上述Tcl脚本代码,来测试网格化10000个球所需要的时间。
3.Display Test
网格化之后可以显示出形状了。下面的Tcl脚本测试了OpenCASCADE的显示性能:
puts "\nDisplaying the $shapeCount shapes..."
chrono aTimer start
for {set i } {$i < $shapeCount} {incr i } {
vdisplay s$i
}
chrono aTimer show
chrono aTimer stop vsetdispmode
vfit puts "\nShow the frame rate..."
vfps
显示效果如下图所示:
![]()
Figure 3.1 Hundreds of F1
其中命令vfps是显示当前视图的帧频数的。100辆F1的帧数有26,速度还行,稍有卡滞。
4. Conclusion
根据上述Tcl脚本可以看出OpenCASCADE的网格及可视化的性能还可以。可以修改上述代码,来测试显示10000个球体所需要的时间。
最后给出上述Tcl测试用的模型数据及Tcl脚本完整代码供下载使用。
PDF Version and Tcl Script: OpenCASCADE Performance Test
OpenCASCADE Performance Test的更多相关文章
- Building OpenCASCADE on Debian
Building OpenCASCADE on Debian eryar@163.com Abstract. When you are familiar with OpenCASCADE on Win ...
- OpenCASCADE BRepTools
OpenCASCADE BRepTools eryar@163.com Abstract. OpenCASCADE BRepTools provides utilities for BRep data ...
- A Simple OpenCASCADE Qt Demo-occQt
A Simple OpenCASCADE Qt Demo-occQt eryar@163.com Abstract. OpenCASCADE have provided the Qt samples ...
- Bounding Volume Hierarchy BVH in OpenCASCADE
Bounding Volume Hierarchy BVH in OpenCASCADE eryar@163.com Abstract. Bounding Volume Hierarchy(BVH) ...
- Use PSO to find minimum in OpenCASCADE
Use PSO to find minimum in OpenCASCADE eryar@163.com Abstract. Starting from OCCT6.8.0 will include ...
- OpenCASCADE AIS Manipulator
OpenCASCADE AIS Manipulator eryar@163.com Abstract. OpenCASCADE7.1.0 introduces new built-in interac ...
- Convert BSpline Curve to Arc Spline in OpenCASCADE
Convert BSpline Curve to Arc Spline in OpenCASCADE eryar@163.com Abstract. The paper based on OpenCA ...
- OpenCASCADE Shape Location
OpenCASCADE Shape Location eryar@163.com Abstract. The TopLoc package of OpenCASCADE gives resources ...
- OpenCASCADE BRep Projection
OpenCASCADE BRep Projection eryar@163.com 一网友发邮件问我下图所示的效果如何在OpenCASCADE中实现,我的想法是先构造出螺旋线,再将螺旋线投影到面上. ...
随机推荐
- Struts相关
使用Struts2流程: 1.导入Struts2类包 2.在Web源代码文件夹中,创建名为struts.xml的配置文件.在其中定义Action对象,其关键代码如下: struts.xml: < ...
- ACM : POJ 2676 SudoKu DFS - 数独
SudoKu Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu POJ 2676 Descr ...
- 文本选择问题: css & js
CSS: /*Disable browser selection*/ .disableselect { -webkit-user-select: none; -moz-user-select: non ...
- 在Andoid开发中使用MVP模式来解耦,增加可测试性
by Jeff Angelini posted on 7/20/2011 2:35:00 PM 将应用程序UI的表现从Ui的逻辑中分离是一个好的想法.这种分离减少了代码耦合,代码更加干净, 甚至可以有 ...
- dd——留言板再加验证码功能
1.找到后台-核心-频道模型-自定义表单 2.然后点击增加新的自定义表单 diyid 这个,不管他,默认就好 自定义表单名称 这个的话,比如你要加个留言板还是投诉建议?写上去呗 数据表 这个不要碰, ...
- iOS开发查看手机app本地存储的文件
开发过程中,有时会在本地存储一些文件,但是我们不确定有没有存上,可以通过以下方法来查看测试手机上本地存储的文件: 1.选择xcode上面的window下面的Devices 2.先在左边选中你当前的设备 ...
- *HDU3398 数学
String Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Subm ...
- ZXing二维码生成在Unity3D中出错,数组超出界限的解决办法
错误截图: IndexOutOfRangeException: Array index is out of range.ZXing.Color32Renderer.Render (ZXing.Comm ...
- C/C++编译和链接过程详解 (重定向表,导出符号表,未解决符号表)
详解link 有 些人写C/C++(以下假定为C++)程序,对unresolved external link或者duplicated external simbol的错误信息不知所措(因为这样的错 ...
- WUI 前端组件
为什么会有WUI前端组件,我们接触的UI组件如:YUI.EXTjs.EasyUI,这些组件虽然提供了丰富的UI,并且一定程度上缩短了开始时间,单这些组件提供的页面风格是统一的,我们的产品风格不可能像这 ...