Case Study: Porting a set of point cloud and triangle mesh processing C++ libraries to 64-bit platform
Case Study: Porting a set of point cloudand triangle mesh processing C++libraries to 64-bit platformAuthor: Evgeniy RyzhkovDate: 15.01.2009AbstractItalian company E.G.S. S.r.l. deals with development of solutions in the field of simulation of trianglemesh-based 3D objects.IntroductionItalian company E.G.S. S.r.l. deals with development of solutions in the field of simulation of trianglemesh-based 3D objects.For this purpose it uses its own component library Leios Components. When company E.G.S. S.r.lwanted to issue a 64-bit version of its components it turned to OOO "Program Verification Systems" as itis a company specializing in the field of development of code analyzers for 64-bit applications andparallel ones.
Leios Components libraryLeios Components library is a set of different libraries: 1. Leios Point Cloud and Triangular Mesh API, LMLib. 2. Leios Surface Fitting Library. 3. Leios Sharp Edges Library.The total volume of source code is 13 Mb (440 000 code lines), the solution consists of several dozensprojects. Its obvious that manual porting of such amount to a 64-bit system is rather difficult, especiallyif you take into account the complexity of mathematical algorithms.In order to learn the code type which the library contains one should just check main capacities of threementioned above components.Leios Point Cloud and Triangular Mesh API • Point cloud and triangle mesh import/export (ASCII, STL, PLY, OBJ, VRML formats and native Leios RVE format. • Mesh data acquisition. • Elementary mesh editing operations. • Point cloud and triangle mesh selection operations. • Point cloud filtering, noise cleaning, smoothing, offset.
• Point cloud triangulation.• Triangle mesh healing, hole filling, smoothing.• Triangle mesh decimation and refinement.
• Cross sections of a triangle mesh by a plane, mesh subdivision by a plane.• Fitting mesh parts to plane, cylinder, or sphere surfaces.• Merging several point clouds or triangle meshes into a single object.• Point cloud and triangle mesh OpenGL visualization.• Registration of triangle meshes or point clouds.• Constrained "2.5d" triangulation procedures.• Point Cloud triangulation within given external contour.• "out-of-core" implementation to edit big point clouds in 32bit environment.• Triangulation between two polylines.• Procedure yielding mesh self-intersections.
• Procedure yielding intersection polylines of two meshes. • Polyline smoothing and decimation procedures. • Procedure yielding mesh cross section through two points on the mesh. • Import-Export routines with double-precision center-of-mass coordinates. • Automatic scan merging procedure.Leios Surface Fitting LibraryExtension library for managing the untrimmed NURBS surfaces fitting using • Specification of the sets of 4 bound limits on the triangle meshes. • Automatic surfaces fitting with automatic distribution of the nurbs patches.
Leios Sharp Edges LibraryExtension library for • Automatic extraction of the fillets curves (bounds curves, central curve on the mesh, theoretical sharp edge curves) on the triangle meshes models • Segmentation of the triangles meshes into areas without fillets that can be fitted with untrimmed NURBS surfaces.
The necessity of library components migration to a 64-bit platformE.G.S. S.r.l. company has been concerned with solutions development since 2002 when its first officewas opened in Italy. Since the first steps of its work the developments has been directed to high-performance desktop systems.Minimal PC with which a E.G.S. S.r.l. solution is able to work possesses the following configuration(according to the data acquired in the beginning of 2008): • Processor: Intel Core Duo T2300 or higher, AMD X2 3800+ or higher. • Memory: 2GB • Graphic Card: Nvidia Quadro / 6x series or higher, ATI/AMD "x" series / FireGL or higher. • Operating System: Windows XP Professional SP2 or higher, Windows VistaAs the volume of data being processed has been growing, 32-bit version RAM limitations (not exceeding3 Gb) certainly turned out to be insufficient for serious projects. Thats why the necessity to release a64-bit version seemed to be unquestionable for the E.G.S. S.r.l. administration. However, the chance toproduce such a version in a short time remained doubtful. It was next to impossible to verify suchamount of code manually.Participation of OOO "Program Verification Systems" in componentlibrary migrationSpecialists of OOO "Program Verification Systems" came to rescue. They used Viva64 code analyzer forcode migration to a 64-bit platform.Software product Viva64 provides with error diagnostics. It deals with errors specific for 64-bit Windowsapplications. Viva64 is a lint-like static C/C++ code analyzer. Fields of Viva64 application are thefollowing: verification of new 64-bit program solutions, assistance with porting of a 32-bit code to a 64-bit system, code optimization taking into account peculiarities of 64-bit architectures.
Using Viva64 specialists of OOO "Program Verification Systems" furnished rapid migration of librarycomponents, discovered and corrected problem parts in the librarys source code. So, only severalpersons took part in migration of such a huge and complex library.Code migration using Viva64 allowed to have saved much time which might have been spent for manualcode verification. The main thing is not to make new program errors which tend to appear when amigration to a new platform takes place.The basic problem points discovered while analyzing code: • calculation algorithms peculiarities manifesting when large amounts of data are being processed; • processing of large-sized files; • processing of highly-triangulated 3-D models (the larger is the number of triangles, the more precise is the model) • functioning of licensing subsystem;All the problems discovered with the help of Viva64 analyzer were corrected, due to this the 64-bitversion of high-quality Leios Studio was released in time.E.G.S. S.r.l. is a private company whose mission is to develop programs and solutions for advanced 3Dscanning products processing. The companys offices were opened in Italy and in Moscow in 2002.Website: http://www.egsolutions.com.