OpenCASCADE Performance Test

eryar@163.com

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的更多相关文章

  1. Building OpenCASCADE on Debian

    Building OpenCASCADE on Debian eryar@163.com Abstract. When you are familiar with OpenCASCADE on Win ...

  2. OpenCASCADE BRepTools

    OpenCASCADE BRepTools eryar@163.com Abstract. OpenCASCADE BRepTools provides utilities for BRep data ...

  3. A Simple OpenCASCADE Qt Demo-occQt

    A Simple OpenCASCADE Qt Demo-occQt eryar@163.com Abstract. OpenCASCADE have provided the Qt samples ...

  4. Bounding Volume Hierarchy BVH in OpenCASCADE

    Bounding Volume Hierarchy BVH in OpenCASCADE eryar@163.com Abstract. Bounding Volume Hierarchy(BVH) ...

  5. 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 ...

  6. OpenCASCADE AIS Manipulator

    OpenCASCADE AIS Manipulator eryar@163.com Abstract. OpenCASCADE7.1.0 introduces new built-in interac ...

  7. 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 ...

  8. OpenCASCADE Shape Location

    OpenCASCADE Shape Location eryar@163.com Abstract. The TopLoc package of OpenCASCADE gives resources ...

  9. OpenCASCADE BRep Projection

    OpenCASCADE BRep Projection eryar@163.com 一网友发邮件问我下图所示的效果如何在OpenCASCADE中实现,我的想法是先构造出螺旋线,再将螺旋线投影到面上. ...

随机推荐

  1. Hololens 硬件细节 Hardware Detail

    微软HoloLens是世界第一款完全无线缆的全息计算机.通过在新方式上赋予用户的全息体验,HoloLens重新定义了个人计算(Personal Computing).为了将3D全息图形固定到你周围的真 ...

  2. PHPer不能不看的50个细节!

    1.用单引号代替双引号来包含字符串,这样做会更快一些.因为PHP会在双引号包围的字符串中搜寻变量, 单引号则不会,注意:只有echo能这么做,它是一种可以把多个字符串当作参数的"函数&quo ...

  3. Leetcode Maximum Product Subarray

    Find the contiguous subarray within an array (containing at least one number) which has the largest ...

  4. jsp使用EL表达式回传boolean值出错的问题

    在最近做的一个项目中使用session回传的属性中有一个为boolean,报出错. 属性名字为"isAdmit",布尔类型.后来我上网查了一下,是因为我使用了Myeclipse的自 ...

  5. 利用wikipedia 的API实现对其内容的查询

    wikipedia提供了api可以供我们对其内容进行操作.其API文档地址为: http://en.wikipedia.org/w/api.php 列举一些常见用法: 1.全文搜索 http://en ...

  6. JS写入日志

    try { var WSShell = WScript.CreateObject("WScript.Shell"); var FileSys = WScript.CreateObj ...

  7. JS 将数字转化成为货币格式

    最近由于项目的需要需要将数字format成货币格式,自己搞了半天效果不是很好,博客园有篇问题很好,再次转载记录一下 http://www.cnblogs.com/mingmingruyuedlut/a ...

  8. Python之路【第七篇】python基础 之socket网络编程

    本篇文章大部分借鉴 http://www.cnblogs.com/nulige/p/6235531.html python socket  网络编程 一.服务端和客户端 BS架构 (腾讯通软件:ser ...

  9. nodejs学习之加密

    Nodejs中的加密是Crypto模块, 1.md5的使用 var crypto = require("crypto"); //创建 var md5 = crypto.create ...

  10. Page

    <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head> <met ...