  the increased use of minimally invasive surgical procedures in medicine is a reality , with applications in different specialties .
the small incisions ensure the patient smaller exposure to infections , as well as a quicker recovery .
the radiofrequency cardiac ablation is a good example of it , being extensively used for over 10 years in the treatment of tachycardia , atrial fibrillation , and atrial flutter [ 14 ] .
this technique is not free from complications , although it has advanced in the last decade .
the esophageal injury is a common damage , characterized by the union of tissues from the left atrium and esophagus , through necrosis [ 1 , 4 ] . the consequence for the patient is death caused by internal bleeding , as blood is diverted directly to the stomach , when it is not noticed by the physician . in the literature ,
studies using the finite element method ( fem ) are targeted to improve cardiac ablation procedure and reduce possible complications , such as esophageal injury .
it is possible to highlight that the nucleus of the problem is monitoring the temperatures in the tissues involved more accurately .
this approach is not simple , and the computational simulation using fem has contributed significantly to the improvement of this technique [ 512 ] . for such simulations , the finite element meshes should consider the size and histological features of the target structures .
furthermore , the quality of the meshes is another fundamental property to properly simulate the desired phenomena .
the techniques which are able to generate meshes with such characteristics are preferred , and when they are generated with open source codes , they make easier tests with no user restrictions .
these properties can guarantee more accurate and clinically relevant simulations . in this context , it is possible to verify that some methods or tools used to generate meshes of human body structures are still limited by providing or using nondetailed models [ 58 , 10 , 1315 ] , by the need of nontrivial preprocessing , which is a primary step applied to define , extract , or change the anatomical features ( boundary domain ) required by meshing generation step [ 7 , 11 , 1518 ] or due to limitations of the user condition [ 5 , 6 , 8 , 12 , 13 , 18 , 19 ] .
one of the reasons for this finding is the necessary commitment to represent the complicated geometries of the involved domains , which requires sophisticated resources being sometimes under development in specific tools for geometric modeling and mesh discretization [ 20 , 21 ] .
a typical integrated software tool to construct three - dimensional domains and finite element meshes may have a development time cycle of more than 10 years [ 22 , 23 ] and frequently with exceptions to allow linking with other mesh generators .
an alternative is integrating open source software packages dedicated to solid modeling with automatic generation of tetrahedral meshes , which are available in the literature .
, the present paper demonstrates alternatives to solid modeling and automatic generation of highly refined tetrahedral meshes and with quality compatible with other studies focused on mesh generation .
the chosen tools were the blender software   as solid modeler and the tetgen as automatic mesh generator , which uses the delaunay tetrahedralization [ 25 , 26 ] .
furthermore , in this study we demonstrate cardiac structures as a first application context , motivated by the importance that the meshes of these structures represent for studies of cardiac ablation . in the next sections a discussion concerning our strategy for software integration and performance tests in realistic application domain
  the proposed methodology for solid modeling and automatic generation of tetrahedral meshes was organized in section 2.1 , with details about the defined anatomical properties for the application context ; section 2.2 , with definitions of the used packages and corresponding justifications ; section 2.3 , with details about the recommendations to discretize domains ; and section 2.4 , with specifications from the integration process of the models built on the solid modeler to the algorithm used in the automatic mesh generator .
the choices of cardiac structures were motivated by the complicated geometric domain and by the clinical relevance that these structures represent for the investigation of esophageal injury .
therefore , the model defined in our study was composed of cardiac regions consisting of two main parts : the right portion ( venous ) and the left portion ( arterial ) .
each portion has an atrium , a ventricle , and valves : bicuspid , and tricuspid , pulmonary or aortic valve .
the trunks of aorta and pulmonary artery were represented from their connections with the atriums to the beginning of their ramifications .
the dimensions of these structures are presented in table 1 [ 2729 ] , defined in cardiac diastole ( period of heart muscle relaxation ) and values present in major axes .
the presence of some structures is visualized on an echocardiographic image ( figure 1 ) , which was used as another reference during the modeling process .   
creating complex three - dimensional models is not a trivial task , especially without the support of sophisticated modelers and already equipped with resources to integrate it with algorithms responsible for mesh generation .
this package is an integrated system of tools , a multiplatform and contains resources to export and import objects in different formats , through scripts .
moreover , blender is available under a dual license , blender license ( bl ) and gnu general public license . with all these resources ,
it becomes possible to represent the domain of interest and use scripts , written in python language , to export features required by the automatic mesh generator .
the stage for automatic generation of tetrahedral meshes is not a trivial task , a fact that limits the use of a single algorithm to discretize the most different contexts .
the algorithms commonly applied to generate tetrahedral meshes have good and bad points [ 26 , 3032 ] , some of which require manual interference in the domain to obtain the desired discretization .
although there are different methods for generating three - dimensional meshes , we chose the delaunay algorithm [ 25 , 31 ] for being one of the most popular and one of the most efficient algorithms , available in the tetgen package .
just as blender , tetgen is an open source software ( oss ) and is available under mit license .
this package is maintained by the research group called numerical mathematics and scientific computing , weierstrass institute for applied analysis and stochastics ( wias ) , berlin , germany .
the selected packages for the models construction and automatic generation of meshes were explored in a computer with a 2.40  ghz quad core processor and 16  gb of ram memory .
the operating system used uses 64-bit architecture , running blender in version 2.49b and tetgen mesh generator in version 1.4 .  
the representation of solids in the blender package must respect two strategies to ensure the integration with the automatic mesh generator .
the strategies or recommendations are ( 1 ) definitions of faces and ( 2 ) density control of vertices , whereas the application of each must consider the complexity of the specific region .
the strategy definitions of faces consist of choosing the most appropriate types of faces to discretize a solid . regular or noncomplex regions of the specific domain must be discretized with quadrilateral or rectangular faces . a quadrilateral or rectangular face can be modified to fill regions with sharp angles , since the values of the internal angles of the faces are between 30 and 160 degrees .
the limits were defined on the basis of the stage of mesh generation , according to the values which propitiated intact and highly refined meshes . in the application focused on this study , quadrilateral or rectangular faces were used to discretize the atriums , the ventricles , the trunks of aorta and pulmonary artery , and the bicuspid , tricuspid , aortic , and pulmonary valves , which are regular and cylindrical regions ( marked in blue in figure 2 ) .
regions with triangular faces were constructed where the discretization required faces with internal angles out of the predetermined range .
the triangular faces are equilateral , isosceles or scalene elements and allow more appropriated representations of regions with sharp angles , such as those occurring at bifurcations points . in the application
explored in this study , that situation is commonly evidenced in the bifurcations of arteries and veins , as well as in the regions of connection between atriums , ventricles , and arteries .
the increasing number of vertices allows a better representation of curved regions , by smoothing the direction transition and respecting the features defined on the first property and the orthogonality of the faces ( figure 2 ) . in the context of cardiac structures ,
this strategy was applied in the construction of cardiac valves , bases of ventricles and in the change of the direction of the aorta and pulmonary artery responsible for their correct positions . 

figure 3 shows examples of regions generated with the strategies or recommendations described previously .   
a domain discretized in blender is stored in its native file format : a  blend file  .
the data used to discretize a solid are stored in this standard file in structures named data blocks .
data blocks are data structures similar to the heterogeneous structure type . in a simple domain
the data blocks can be made of object , mesh , material or scene type , including many others .
a data block made of object type stores information about the mesh size and the linear transformations applied ; a datablock made of mesh type stores information about the vertices , edges , and faces of the model ; a datablock made of material type stores information about the colors assigned to a certain set of vertices , edges or faces .
therefore , the datablocks are linked by pointers and defines a data structure of tree type ( figure 4 ) .  
figure 5 exemplifies the structures described for material , mesh , and object datablocks used to represent each cardiac structure , based on blender architecture , requiring a total of 14 datablocks .  
the integration of the models constructed on blender with the mesh generator tetgen was accomplished by python script .
these structures read the data contained in mesh and object data blocks and translate the information about vertices , faces , holes , and attributes accordingly .
the processed information is an ascii file ( .poly ) , properly written in the formats required by tetgen .
the python script presented by   exports only the active solid , which limits the potential for the meshing of mixed solids .
the modification performed repeats the process for the group of existing solids automatically and generates a single ascii file ( .poly ) .  
figure 6 shows a diagram of the algorithm used for exportation , with the proposed modification . a typical  poly file 
is composed by 4 parts : an indexed list of point coordinates ; a list of solid faces ; a list of volume holes ; and a list of attributes or boundaries ( constraints ) , see supplementary material ( appendix 1 ) available online at http://dx.doi.org/10.1155/2013/540571 . 

figure 7 represents the integration strategies of the blender and tetgen using the python script ( figure 6 ) .
each point has three coordinates ( x , y , and z ) and probably includes one or several attributes and a boundary marker as well .
face file  contains a list of triangular faces , which may be boundary faces , or convex hull faces .
  in this work , the cardiac structures were chosen as a first application context , since three - dimensional meshes of these structures are relevant for studies of cardiac ablation . the complicated geometric domain selected allowed to test the feasibility of the combined use of anatomical features ( section 2.1 ) , free and open source packages ( section 2.2 ) and apply strategies ( sections 2.3 and 2.4 ) .
the organization of the cardiac structures was represented in blender , considering atriums , ventricles , valves ( bicuspid , tricuspid , pulmonary , and aortic ) , and artery trunks ( aorta and pulmonary artery ) .
boundary markers are numerical codes such as 1000000 used to assign the blue color to the faces of left ventricle .
a preview of each structure and its boundary markers is represented in figure 9 .  
a raw mesh was generated from the proposal presented , and a cut was made to better illustrate the quality of the mesh .  
figure 10 shows a mesh constructed with 33875 faces , 42371 nodes , 10 boundary markers , and 223851 tetrahedral elements , a useful example to validate the concept of iteration loop described in the previous section .
studies grounded in fem require tools with resources to generate highly refined meshes of simple or complex domains , and in an acceptable time .
the methodology proposed in this paper meets these requirements . for the chosen complicated application context ,
meshes were generated through successive refinements of the coarse initial mesh ( figure 10 ) .
regions of the atriums and ventricles were used to demonstrate the number of tetrahedral elements presented in some refinements ( figure 11 ) .
it was therefore possible to estimate the processing time growth , and the number of tetrahedral elements increased .
just a few studies show how many elements have their meshes [ 16 , 19 ] .
the mesh quality is another important aspect that should be considered in proposals designed to generate meshes through fem simulations
the quality of a tetrahedral element is commonly measured in terms of minimal and/or maximal dihedral angles .
for instance , tetrahedra constructed with too small or too large dihedral angles can cause interpolation errors and lead to numerical simulation with higher instability and less accuracy [ 33 , 34 ] .
the desired quality is the one in which the values of dihedral angles are close to the values set on a regular tetrahedron [ 26 , 34 , 35 ] .
this can be verified in histograms constructed with the total of dihedral angles present in ranges of angles , as well as identification of the smallest and largest values involved [ 33 , 34 ] .
it is possible to verify through the presentation of the mesh constructed with 12009998 tetrahedral elements ( figure 13 ) and the corresponding histogram ( figure 14 ) that our proposal allows obtaining highly refined meshes from complex domains , in some acceptable time and quality .
this number of elements may facilitate the representation of degenerated tetrahedral elements and effectively indicate the limits of the proposed approach .
however , it is also possible to verify that the tetrahedral elements have dihedral angles whose values belong to the interval which varies from 5 to 170 degrees , with peak values around the condition for a regular tetrahedron .
these values are close to those used to determine the mesh quality in other studies [ 33 , 34 ] .
for instance , the algorithm proposed by   is capable of producing tetrahedral meshes whose dihedral angles are bounded between 10.7 and 164.8 degrees or between 8.9 and 158.8 degrees with a change in parameters .
also , when nonuniform tetrahedra on the surface boundary are chosen , the dihedral angles are bounded between 1.66 and 174.72 degrees . in another example
, tetrahedral meshes are generated with the minimal dihedral angle being guaranteed to be greater than or equal to 5.71 degrees .
  the proposal presented in this paper considered strategies to build solid and automatic mesh generation , based on open source packages .
the strategies are feasible to generate highly refined mesh in some acceptable time and with the required quality for simulation using the finite element method ( fem ) .
these facts were demonstrated by considering a complex domain with some practical importance , as in the case of mesh structures for the study of cardiac ablation through fem .
the most refined mesh involved approximately 12 million elements and was generated in 5.35 minutes . despite the significant number of tetrahedral elements involved , the explored example does not define the limit of possible refinements from our approach .
the tetrahedral quality was also discussed and the values of dihedral angles generated are consistent with the literature .
so , our proposal provides a significant contribution to the mesh generation for studies using fem , which is a known method applied in different areas .
 the finite element method is a well - known technique , being extensively applied in different areas . 
 studies using the finite element method ( fem ) are targeted to improve cardiac ablation procedures . for such simulations 
 , the finite element meshes should consider the size and histological features of the target structures . 
 however , it is possible to verify that some methods or tools used to generate meshes of human body structures are still limited , due to nondetailed models , nontrivial preprocessing , or mainly limitation in the use condition . in this paper , 
 alternatives are demonstrated to solid modeling and automatic generation of highly refined tetrahedral meshes , with quality compatible with other studies focused on mesh generation . 
 the innovations presented here are strategies to integrate open source software ( oss ) . 
 the chosen techniques and strategies are presented and discussed , considering cardiac structures as a first application context . 
1. Introduction
2. Material and Methods
3. Results and Discussions
4. Conclusion