Sunteți pe pagina 1din 7

18 International Conference on Production Research

th

A new database approach to improve STL files correction algorithms


P.Jamshidi, M.Haddad and S.Mansour Department of Industrial Engineering Amirkabir University of Technology (Tehran Polytechnic), Tehran, Iran

Abstract: A STL file format contains a series of triangles representing the surface model of the part that are being made by Free Form Fabrication technologies. However, recently this file format is being used to interrogate and transfer data between different CAD/ CAM /CAE systems. There are many inherent defects associated with STL files, such as gaps, incorrect normal vectors, overlapping facet, non-manifold facets that requires correction. Numbers of algorithms have been developed for these purposes. In this paper an attempt is made to store the STL file data in a SQL based RDBMS. By using RDBMS features such as indexing, coding and other capabilities and services it would be possible to speeds up data retrieval and manipulation that in turn will result in a more efficient algorithm compare with those that already established for correcting STL file shortcomings. It is also possible to develop a Client/Server architecture that could lead to suitable environment for Concurrent Engineering. Keyword: STL file, STL correction, rapid prototyping, RDBMS 1. INTRODUCTION Rapid Prototyping (RP) technologies such as Stereolithography (SLA), Selective Laser Sintering (SLS), Laminating Object Manufacturing (LOM), Three Dimension Printing (3D printing), etc have been developed since mid 1980s [1]. It is a technology that directly generates physical objects from CAD databases. They have a common important feature: the prototype is produced by adding materials rather then removing materials. This simplifies the 3D object producing process to a 2D layer adding processes such that an object can be produced directly from its computer model [2]. An object is first designed by a CAD system like solid modeler, and then the solid model built-in tessellation algorithm creates a simple boundary representation that covers the surface of the solid with triangles. This structure is named .STL file format. Each triangle is described by an outward normal vector and the coordinates of three vertices. Such triangular meshes stored in STL format are used as definitions of geometry of real solids for several industrial applications, and also for RP and manufacturing. A mesh is then sliced into a series of parallel layers. The layers can be manufactured by different techniques [3]. After slicing solid model to layers, RP machines start to build the part. Because of the nature of Some RP methods, these methods need support structure such as SLA. Some STL files have errors in triangle tessellation such as facet missing, incorrect normal vector, gaps, non manifold and other errors will be described in the latter sections. In this paper initially STL file format and errors associated with this type of file will be described then a brief introduction to DBMS will be provided and finally the adopted approach will be described with some results. 2. PREVIOUS WORK Numbers of algorithms have been developed for STL correction; most important works in this domain are listed here: Rock and Wozny[4] introduced the preliminary steps in correcting .STL files. The principle is that of inferring topology information from a Bucket of Facets (e.g. the unordered list of triangles) which is achieved using efficient detection techniques and intuitive data structures. Bhn and Wozny[5] presented a simplistic, efficient approach to the correction of errors within a faulty .STL file. An intuitive algorithm to correct triangle orientation is presented, which is based on an indexed representation of the facets. Mkel and Dolenc[6] described a set of procedures for correcting errors in .STL files, based on an adaptive space subdivision data structure. Several methods to automatically correct errors are presented: triangles are oriented using graph theory and small gaps are filled. More recently, Martin [7] proposed a public domain implementation of a correction suite for .STL files, ADMESH. The system performs surprisingly well on simple problems (misoriented normals and disjoined edges), but the patching of a hole is a more problematic task that works only in some cases. Fadel and Morvan [8] developed IVECS, The Interactive Virtual Environment for Correction of .STL files. The primary goal for IVECS was to allow users to virtually have their hands on .STL models by proposing the visualization and the correction of .STL files. IVECS detects errors and points them out to the user, who may choose to correct them. IVECS ability to automatically solve errors is limited to normal orientation problems and roundoff errors. L.-C. Zhang, M. Han and S.-H. Huang [9] develop a new approach for correcting STL file. In this paper, a new solution is presented which does not try to repair complex cracks and non-manifold facets, instead, it slices the bad STL model directly and repairs the slicing contour at a 2D level to obtain the correct result and manufacture the right product. In the domain of STL file correction two things must be considered: first the Algorithms second the Data structure that applying algorithms. It must be mentioned that all of the

18 International Conference on Production Research

th

above approaches uses the flat file data structure and have contribution on data structure that deploy on flat file like linked lists and indexed file. But this paper describes a new approach based on data base structure. 3 STL FILE FORMAT The industry standard for RP is the .STL file, a file extension that stands for stereolithography. Basically, it is a file that uses a mesh of triangles to form the shell of a solid object, where each triangle shares common sides and vertices. Most CAD packages will allow the user to export to the .STL file format, and providing Photogenic with good .STL files will assure you a speedy quote turnaround, and good quality models. As an STL file is a set of triangular facets of the model, for each facet, the three vertices and the unit normal vector of the facet are specified [1]. A typical facet format in a STL file is shown in figure 1: Facet normal < x n > < Outer loop Vertex < x1 > < Vertex < x 2 > < Vertex < x3 > < End loop Endfacet

Triangular facets in an STL file must obey the following two rules: [10] 1-Vertex-to-Vertex.: Each triangular facet must share one, and only one, edge with each of its adjacent triangles. In other words, a vertex of one triangle cannot lie on the side of another (figure 2). 2- Facet Orientation: The orientation of the facet is specified in two ways, which must be consistent. First, the direction of the normal vector is outward. Secondly, the vertices are listed in a counter clockwise order when looking at the object from the outside.

yn > < zn >


y1 > < z1 >

y2 > < z2 >

y3 > < z 3 >

Figure 1: .STL file format Where: Figure 2: vertex to vertex rule There are several distinct advantages with the STL file. Firstly, it provides a simple method of representing 3dimensional CAD data. Secondly, it is already a de facto standard and has been used by most CAD systems and RP systems. Finally, it can provide simple files for data transfer for geometric shapes. But there are several disadvantages associated with a STL file: It is many times larger than the original CAD data file and it carries much redundant information.

xn , y n , z n xi , y i , z i
:

: coordinates of normal vector of facet

1 i 3 : Coordinates of
facets vertices.

Number of facet is depended on the resolution of the CAD model tessellation; as shown in table 1, where a simple sphere has been tessellated with different resolutions.

Number of triangles 224 2400 24648

resolution 0.1mm 0.01mm 0.001mm

Geometry flaws exist in STL file because many tessellation algorithm used by CAD systems are not robust In this paper an attempt will be made to solve these problems in STL files by adopting new approach. 4. ERRORS OCCUR IN .STL FILE When a CAD model is too complex then the number of facets in .STL file increases many enormously. Also, CAD systems may generate incorrect .STL files that do not obey the two rules described above, so it may cause a RP machine not to function properly and may cause an interruption in making the solid model.

Table 1: Number of triangles vs. resolution For a simple sphere

18 International Conference on Production Research

th

Several problems plague .STL files and they are due to the very nature of .STL files as they do not contain topological data. The most common occurring errors in .STL files are as follow [1]:

4.1: Incorrect normal vector Tessellation of surfaces with large curvature can result in the wrong orientation of facets which in turn means not obeying the facet orientation rule. 4.2: Gaps (missing facets) Tessellation of surfaces with large curvature can result in errors at the intersections between such surfaces, leaving gaps or holes along edges of the part model as shown in bold lines in Figure 3.

Figure 5: overlapping facets 4.5: Non-manifold conditions When two parts of a model are tangent (as shown in figure 6) , some CAD systems will export an STL file with nonmanifold facets, one edge of which will be shared by more than two adjacent facets .

Figure 3: missing facet example 4.3: Degenerate facets A geometrical degeneracy of a facet occurs when all of the facets edges are collinear even though all its vertices are distinct. This might be caused by stitching algorithms that attempt to avoid shell punctures (Figure 4).

(a) one edge adjacent to 3 facet

(b) (left)non-manifold vertex- (right) non-manifold facet Figure 4: degenerate facets 4.4: Overlapping facets: Overlapping facets may be generated due to numerical round-off errors during tessellation. The vertices are represented in 3-dimensional space as floating point numbers instead of integers. Thus the numerical round-off can cause facets to overlap if tolerances are set too liberally (Figure 5). Figure 6: Non manifold facets

5. THE DATABASE APPROACH

A database is similar to a data file in that it is a storage place for data. Like a data file, a database does not present information directly to the user; the user runs an application that accesses data from it and presents it to the user in an understandable format.

18 International Conference on Production Research

th

Database systems are more powerful than data files in that data is more highly organized. In a well-designed database, there are no duplicate pieces of data that the user or application must update at the same time. Related pieces of data are grouped together in a single structure or record, and relationships can be defined between these structures and records. When working with data files, an application must be coded to work with the specific structure of each data file. In contrast, a database contains a catalog that applications use to determine how data is organized. Generic database applications can use the catalogue to present users with data from different databases dynamically, without being tied to a specific data format. A database typically has two main parts: first, the files holding the physical database and second, the database management system (DBMS) software that applications use to access data. The DBMS is responsible for enforcing the database structure, including [10]:

Relational Database: Although there are different ways to organize data in a database, relational databases are one of the most effective ones. Relational database systems are an application of mathematical set theory to the problem of effectively organizing data. In a relational database, data is collected into tables (called relations in relational theory) [10].

Incorrect STL File

DTS
Database

Maintaining relationships between data in the database. Ensuring that data is stored correctly and that the rules defining data relationships are not violated.

Detection, Repairing, Reporting algorithms DBMS DTS

Analyzing Information

Database vs. flat files: Self-describing: The definition of the data format is stored in the system catalogue which contains information on the structure of each file and the type and storage format of each item. This information is called meta- data and it describes the structure of the primary database. Insulation between users/programs and data: In traditional file processing the structure of the data is embedded in the access programs, so any changes to the structure of a file requires changing all the programs that access it. DBMS programs are written independently of any specific files and the structure of data files is stored in the catalogue. Data sharing and multiple view definition: Different users may require different views of the data. A view may be a subset of the data or it may contain virtual data, derived from the database but not explicitly stored. Concurrent data access: There must be concurrency control to ensure that if several users are trying to update the same data they do so in a controlled manner and without interference, for example a travel agent booking seats on a plane. Other issues of the database approach: Integrity preservation Access flexibility Optimisation of performance Security preservation Database administration

Corrected STL File

Figure 7: conceptual diagram of the system

6. IMPLIMENTATION OF THE PROPOSED APPROACH After considering the existing solution in STL correction literature, it became apparent that a flat file data structure approach has been adopted. However, in this paper an attempt is made to store the STL file data in a relational model for using relational services, features and capabilities for speeding up data retrieval and manipulation which in turn will result in a more efficient algorithm for correcting STL file shortcomings. It is also possible to develop a Client/Server or Distributed architecture that could lead to suitable environment for Concurrent Engineering.

18 International Conference on Production Research

th

Microsoft SQL SERVER 2000 was selected for designing databases schema to storing .STL files data as a DBMS in information systems. As a conceptual description of the systems functionality Initially STL files data is convert to a relational table then algorithms that realized with SQL Stored Procedure applying and retrieving problems information through searching temporary tables and correct those problems then by applying DTS modules of SQL SERVER and those was developed for this system create a new STL file with no error that mentioned in introduction of paper. (Figure 7 & 11) As a detailed description of the systems functionality initially a .STL file that is a flat ASCII file should be converted to a table that is named RelationalSTLFile. In this work, this conversion has been achieved through DTS (Data Transformation Service). DTS is a set of graphical tools and programmable objects that enable users to extract, transform, and consolidate data from disparate sources into single or multiple destinations. After that the data of the current table that have redundancy is transformed into three normal tables that are referred to as Vertex,Triangle,FacetNormal. This has been achieved through some SQL scripts and stored procedures and DTS modules that have been programmed for this work. The schema of the database is depicted in Figure 8.

data structure and in repairing those errors in all of the algorithms generate some new edges and delete some bad conditioned old edges. Therefore for achieving this in this work an attempt will be made to implement it with updating some flag in temporary tables. Also reporting and analyzing algorithms read these flags and report information about errors using these flags. It must be mentioned that this reporting and analyzing algorithms is a simple search that generates some information which end user have to know. Proposed system has a UI (User Interface) that implemented in .NET that the end user could have interaction with system for set some parameters and view errors report. After applying correction algorithms the .STL file should be constructed from data of the tables that it is done by DTS objects that has been programmed to transfer the data to a flat file.

7. ADVANTAGES OF THE NEW APPROACH Because of the .STL files are many times larger than their original CAD data files for a given accuracy parameter; some .STL file size increase to more than hundreds mega bytes and hence analysis of these files with older approaches such as text search requires a large amount of memory and processing time. But in the developed database approach, with adopting powerful tools, such as SQL based RDBMS, time and memory can be saved and the whole prototyping cycle could be achieved with lower costs and in a much shorter time. Due to nature of DBMS, introduction of any redundant data, such as duplicate vertices and edges will be avoided. This is another important issue that can not be accomplished by adopting flat file format structure. The developed system has Client/Server architecture (figure 9) that could lead to a suitable environment for Concurrent Engineering.

Figure 8: Schema of the database All the existing STL files correction solutions searches through triangles vertices and facets. But in this work, problem solve by SQL command in stored procedures. For search algorithms and correction algorithms it have to store some temporary data that in this paper those temporary data are stored in temporary tables that search algorithms store and retrieve temporary data from it. All the established correction algorithms have three phases: first the detection of the errors. Secondly repairing the errors with predetermined tolerances and finally reporting and analyzing the errors. It is mentioned that in detection of error, a goal oriented searching algorithms which has been used in the current work, with SQL implementation have a better performance than other algorithms that used flat file Figure 9: client/server architecture 7.1. Requirements for Concurrent Engineering Whenever possible, humans work concurrently, in parallel, at the same time. One could claim that concurrent engineering is the way the building industry has been operating forever. The key, however, are the words "whenever possible". Concurrent work is possible when: Workers are aware of each others' actions, so that each can intelligently co-ordinate his/hers own actions with the actions of others.

18 International Conference on Production Research

th

Workers know what they can do. They can proactively take initiative. Workers know what they must do. They react and respond to the commands of their superiors. To do so: Workers must be able to communicate with each other, and Workers must have access to each other's work and results, which must be available to them in a meaningful form. Information Technology (IT) can help fulfill these requirements. The Concurrent Engineering Environment is composed from a set of systems, which can either act as clients or servers. Each system which offers a service is called a server. Servers themselves can be mutually clients of other servers. 8. SOME RESULTS The proposed approach is extremely fast. On a PC platform (CPU: Mobile Intel 2.00 GHz; RAM 768 MB; OS: Microsoft Windows XP Workstation ), it takes less than 10 sec to build the topological structure of a large STL model in tables with more than 10 000 facets (the size of the ASCII STL file is about 3 MB). Table 2 represents the performance of the developed system. Size(MB) 1.80 3.12 DTS Algorithm Execution Execution time(sec) time(sec) 9692 4 .0486 13390 7 .0921 Table 2: results of the systems execution Number of facets

Figure 10: web based architecture

9. CONCLUSIONS AND SUGGESTIONS FOR FUTURE WORK Rapid prototyping processes produce models layer by layer. Hence, the CAD model must be first tessellated to triangles and create a .STL file. An incorrect .STL file might be causing some problems in part building. There are some .STL correction algorithms and methods which most of them are working with flat text file. But this work is based on relational database. It is a new approach when a structured text file like .STL file format could be transfer to some normal related tables. In this new approach by using features of database and especially in this work by using SQL SERVER and its search engine the speed of detecting errors and error correction could be improved considerably in comparison with flat text file approaches. Future work that needs to be undertaken includes two main domains: 1. Expanding the system into a web based environment (figure 10) enables more than one user to access and work with an errorless .STL file, test the part and make the necessary changes to it. 2. Expand this Database approach to slicing algorithms aimed to slice the CAD model for build in a rapid prototyping machine.

18 International Conference on Production Research

th

[2] P. Kulkarni, A. Marsan and D. Dutta "A review of process planning techniques in layered manufacturing rapid prototyping journal vol 6.number 1. 2000 pp: 18-35 [3] L.-C. Zhang, M. Han and S.-H. Huang ; An Effective Error-Tolerance Slicing Algorithm for STL Files Int J Adv Manuf Technol (2002) 20:363367 [4]. S. J. Rock and M. J. Wozny, Generating Topological Information from a Bucket of Facets, presented at Solid Freefrom Fabrication Symposium, Austin, TX, 1992.

[5]. J. H. Bhn and M. J. Wozny, Automatic CADmodel Repair: ShellClosure, presented at Solid Freefrom Fabrication Symposium, Austin, TX, 1992. [6]. I. Mkel and A. Dolenc, Some Efficient Procedures for Correcting Triangulated Models, presented at Solid Freeform Fabrication Symposium, Austin, TX, 1993. [7]. A. D. Martin, ADMESH 0.93, [8]. S. Morvan and G. Fadel, IVECS: An Interactive Virtual Environment for the Correction of .STL Files, presented at the ASME Design Technical Conferences, U. of California at Irvine, Irvine, CA, 1996. [9] L.-C. Zhang, M. Han and S.-H. Huang An Effective ErrorTolerance Slicing Algorithm for STL Files Int J Adv Manuf Technology (2002) 20:363367 Ownership and Copyright 2002 Springer-Verlag London Limited [10] M. Szilvasinagy ,Gy. Matyasi; Analysis of STL file Mathematical and computer modeling, 38 (2003) 945-960 [11] SQL server 2000 SDK (software development kit) [12] 3D Systems Company. www.3dsystems.com [13] Boothroyd G, Dewhurst P and Winston K, Product design for manufacture and assembly. Marcel Decker Inc., New Yprk 1994. [14] Abdalla H S, A FEATURE-BASED PROTOTYPE SYSTEM FOR THE EVALUATION AND OPTIMISATION OF MANUFACTURING PROCESSES Computers & Industrial Engineering 37 (1999) 481-484 Figure 11: Flowchart of the system. [15] Thomas Connolly, Carolyn Begg, Anne Strachan database systems Addison Wesley ISBN 0-201-34287-1.

REFERENCES [1] c.c. Kai l.k. Fai, Rapid prototyping principles and applications in manufacturing John Wiely & sons ISBN 0471-19004-7

S-ar putea să vă placă și