You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.Point;
import flash.geom.Rectangle;
public class HelloVoronoi extends Sprite {
private var _points:Vector.<Point>;
private var _plotBounds:Rectangle;
private var _voronoi:Voronoi;
private var _segments:Vector.<LineSegment>;
public function HelloVoronoi() {
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(event:Event = null):void {
_points = new Vector.<Point>();
for (var i:uint = 0; i < 50; i++) {
var point:Point = new Point(Math.random() * stage.stageWidth, Math.random() * stage.stageHeight);
_points.push(point);
}
_plotBounds = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
_voronoi = new Voronoi(_points, null, _plotBounds);
_segments = _voronoi.voronoiDiagram();
for each (var segment:LineSegment in _segments) {
graphics.lineStyle(1, 0x000000, 1);
graphics.moveTo(segment.p0.x, segment.p0.y);
graphics.lineTo(segment.p1.x, segment.p1.y);
}
var regions:Vector.<Vector.<Point>> = _voronoi.regions();
}
}
}
TypeError: Error #1006: value is not a function.
at com.nodename.geom::Polygon/winding()
at com.nodename.Delaunay::Site/region()
at SiteList/regions()
at com.nodename.Delaunay::Voronoi/regions()
at HelloVoronoi/init()
at HelloVoronoi()
The text was updated successfully, but these errors were encountered:
When I call voronoi.regions in following code the error is thrown:
package {
import com.nodename.Delaunay.Voronoi;
import com.nodename.geom.LineSegment;
}
TypeError: Error #1006: value is not a function.
at com.nodename.geom::Polygon/winding()
at com.nodename.Delaunay::Site/region()
at SiteList/regions()
at com.nodename.Delaunay::Voronoi/regions()
at HelloVoronoi/init()
at HelloVoronoi()
The text was updated successfully, but these errors were encountered: