Example #1
0
        private void Create()
        {
            if (_subdiv != null)
            {
                return;
            }

            Envelope siteEnv = DelaunayTriangulationBuilder.Envelope(_siteCoords);

            _diagramEnv = siteEnv;
            // add a buffer around the final envelope
            double expandBy = Math.Max(_diagramEnv.Width, _diagramEnv.Height);

            _diagramEnv.ExpandBy(expandBy);
            if (_clipEnv != null)
            {
                _diagramEnv.ExpandToInclude(_clipEnv);
            }

            var vertices = DelaunayTriangulationBuilder.ToVertices(_siteCoords);

            _subdiv = new QuadEdgeSubdivision(siteEnv, _tolerance);
            IncrementalDelaunayTriangulator triangulator = new IncrementalDelaunayTriangulator(_subdiv);

            triangulator.InsertSites(vertices);
        }
Example #2
0
        // ==================================================================

        /// <summary>
        /// Computes the Delaunay triangulation of the initial sites.
        /// </summary>
        public void FormInitialDelaunay()
        {
            ComputeBoundingBox();
            _subdiv = new QuadEdgeSubdivision(_computeAreaEnv, _tolerance);
            _subdiv.SetLocator(new LastFoundQuadEdgeLocator(_subdiv));
            _incDel = new IncrementalDelaunayTriangulator(_subdiv);
            InsertSites(_initialVertices);
        }
        private void Create()
        {
            if (_subdiv != null)
            {
                return;
            }

            var siteEnv  = Envelope(_siteCoords);
            var vertices = ToVertices(_siteCoords);

            _subdiv = new QuadEdgeSubdivision(siteEnv, _tolerance);
            IncrementalDelaunayTriangulator triangulator = new IncrementalDelaunayTriangulator(_subdiv);

            triangulator.InsertSites(vertices);
        }