Ejemplo n.º 1
0
 public OffsetPoly(Vector2[] poly, float distance = 0, bool debug = false)
 {
     _debug     = debug;
     _direction = distance > 0 ? _direction = 1 : _direction = -1;
     _core      = new OffsetPolyCore();
     _core.LiveDebug(debug);
     _core.maxOffset             = distance;
     _core.calculateInteractions = false;
     _core.Init(poly);
     _core.OnFlipEvent     += OnFlip;
     _core.OnSplitEvent    += OnSplit;
     _core.OnMergedEvent   += OnMerged;
     _core.OnCompleteEvent += OnComplete;
     _core.OnErrorEvent    += OnError;
 }
Ejemplo n.º 2
0
 public OffsetSkeleton(Vector2[] poly, bool[] gables = null, float distance = 0, bool debug = false)
 {
     nodeTris.Clear();
     _debug = debug;
     if (direction == 0)
     {
         direction = -1;
     }
     _core = new OffsetPolyCore();
     _core.LiveDebug(debug);
     _core.maxOffset             = distance;
     _core.percentAccuracy       = percentAccuracy;
     _core.calculateInteractions = true;
     _core.Init(poly, gables);
     _core.OnFlipEvent     += OnFlip;
     _core.OnSplitEvent    += OnSplit;
     _core.OnMergedEvent   += OnMerged;
     _core.OnCompleteEvent += OnComplete;
     _core.OnErrorEvent    += OnError;
 }