MESHING A 3D POINT CLOUD OF AN ELEVATION SURFACE BASED ON 2D DELAUNAY TRIANGULATION In Partial Fulfillment of the Requirements of the Degree of MASTER OF INFORMATION TECHNOLOGY MANAGEMENT By NHAN Ba Cong ID: MITM05002 International University - Vietnam National University HCMC May 2015 MESHING A 3D POINT CLOUD OF AN ELEVATION SURFACE BASED ON 2D DELAUNAY TRIANGULATION In Partial Fulfillment of the Requirements of the Degree of MASTER OF INFORMATION TECHNOLOGY MANAGEMENT By NHAN Ba Cong ID: MITM05002 International University - Vietnam National University HCMC May 2015 Under the guidance and approval of the committee, and approved by all its members, this thesis has been accepted in partial fulfillment of the requirements for the degree Approved: -Chairperson Committee member -Committee member Committee member -Committee member Committee member Acknowledgements To complete this thesis, I have been benefited from Dr Nguyen Van Sinh who has been helping me very much I would like to give special thanks to my advisor, who support of my master study and research Thank you again for bringing me step by step to this interesting thesis topic I would also like to thank all lecturers in the School of Computer Science and Engineering Their lectures throughout my years of study here have been helping me not only on knowledge, but also in the research strategy And we thank my reviewers and thesis examination committees for their valuable comments, evaluations valuable contributions and constructive suggestions i Plagiarism Statements I would like to declare that, apart from the acknowledged references, this thesis either does not use language, ideas, or other original material from anyone; or has not been previously submitted to any other educational and research programs or institutions I fully understand that any writings in this thesis contradicted to the above statement will automatically lead to the rejection from the MITM program at the International University Vietnam National University Ho Chi Minh City ii Copyright Statement This copy of the thesis has been supplied on condition that anyone who consults it is understood to recognize that its copyright rests with its author and that no quotation from the thesis and no information derived from it may be published without the author’s prior consent © NHAN Ba Cong / MITM05002/2013-2015 ©Dr NGUYEN Van Sinh / HCMC International University iii Abstract Geometric modeling is one of the most important methods to represent an object in multi-dimensional space It’s widely used in many technical fields such as image processing 3D simulation, auto design, architecture, etc Several techniques are used to obtain the data of point clouds such as 3D scanners that provides a huge amount of unorganized 3D point sets The 3D Point clouds are used as input data in several applications such as reverse engineering, CAD modeling and animation technology and so on Various methods are available for generating a triangular mesh from a 2D or 3D point cloud They can be applied on both open and close surfaces The main goal of this thesis is to the study some algorithms for meshing a surface of 3D point clouds In this thesis, we first presented an algorithm proposed by Sinh N.V [1] that generates a triangular mesh from 3D point clouds We then also proposed and implemented an addition work to reconstruct the surface by filling the holes of triangular mesh The input data are 3D point clouds structured in a sparse 3D volume The algorithm describes a triangulation of this surface based on Delaunay triangulation Delaunay triangulation is one of the most popular methods used to generate a triangular mesh In fact, we base on the advantage of 3D point structured in grid 3D and proposed a fast search algorithm [1] to obtain higher performance We start by projecting the 3D point clouds onto a 2D grid in the x, y plane Then, we triangulate the surface (actually, we compute a Delaunay triangulation of the 2D point cloud taking advantage of its regular structure) The new contribution of the proposed method is that the neighboring points of an edge ei are searched in a rectangle supported by the edge ei under consideration This interesting algorithm has been implemented, the result obtained shows that the processing time is very fast, the initial shape of the surface is well preserved, and the topology of the output triangular mesh approximates the original input surface iv Table of Contents Abstract iv Introduction - 1.1 Background and Aim of the Thesis - 1.2 Problem Statement - 1.3 Objective and Scope - 1.3.1 Methodology - - 1.3.2 Geological data model - - 1.4 Thesis structure - Literature Review - 2.1 Background - 2.2 2D Triangulation Algorithm - 2.2.1 Delaunay triangulation using a uniform grid - - 2.2.2 The Constrained Delaunay Triangulation of a Polygonal Domain - 10 - 2.2.3 Sweep-line algorithm for constrained Delaunay triangulation - 12 - 2.3 Three-dimensional Triangulations Algorithm - 15 - 2.3.1 Alpha Shapes - 15 - 2.3.2 The Ball-Pivoting Algorithm - 17 - 2.3.3 Poisson Surface Reconstruction - 19 - The Proposed Method - 23 3.1 Introduction - 23 3.2 Concepts, Notion and Definition - 24 3.3 Projecting into 2D Matrix - 26 3.4 Delaunay triangulation Algorithm - 26 3.4.1 Building a seed triangle - 26 - 3.4.2 Neighboring points search - 27 - 3.4.3 Delaunay Criterion - 28 - 3.5 Fast Voxel Traversal Search - 30 3.5.1 Overview - 30 - 3.5.2 Computing the discrete mediatrix - 31 - 3.5.3 Computing the successive dilations of the discrete - 32 - 3.5.4 The Algorithm based on the voxel traversal search - 33 - 3.6 Triangulating a surface - 35 Reconstruction - 36 4.1 Introduction - 36 v 4.2 Removing outward triangle - 37 4.3 Hole filling - 38 - 4.3.1 Overview - 38 - 4.3.2 Determining holes - 39 - 4.3.3 Filling the holes - 39 - 4.3.4 Triangulating the holes - 40 - Implementation and Results - 41 5.1 Implementation - 41 5.2 Results - 42 5.3 Evaluation and Discussion - 46 - Conclusion and Future work - 47 6.1 Conclusion - 47 6.2 Future work - 47 - References - 48 - Appendices - 51 8.1 Appendix A: Screenshots of the Demonstration Applications - 51 8.2 Appendix B – Implementation C++ in meshlab as a plugin - 56 - vi List of Tables Table Comparison of the processing times between our method (VTS) and Ball - Pivoting (BP) We use the same input data points and run on the same computer - 43 Table The results of computation the approximate errors by using Metro tool [32] - 46 - vii List of Figures Figure 1.1: 3-D oblique view of a portion of the Black Warrior Basin Thin vertical lines are wells; semi-transparent surfaces outlined in black are faults [6] -2Figure 1.2 A geological model used in the oil exploration [5] -4Figure 1.3 Collection of geological data [5] a) by a marine seismic acquisition; b) by processing seismic images [5] -4Figure 1.4 Flowchart of our thesis -5Figure 2.1 Procedure to form a triangle, given an edge -8Figure 2.2 The triangle generated (12) and edgePool (P2P1; P3P2; P4P3; P1P4) -9Figure 2.3 Graphical illustration of time complexity (12) -9Figure 2.4 In triangle ∆(𝑣𝑖, 𝑣𝑗, 𝑣𝑘)there are no vertices of V (15) - 11 Figure 2.5 The run times of the algorithm was measured for randomly generated polygons To get these polygons, we remove arbitrary triangles from a triangulation of randomly generated vertices On the right side a Constrained Delaunay triangulation of the randomly generated polygon of the left side is shown (13) - 12 Figure 2.6 Associating edge information to the points (18) - 13 Figure 2.7 Finalization forms upper and lower convex hull (18) - 14 Figure 2.8 Five different a-shapes for values of an increasing from left to right are shown The first shape is the point set itself, for a = 0, the last shape is the convex hull, for a= + ∞.(20) - 16 Figure 2.9 The anisotropy method does remove triangles connecting the surfaces of the sphere (20) 17 Figure 2.10 Ball pivoting in the presence of noisy data (14) - 19 Figure 2.11 Depth 10 reconstructions from 1M point uniformly sampled on the fandisk and raptor surface models The screened Poisson surface reconstruction is the sharpest [24] - 21 Figure 2.12 Reconstructions of the “Happy Buddha” model using Volumetric Range Image Processing [25] (left) and Poisson reconstruction (right) [22] - 21 Figure 3.1: Triangulation of a 3D point cloud by projecting it onto the 2D grid - 23 Figure 3.2: Some concepts and notations used in the surface triangulation - 24 Figure 3.3: A case of CDBE - 25 Figure 3.4: Determination of the first Delaunay edge - 27 Figure 3.5 Condition of non-intersection for generated triangles - 28 Figure 3.6 The voxels traversal search - 30 Figure 4.1 Output of the surface consist a big unwanted triangles (red) and the holes - 36 Figure 4.2 The outside triangle on the boundary - 37 Figure 4.3 The boundary triangles of the hole are presented in the center of surface - 38 Figure 4.4 Determine holes of triangular surface - 39 Figure 4.5 a) Original surface b) After filling the hole (Blue point) - 40 Figure 4.6 Triangulate the hole - 40 Figure 5.1 The triangular surface and then filling two holes in this surface (blue) - 43 Figure 5.2 The point cloud of the surface - 44 Figure 5.3 Initial triangular mesh, removing outward triangles and hole-filling - 44 Figure 5.4 Initial triangular mesh, removing outward triangles and hole-filling - 44 Figure 5.5 Filling the holes and refining new points - 45 Figure 5.6 Another view of the triangular mesh of the surface - 45 Figure 5.7 The holes - filling is zoom out (small figure) - 45 Figure 8.1 a) The input surface of 3D point clouds b) After simplifying by using [1] There are some color points which have shown that the characteristics of the surface are well preserved - 51 viii Graphics, vol 5, no 4, pp 349 - 359, 1999 [15] R Klein, "Construction Of The Constrained Delaunay," CAD Systems Development, pp 313-326, 1997 [16] P Chew, "Constrained Delaunay triangulations," Algorithmica, 1989 [17] Lin, D T Lee, "Generalized Delaunay triangulations for planar graphs," Discrete & Computational Geometry, vol 1, no 1, pp 201-217, 1986 [18] ZˇALIK, V DOMITER, "Sweep-line algorithm for constrained Delaunay triangulation," International Journal of Geographical Information Science, vol 22, no 4, p 449–462, 2008 [19] Edelsbrunner, Herbert, "Three-dimensional alpha shapes," ACM Transactions on Graphics, vol 13, p 43–72, 1994 [20] Marek Teichmann, Michael Capps, "Surface reconstruction with anisotropic densityscaled alpha-shapes," Visualization'98 Proceedings , pp 67-72, 1998 [21] G Taubin, "A signal processing approach to fair surface design," Proceedings of the 22nd annual conference on Computer graphics and interactive techniques, vol 22, p 351–358, 1995 [22] Kazhdan, Michael, "Poisson Surface Reconstruction," Eurographics Symposium on Geometry Processing, vol 7, 2006 [23] Fattal Raanan, Dani Lischinski, and Michael Werman, "Gradient domain high dynamic range compression," ACM Transactions on Graphics (TOG), vol 21, no 3, p 249–256, 2002 [24] HOPPE, MICHAEL KAZHDAN and HUGUES, "Screened Poisson Surface Reconstruction," ACM Transactions on Graphics, vol 32, no 3, 2013 [25] Curless, Brian, and Marc Levoy, "A volumetric method for building complex models from range images," Computer graphics, p 303–312, 1996 [26] Nguyen, Van-Sinh, Alexandra Bac, and Marc Daniel, "Boundary Extraction and Simplification of a Surface Defined by a Sparse 3D Volume," Proceeding of the third international symposium on information and communication, Pages 115-124, ACMISBN: 978-1-4503-1232-5, 2012 [27] John Amanatides, Andrew Woo, "A Fast Voxel Traversal Algorithm for Ray Tracing," Eurographics, vol 87, no 3, 1987 [28] F.Bernardini, J.Mittleman, H.Rushmeier, C.Silva, G.Taubin, "The Ball Pivoting Algorithm for Surface Reconstruction," Transactions on Visualization and Computer Graphics, vol 5, no 4, pp 349 - 359, 1999 [29] Lin Hong-Wei, Chiew-Lan Tai, and Guo-Jin Wang, "A mesh reconstruction algorithm driven by an intrinsic property of a point cloud," Computer-Aided Design, vol 36, no 1, - 49 - pp - 9, 2004 [30] NGUYEN Van Sinh, Alexandra BAC, Marc DANIEL, "Simplification of 3D Point Clouds sampled from Elevation Surfaces,"21st International Conference on Computer Graphics, Visualization and Computer Vision WSCG 2013, Pages 60-69, ISBN: 978-8086943-75-6}, 2013 [31] C R P.Cignoni, "Metro: measuring error on simplified surfaces," The Eurographics Association, no 17, 1998 [32] P Cignoni, C Rocchini and R Scopigno, "Metro: measuring error on simplified surfaces," Computer Graphics Forum, vol 17, no 2, pp 167-174, 1998 [33] ISTI, "Meshlab," 2014 [Online] Available: http://meshlab.sourceforge.net/ [34] Patric Keller, Martin Hering-Bertram, Hans Hagen, Surface Reconstruction from Unorganized 3D Point Clouds, INTECH Open Access, 2012 [35] D T Lee and A K Lin Generalized Delaunay triangulation for planar graphs Discrete and Computational Geometry, Volume1, Number1, Pages 201–217, 1986 [36] D T Lee and B J Schachter Two algorithms for constructing a Delaunay triangulation International Journal of Computer and Information Sciences, 9(3): 219–242, 1980 [37] B Mederos, L Velho, and L H Figueiredo Smooth surface reconstruction from noisy clouds Journal of the Brazilian Computer Society, 9(3):52–66, April 2004 - 50 - 8.1 Appendices Appendix A: Screenshots of the Demonstration Applications Figure 8.1 a) The input surface of 3D point clouds b) After simplifying by using [1] There are some color points which have shown that the characteristics of the surface are well preserved Figure Figure 8.2 8.2 Triangulating Triangulating the the mesh mesh (left), (left), then then filling filling two two holes holes (right) (right) in in the the sample sample - 51 - Figure Figure 8.3 8.3 Removing the outside triangles of the surface - 52 - Figure 8.4 The original surface with boundary Figure 8.5 After triangulating mesh in the surface - 53 - Figure 8.6 The outward triangles is deleted out of the triangular mesh Figure 8.7 Filling the holes of the mesh - 54 - Figure 8.8 Another view of the surface Figure 8.9 Reconstruction of the triangular mesh - 55 - 8.2 Appendix B – Implementation C++ in meshlab as a plugin //Delaunay algorithm void SeedTriangle(); // find seed bool Delaunay(Point3f /*P0*/, Point3f /*P1*/, Point3f /*Pi*/,bool&); //Matrix 4x4 double Determinant(Point3f, Point3f, Point3f, Point3f); //find Pc & Radius void CircumCenterRadius(Point3f , Point3f , Point3f, Point3f&, float&); void CircumCenter(Point3f, Point3f, Point3f,Point3f& ); // A.Woo: VTS find next point void VoxelTraversal(Point3f& Xstart, int stepX, int stepY, double deltaX, double deltaY, double& maxX, double& maxY); //Compute void AWLine(Point3f dx, Point3f xStart, int& stepX, int& stepY, double& deltaX, double& deltaY, double& maxX, double& maxY); //Search pi ~ SearchNeighbors bool SearchNeighbors(TriangleIndex /*ei*/, Point3f& /*idx*/); //Search p3 //Process Mesh generating void MeshGenerating(CMeshO&, vcg::CallBackPos *); void BuildMesh(CMeshO&, vector); void SetBoundaryBox(MeshModel&); // Hole-Filling void fillHoles(CMeshO &, vector); - 56 - //Main Processing: Process Mesh generating void FilterLayerPlugin::MeshGenerating(CMeshO& cm, CallBackPos call = NULL) { //Project for (CMeshO::VertexIterator vi = cm.vert.begin(); vi != cm.vert.end(); vi++) { Point3f p = (Point3f)(*vi).P(); //real co-ordinates Point3f pp = p - P_Min; //projected point relative co-ordinates pp.X() = pp.X() + kFirst; pp.Y() = pp.Y() + kFirst; int index = (int)(pp.Y()*widthBBox) + (int) pp.X(); ArrayProjected[index] = 1;//set new co-ordinates equal in wherever the point } // First triangle SeedTriangle(); TriangleIndex ei; visitedPool.clear(); //Clear() while(edgePool.size() > 0) { vector::iterator ti = edgePool.begin(); ei = *ti; if (has2Triangles(ei.p0,ei.p1,ei.p2)) { edgePool.erase(ti); EdgeVisitedSortedAdd(ei.p0,ei.p1); continue; } edgePool.erase(ti); if (EdgeBinarySearch(ei.p0, ei.p1)) continue; EdgeVisitedSortedAdd(ei.p0,ei.p1); //find p3 //Search in bouding box; Point3f p; /*optimize Store: remove if else */ if(SearchNeighbors(ei,p)) Store(ei.p0, ei.p1, getPointIndex(p), false); else //Not found a new face (the edge just has a face if (ArrayProjected[ei.p0] < && ArrayProjected[ei.p1] < 2) lsEdgeSingle.push_back(ei); } } // find seed void FilterLayerPlugin::SeedTriangle(void) { int p0Index, p1Index, p2Index; //Compute P0 p0Index = -1; for (int j = 0; j < widthBBox; j++) { for (int i = 0; i < heightBBox; i++) { int idx = (int)(i*widthBBox + j); if (ArrayProjected[idx] > ) { p0Index = idx; break; } } if (p0Index > 0) break; } //find V1: //closest neighboring boundary point P on the boundary - 57 - float dMin = sqrt(heightBBox*heightBBox + widthBBox*widthBBox); //compute P1 for (int i = 0; i < (heightBBox*widthBBox); i++) { if (ArrayProjected[i] < || i == p0Index) continue; float di = Distance2d(getPointXY0(p0Index), getPointXY0(i)); if (di < dMin) dMin = di; } //find a neighboring point p3 //Check align p2Index = -1; dMin = sqrt(heightBBox*heightBBox + widthBBox*widthBBox); //Compute P2 for (int i = 0; i < (heightBBox*widthBBox); i++) { if (i == p0Index || (i == p1Index) || (ArrayProjected[i] < )) continue; //Check aliign if (CrossProduct(p0,p1, getPointXY0(i) == 0) continue; float di = Distance2d(getPointXY0(p0Index), getPointXY0(i)); if (di < dMin) { dMin = di; p2Index = i; } } //Push Edges and face of Seed TriangleIndex e1, e2, e3, face; //a < -> p3 must be the right edge(p1->p2) double a = TriArea(p0,p1,p2); face.p0 = p0Index; face.p1 = p1Index; face.p2 = p2Index; edgePool.push_back(e1); edgePool.push_back(e2); edgePool.push_back(e3); lsFaces.push_back(face); } bool FilterLayerPlugin::Delaunay(Point3f p0, Point3f p1, Point3f pi, bool& isVisible) { //Exist Point Pi? (out of the matrix) if (pi.X() < || pi.Y() < || pi.X() >= widthBBox || pi.Y() >= heightBBox) return false; // i is index of Pi in Matrix int i = getPointIndex(pi); if (ArrayProjected[i] < ) return false; //No Point in matrix int p0index = getPointIndex(p0); int p1index = getPointIndex(p1); //Find opposite point if(TriArea(p0, p1, pi) ) return false; } } return true; } double FilterLayerPlugin::Determinant(Point3f A, Point3f B, Point3f C, Point3f D) { // A, B and C are sorted in a counter clockwise order -> B = i //the determinant d is positive if and only if D lies inside the circumcircle double det = 0; double a00, a01, a02, a10, a11, a12, a20, a21, a22; a00 = A.X() - D.X(); a10 = B.X() - D.X(); a20 = C.X() - D.X(); a01= A.Y() - D.Y(); a11 = B.Y() - D.Y(); a21 = C.Y() - D.Y(); a02 = (A.X()*A.X() - D.X()*D.X()) + (A.Y()*A.Y() - D.Y()*D.Y()); a12 = (B.X()*B.X() - D.X()*D.X()) + (B.Y()*B.Y() - D.Y()*D.Y()); a22 = (C.X()*C.X() - D.X()*D.X()) + (C.Y()*C.Y() - D.Y()*D.Y()); return det; } float s, area, r; float a, b, c; a = Distance2d(A, B); b = Distance2d(B, C); c = Distance2d(C, A); s = (a + b + c) / 2; area = sqrt(s*(s - a)*(s - b)*(s - c)); r = (a*b*c) / (4 * area); return r; } // Woo: SearchNeighbors bool FilterLayerPlugin::SearchNeighbors(TriangleIndex ei, Point3f& p3) { bool isVisible = false; Point3f Xmid, ed, v, vx; int stepX, stepY; double deltaX, deltaY, tmaxX, tmaxY, maxX, maxY; double det; float k = Distance(p1, p2); // compute Xmid Xmid = (p1 + p2) / 2; ed = p1 - p2; v.X() = ed.Y() *(-1); - 59 - v.Y() = ed.X(); vx = p4 - p2; //dot Product det = v.X() * vx.X() + v.Y()*vx.Y(); if (det >0) v = v*(-1); //Compute stepX, stepY, deltaX, deltaY, tmaxX, tmaxY AWLine(v, Xmid, stepX, stepY, deltaX, deltaY, tmaxX, tmaxY); maxX = tmaxX; maxY = tmaxY; //Compute L Point3f pointL; pointL.X() = (int)Xmid.X(); pointL.Y() = (int)Xmid.Y(); for (int i = 0; i < (int)k; i++) { VoxelTraversal(pointL, stepX, stepY, deltaX, deltaY, tmaxX, tmaxY); if (Delaunay(p1,p2,pointL,isVisible)) return getPointIndex(pi); } //Compute L', L1, L2 //Point3f XmixL1 direct Xmid -> P1 ++ //Point3f XmixL2 direct Xmid -> P2 ++ Point3f pi, XmixL1, XmixL2; int stepX1, stepY1; double deltaX1, deltaY1, tmaxX1, tmaxY1, maxX1, maxY1; int stepX2, stepY2; double deltaX2, deltaY2, tmaxX2, tmaxY2, maxX2, maxY2; //P1 = XmidP1 -> p1 = Xmid //Compute L1 step, delta, max XmixL1 = (p1 - Xmid) / 2; AWLine(XmixL1, Xmid, stepX1, stepY1, deltaX1, deltaY1, tmaxX1, tmaxY1); maxX1 = tmaxX1; // checkpoint maxY1 = tmaxY1; //Compute L2 step, delta, max XmixL2 = (p2 - Xmid) / 2; AWLine(XmixL2, Xmid, stepX2, stepY2, deltaX2, deltaY2, tmaxX2, tmaxY2); /*XmixL1 = Xmid; XmixL2 = Xmid;*/ XmixL1.X() = XmixL2.X() = (int)Xmid.X(); XmixL1.Y() = XmixL2.Y() = (int)Xmid.Y(); //Ray Xmid -> P1 //Ray Xmid -> P2 for (int j = 0; j < (int)k / 2; j++) { //Inrease XmixL1++ VoxelTraversal(XmixL1, stepX1, stepY1, deltaX1, deltaY1, tmaxX1, tmaxY1); if (Delaunay(p1,p2,XmixL1,isVisible)) return getPointIndex(pi); //Inrease XmixL2++ VoxelTraversal(XmixL2, stepX2, stepY2, deltaX2, deltaY2, tmaxX2, tmaxY2); if (Delaunay(p1,p2,XmixL2,isVisible)) return getPointIndex(pi); ////Ray L' (L1, L2) double maxXtmp, maxYtmp; maxXtmp = maxX; maxYtmp = maxY; pi = XmixL1; for (int i = 0; i < (int)k; i++) { VoxelTraversal(pi, stepX, stepY, deltaX, deltaY, maxXtmp, maxYtmp); if (Delaunay(p1,p2,pi,isVisible)) return getPointIndex(pi); - 60 - } pi = XmixL2; for (int i = 0; i < (int)k; i++) { VoxelTraversal(pi, stepX, stepY, deltaX, deltaY, maxXtmp, maxYtmp); if (Delaunay(p1,p2,pi,isVisible)) return getPointIndex(pi); } } //Dilatation outside k int dila = 1; //Repeat until boundary bool endL1, endL2; endL1 = endL2 = false; //Advance Search while (!isVisible) { //1 endPoint L +1 with direct v ( orthogonal to ed(P1,P2) ) //Static endL, tmaxX, tmaxY VoxelTraversal(pointL, stepX, stepY, deltaX, deltaY, tmaxX, tmaxY); if (Delaunay(p1,p2,pointL,isVisible)) return getPointIndex(pi); //Direct Xmid -> P1 ++ VoxelTraversal(XmixL1, stepX1, stepY1, deltaX1, deltaY1, tmaxX1, tmaxY1); if (Delaunay(p1,p2,XmixL1,isVisible)) return getPointIndex(pi); if ((XmixL1 = heightBBox)) || (XmixL1 >= widthBBox || XmixL1 >= heightBBox))) endL1 = true; //Direct Xmid -> P2 ++ VoxelTraversal(XmixL2, stepX2, stepY2, deltaX2, deltaY2, tmaxX2, tmaxY2); if (Delaunay(p1,p2,XmixL2,isVisible)) return getPointIndex(pi); if ( (XmixL2 = heightBBox)) || (XmixL2 >= widthBBox || XmixL2 >= heightBBox))) endL2 = true; //1 Start from endPoint L with direct (Xmid -> P1) //2 Start from endPoint L with direct (Xmid -> P2) Point3f XendL1, XendL2; for (int j = 0; j < (int)(k / 2) + dila; j++) { VoxelTraversal(XendL1, stepX1, stepY1, deltaX1, deltaY1, maxX1tmp,maxY1tmp); if (Delaunay(p1,p2,XendL1,isVisible)) return getPointIndex(pi); VoxelTraversal(XendL2, stepX2, stepY2, deltaX2, deltaY2, maxX2tmp, maxY2tmp); if (Delaunay(p1,p2,XendL2,isVisible)) return getPointIndex(pi); } ////Ray L' (L1, L2) of Dilatation double maxXtmp, maxYtmp; maxXtmp = tmaxX; maxYtmp = tmaxY; pi = XmixL1; for (int i = 0; i < (int)k + dila; i++) { VoxelTraversal(pi, stepX, stepY, deltaX, deltaY, maxXtmp, maxYtmp); if (Delaunay(p1,p2,pi,isVisible)) return getPointIndex(pi); } - 61 - pi = XmixL2; for (int i = 0; i < (int)k + dila; i++) { VoxelTraversal(pi, stepX, stepY, deltaX, deltaY, maxXtmp, maxYtmp); if (Delaunay(p1,p2,pi,isVisible)) return getPointIndex(pi); } if (endL1 && endL2) break; dila++; } return false; //Not found } void FilterLayerPlugin::VoxelTraversal(Point3f& Xstart, int stepX, int stepY, double deltaX, double deltaY, double& maxX, double& maxY) { if (maxX == maxY) { maxX += deltaX; Xstart.X() += (float)stepX; maxY += deltaY; Xstart.Y() += (float)stepY; } else if (maxX < maxY) { maxX += deltaX; Xstart.X() += (float)stepX; } else { maxY += deltaY; Xstart.Y() += (float)stepY; } return; } void FilterLayerPlugin::AWLine(Point3f dx, Point3f xStart, int& stepX, int& stepY, double& deltaX, double& deltaY, double& maxX, double& maxY) { deltaX = 1.0f / dx.X(); deltaY = 1.0f / dx.Y(); deltaX = deltaX < ? -deltaX : deltaX; deltaY = deltaY < ? -deltaY : deltaY; stepX = dx.X() > ? : dx.X() < ? -1 : 0; stepY = dx.Y() > ? : dx.Y() < ? -1 : 0; maxX = deltaX * (1 - (xStart.X() - (int)xStart.X())); maxY = deltaY * (1 - (xStart.Y() - (int)xStart.Y())); } //Recontruction void FilterLayerPlugin::SetBoundaryBox(MeshModel &m) { Point3f p, pRelative; int k = kFirst; m.clearDataMask(MeshModel::MM_FACEFACETOPO | MeshModel::MM_FACEFLAGBORDER); CMeshO::VertexIterator vi; //declare a point in a point set widthBBox = (unsigned int) m.cm.bbox.DimX()+1; //get the width of bounding box heightBBox = (unsigned int) m.cm.bbox.DimY()+1; //get the heigh of bounding box - 62 - //min, max coordinators P_Min = (Point3f)m.cm.bbox.min; P_Max = (Point3f)m.cm.bbox.max; minXBox = (unsigned int)P_Min.X(); minYBox = (unsigned int)P_Min.Y(); maxXBox = (unsigned int)P_Max.X(); maxYBox = (unsigned int)P_Max.Y(); heightBBBox_new = heightBBox + (2*k); widthBBox_new = widthBBox + (2*k); ArrayProjected = new int[heightBBBox_new * widthBBox_new]; for (int i = 0; i < (heightBBBox_new * widthBBox_new) ; i++) ArrayProjected[i] = -1; // fill all cell with value -1 Point3f pMyMinimun, pMyFirst; for (vi = m.cm.vert.begin(); vi != m.cm.vert.end(); vi++) { p = (Point3f)(*vi).P(); //real co-ordinates if(p.X() < pMyMinimun.X()) pMyMinimun = p; pRelative = p - P_Min; pRelative.X() = pRelative.X() + k; pRelative.Y() = pRelative.Y() + k; int temp = (int)(pRelative.Y()*widthBBox_new + pRelative.X()); ArrayProjected[temp] = 1; } pMyFirst.X() = pMyMinimun.X() - P_Min.X() + k; pMyFirst.Y() = pMyMinimun.Y() - P_Min.Y() + k; m.updateDataMask(MeshModel::MM_VERTCURV); GrowthClockWise(pMyFirst); //Set color on Boundary for(vi = m.cm.vert.begin(); vi != m.cm.vert.end(); vi++) { if(!(*vi).IsD()) { p = (Point3f)vi->P(); pRelative = p - P_Min; pRelative.X() = pRelative.X() + k; pRelative.Y() = pRelative.Y() + k; //Set color all points if(ArrayProjected[(int)pRelative] >= BOUNDARY_EXTERIOR_MIN ) { (*vi).SetS(); (*vi).C().ColorRamp(5,10, 0); } } } } //Fill edges with one face only void FilterLayerPlugin::fillHoles(CMeshO &mesh,vector lsEdges) { if (lsEdges.size() == 0) return; vector lse; while(lsEdges.size() > 0) { findHole(lsEdges,lse); AddVerticesHole(mesh,lse); } } - 63 - [...]... these polygons, we remove arbitrary triangles from a triangulation of randomly generated vertices On the right side a Constrained Delaunay triangulation of the randomly generated polygon of the left side is shown (13) According to Klein’s proposed [15], the algorithm is a fast and easy to implement divide-and-conquer for the calculation of a Constrained Delaunay triangulation of planar domains was described... Boris Delaunay [7] introduced an algorithm (1934) in 2D (called Delaunay triangulation) the algorithm is a planar subdivision that divides a point set on a plane into such triangles that no other point is inside the circle defined by the three vertices of the triangle Delaunay triangulation minimizes the angles of the triangles that avoid long and narrow triangles The original definition applied for a point. .. algorithms approaching such problems In 2D, Boris [7] introduced the Delaunay triangulation, Charles Lawson [8] (starts with Flip algorithm) and Ruppert [9] refine an algorithm based on Delaunay triangulation In addition, other approaches for triangulating surfaces have been proposed by J.R Shewchuk [10], Yang and H.Zhang [11], T.P.Fang [12], Klein [13] On the other hand, surface triangulation in 3D. .. algorithm based on the computation of 2D Delaunay triangulation The method has proved the efficiency of computation The input data are structured in a sparse 3D -1- volume with a huge amount of 3D data points (that can reach several millions of points) Therefore, a fast search algorithm based on Delaunay triangulation is the central topic of this thesis Firstly an overview of existing algorithms for constructing... Triangulation Algorithm 2.2.1 Delaunay triangulation using a uniform grid T.P Fang [12] presented an algorithm based on Delaunay triangulation, providing a theoretical analysis and implementation details Their experience shows how to preprocess the data, how to set up an internal data structure based on a uniform grid; give a detail about the triangulation process Their algorithm has a number of robust features... This criterion must hold for all triangles in the triangulation if it is a Delaunay triangulation 2.1 Background Surface triangulation is fast, memory-efficient, and robust for mesh generating An optimal triangular surface is the best model for simulating its shape that approximates the initial model of that surface The research literature on meshing generation is vast and there are a lot of existing... compute a Delaunay triangulation of the 2D point cloud The algorithm start from the first Delaunay triangle 𝑇 which is created by a Delaunay edge and a neighboring point (i.e they are formed the first Delaunay triangle.) The next adjacent triangle 𝑇’ is created between an edge 𝑒𝑖 of 𝑇 and a neighboring point based on the voxel traversal search [1] within a rectangle on one side of 𝑒𝑖 At each step,... noisy and sparse data In geometric modeling, Surface triangulation [3] of a 3D object is a fast and efficient way to reconstruct such an approximating surface in the 3D space Hence, meshing a 3D point cloud has been widely studied in recent years The goal is to reconstruct a surface of triangular mesh from a given 3D point cloud, such that the triangular mesh must approximate the original shape of the... initial Constrained Delaunay triangulation of the polygonal domain of the trimmed parametric surface has to be computed Then further vertices are inserted into this triangulation until the corresponding triangulation of the surface approximates the surface itself with sufficient precision This is not the only application of the algorithm Polygonal domains in two dimensions can also be considered as planar... considerably faster than sweep-line algorithm by Fortune (1987) in all cases - 14 - 2.3 Three-dimensional Triangulations Algorithm Triangulation in three dimensions is called tetrahedralization (or tetra-hedrization) A tetrahedralization is a partition of the input domain, point set or polyhedron, into a collection of tetrahedral that meet only at shared faces (vertices, edges, or triangles) Tetrahedralization ... algorithms 2.2 2D Triangulation Algorithm 2.2.1 Delaunay triangulation using a uniform grid T.P Fang [12] presented an algorithm based on Delaunay triangulation, providing a theoretical analysis and implementation... are 3D point clouds structured in a sparse 3D volume The algorithm describes a triangulation of this surface based on Delaunay triangulation Delaunay triangulation is one of the most popular methods.. .MESHING A 3D POINT CLOUD OF AN ELEVATION SURFACE BASED ON 2D DELAUNAY TRIANGULATION In Partial Fulfillment of the Requirements of the Degree of MASTER OF INFORMATION TECHNOLOGY MANAGEMENT