Package toxi.geom.mesh2d

Examples of toxi.geom.mesh2d.Voronoi.addPoint()


        // a Voronoi diagram relies on a Delaunay triangulation behind the
        // scenes
        Voronoi voronoi = new Voronoi(rootSize);
        // add perimeter points
        for (Vec2D v : poly.vertices) {
            voronoi.addPoint(v);
        }
        // add random inliers
        for (Vec2D v : createInsidePoints(poly, bounds)) {
            voronoi.addPoint(v);
        }
View Full Code Here


        for (Vec2D v : poly.vertices) {
            voronoi.addPoint(v);
        }
        // add random inliers
        for (Vec2D v : createInsidePoints(poly, bounds)) {
            voronoi.addPoint(v);
        }
        // get filtered delaunay triangles:
        // ignore any triangles which share a vertex with the initial root
        // triangle or whose centroid is outside the polygon
        for (Triangle2D t : voronoi.getTriangles()) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.