Re: [Jts-topo-suite-user] Delaunay Triangulation Snapping Tolerance
Brought to you by:
dr_jts
From: Brian S. R. <ji...@gm...> - 2013-12-04 20:54:29
|
Hi Martin, I tested triangulation in TestBuilder. I used DelaunayEdges with tolerance function. Yes, with 0 tolerance it works, but you can see a few triangles are across polygons on top. It means that constraint enforcement was not considered. In the testbuilder is it possible to run my own method to check results? On Wed, Dec 4, 2013 at 7:43 PM, Martin Davis <mtn...@gm...> wrote: > Installs by default with JTS. Run TestBuilder.bat in the JTS bin > directory. > > > On Wed, Dec 4, 2013 at 11:37 AM, Brian Sanjeewa Rupasinghe < > ji...@gm...> wrote: > >> Hi Martin >> >> I have not used TestBuilder. Any guide to install it in windows 7. >> >> >> On Wed, Dec 4, 2013 at 7:25 PM, Martin Davis <mtn...@gm...> wrote: >> >>> I don't think so... this looks very similar to the code that the >>> TestBuilder uses to run the ConformingDelaunayTriangulationBuilder. The >>> CDTB extracts all line segments from whatever geometry is provided as the >>> constraints. >>> >>> Try running your example in the TestBuilder and see if it works. Then >>> perhaps debug into both and see where they diverge. >>> >>> >>> >>> On Wed, Dec 4, 2013 at 10:31 AM, Brian Sanjeewa Rupasinghe < >>> ji...@gm...> wrote: >>> >>>> Hi, >>>> >>>> I used the following method for the triangulation. I use polygons as >>>> constraints as well. Input Geometry is multipoint of all polygon vertices. >>>> Then polygons are used as constraints in a GeometryCollection. Was it >>>> because i used polygon geometry itself as constraints rather than its line >>>> segments? >>>> >>>> public static Geometry TriangulationBuilder (MultiPoint mp, >>>> ArrayList<Geometry> alg, double tolerance) >>>> { >>>> GeometryFactory gf = new GeometryFactory(); >>>> ConformingDelaunayTriangulationBuilder cdtb = new >>>> ConformingDelaunayTriangulationBuilder(); >>>> //constriant geometry >>>> Geometry consegs = gf.buildGeometry(alg); >>>> //GeometryCollection g_cp = (GeometryCollection) >>>> gf.createGeometryCollection(als); >>>> //set sites for triangulation >>>> cdtb.setSites(mp); >>>> //set constraints >>>> cdtb.setConstraints(consegs); >>>> //set tolerance -0.00001 >>>> cdtb.setTolerance(tolerance); >>>> //Retrieving triangles >>>> Geometry Trigeom = cdtb.getTriangles(gf); >>>> return Trigeom; >>>> } >>>> >>>> >>>> >> > |