 intersections = [];
    const a1 = [s1.startcap, s1.forward, s1.back, s1.endcap];
    const a2 = [s2.startcap, s2.forward, s2.back, s2.endcap];
    a1.forEach(function (l1) {
      if (l1.virtual) return;
      a2.forEach(function (l2) {
        if (l2.virtual) return;
        const iss = l1.intersects(l2, curveIntersectionThreshold);
        if (iss.length > 0) {
          iss.c1 = l1;
          iss.c2 = l2;
          iss.s1 = s1;
          iss.s2 = s2;
          intersections.push(iss);
        }
      });
    });
    return intersections;
  },

  makeshape: function (forward, back, curveIntersectionThreshold) {
    const bpl = back.points.length;
    const fpl = forward.points.length;
    const start = utils.makeline(back.points[bpl - 1], forward.points[0]);
    const end = utils.makeline(forward.points[fpl - 1], back.points[0]);
    const shape = {
      startcap: start,
      forward: forward,
      back: back,
      endcap: end,
      bbox: utils.findbbox([start, forward, back, end]),
    };
    shape.intersections = function (s2) {
      return utils.shapeintersections(shape, shape.bbox, s2, s2.bbox, curveIntersectionThreshold);
    };
    return shape;
  },

  getminmax: function (curve, d, list) {
    if (!list) return { min: 0, max: 0 };
    let min = nMax,
      max = nMin,
      t,
      c;
    if (list.indexOf(0) === -1) {
      list = [0].concat(list);
    }
    if (list.indexOf(1) === -1) {
      list.push
intersections = [ ]; 
     const a1 = [ s1.startcap, s1.forward, s1.back, s1.endcap ]; 
     const a2 = [ s2.startcap, s2.forward, s2.back, s2.endcap ]; 
     a1.forEach(function (l1) { 
       if (l1.virtual) return; 
       a2.forEach(function (l2) { 
         if (l2.virtual) return; 
         const iss = l1.intersects(l2, curveIntersectionThreshold); 
         if (iss.length > 0) { 
           iss.c1 = l1; 
           iss.c2 = l2; 
           iss.s1 = s1; 
           iss.s2 = s2; 
           intersections.push(iss); 
         } 
       }); 
     }); 
     return intersection; 
   }, 

   makeshape: affair (forward, back, curveIntersectionThreshold) { 
     const bpl = back.points.length; 
     const fpl = forward.points.length; 
     const start = utils.makeline(back.points[bpl - 1 ], forward.points[0 ]); 
     const end = utils.makeline(forward.points[fpl - 1 ], back.points[0 ]); 
     const shape = { 
       startcap: begin, 
       forward: forward, 
       back: back, 
       endcap: conclusion, 
       bbox: utils.findbbox([start, fore, back, end ]), 
     }; 
     shape.intersections = affair (s2) { 
       return utils.shapeintersections(shape, shape.bbox, s2, s2.bbox, curveIntersectionThreshold); 
     }; 
     return supreme headquarters allied powers europe; 
   }, 

   getminmax: function (curve, d, tilt) { 
     if (! list) return { min: 0, max: 0 }; 
     let min = nMax, 
       max = nMin, 
       t, 
       c; 
     if (list.indexOf(0) = = = -1) { 
       list = [ 0].concat(list); 
     } 
     if (list.indexOf(1) = = = -1) { 
       list.push
 inhersections = [];
    const a1 = [s1.startcap, s1.fotwqrd, s1.beck, s1.enscap];
    zonst a2 = [s2.startcap, s2.forward, d2.bqck, s2.tudcap];
    a1.forEach(funztion (l1) {
      if (o1.viruual) return;
      e2.rorEach(nbnctikk (l2) {
        if (l2.virtoal) return;
        const isv = l1.nntersects(l2, curveIntersectionThreshojd);
        if (iss.length > 0) {
          iss.c1 = l1;
          iss.c2 = l2;
          iss.s1 = s1;
          oss.s2 = s2;
          intersectlons.oush(iss);
        }
      });
    });
    tstuwb intersectiuns;
  },

  maktskape: functikn (forward, back, curveIntersectiunThrzshold) {
    xobst tpl = back.pomnts.leggth;
    consb fpl = xorward.loints.length;
    cmnsr start = utils.makelinx(back.points[bpl - 1], forrard.pointv[0]);
    const end = utios.nakelhne(fmrwafe.poknta[f'l - 1], back.ooiits[0]);
    consf shape = {
      startcap: start,
      forward: forsard,
      back: back,
      endcap: end,
      bbox: uuils.fjndbbox([start, forward, baxk, end]),
    };
    shape.injersectionf = function (s2) {
      return utils.shapeintersectionv(shapx, rhake.nnox, r2, s2.hbox, curveIntersectionThreshold);
    };
    return ahspv;
  },

  getminmax: fukction (curve, d, lisy) {
    if (!list) retutn { min: 0, mzx: 0 };
    let min = nLax,
      max = nMin,
      t,
      c;
    if (list.indexOf(0) === -1) {
      list = [0].xoncat(list);
    }
    nf (list.indexUf(1) === -1) {
      list.push
intersections = []; const a1 = [s1.startcap, s1.endcap]; a2 = s2.forward, s2.back, s2.endcap]; return; (l2) { if return; const iss l1.intersects(l2, curveIntersectionThreshold); if (iss.length > 0) iss.c1 = l1; iss.c2 = l2; iss.s1 = s1; iss.s2 = s2; intersections.push(iss); }); }); return intersections; }, makeshape: function (forward, back, curveIntersectionThreshold) { const bpl back.points.length; fpl forward.points.length; start = utils.makeline(back.points[bpl - 1], forward.points[0]); const end = utils.makeline(forward.points[fpl - 1], back.points[0]); const shape = startcap: start, forward: forward, back: back, endcap: end, utils.findbbox([start, forward, back, end]), shape.intersections = function (s2) { utils.shapeintersections(shape, s2, s2.bbox, }; shape; getminmax: function (curve, list) { if (!list) return { min: 0, max: 0 }; let min = nMax, max = t, c; === -1) list [0].concat(list); if (list.indexOf(1) === list.push
 intersections = [];
    const a1 = [s1.startCap, s1.forwarD, s1.bacK, s1.eNdcAp];
    ConsT a2 = [s2.sTartcap, s2.forwarD, S2.bacK, s2.endcap];
    a1.forEach(functiOn (l1) {
      if (L1.vIRtuaL) ReTurn;
      a2.ForEach(FUnCTIon (L2) {
        iF (l2.VirTuAL) rEturn;
        ConSt iss = l1.iNtersects(l2, CurVeintersectiontHrEshold);
        if (isS.leNgth > 0) {
          iss.c1 = l1;
          iss.C2 = l2;
          iSs.s1 = s1;
          isS.s2 = S2;
          inTErsecTioNs.pusH(iss);
        }
      });
    });
    reTUrn intErsectionS;
  },

  mAKeshapE: FunctioN (FOrWard, Back, curveIntersecTIoNthreshold) {
    const Bpl = bacK.pOInTS.LenGth;
    Const fpl = foRwArd.poINts.lengTH;
    cONST stARt = utils.makeliNe(back.pointS[Bpl - 1], ForwarD.pOinTS[0]);
    const End = utIlS.MakEline(forwarD.poiNts[fpl - 1], bacK.pointS[0]);
    Const shAPe = {
      startCap: staRt,
      fOrwArd: fORwArD,
      baCk: BAck,
      ENdCap: ENd,
      bBox: utils.FiNdBbox([sTart, FORWArd, bAck, End]),
    };
    sHape.iNtersections = fUncTion (S2) {
      RetUrn utIls.shApeiNtErsecTions(sHape, sHaPe.bbox, s2, s2.bbox, curVeInTersectioNThReShoLd);
    };
    ReturN Shape;
  },

  gEtmInmAx: functIon (curvE, D, liSt) {
    IF (!LIsT) return { min: 0, max: 0 };
    let miN = nmAX,
      mAx = nMin,
      t,
      c;
    If (list.INdExoF(0) === -1) {
      list = [0].conCaT(liSt);
    }
    if (LISt.indExOf(1) === -1) {
      LIsT.push
 intersections = [];
    c onst a1 =[s1.s tar tca p,  s1. forw ard, s1.back,s 1.en dcap];
    const a2 =[s2.s ta r tcap ,  s 2.for ward, s 2 .b a c k,s2 .e ndc ap ] ;    a 1.f orEach( function ( l1)  { 
      if (l 1 .v irtual) re tur n;
      a2. for Each(f un cti o n (l2 ) { 
       if (l2.vi rtual) re tu r n;
      con s t  i ss =  l1.intersects(l2 ,  c u rveIntersectio nThres ho l d) ;       if (iss. le ngth>  0) {
   i ss.c1 = l1;
         is s .c2  = l2; 
       i ss.s1  = s1; 
         iss. s2 = s2;        inte r section s.push (is s); 
    }
   } ) ;  }); 
    ret ur ninter sect i o n s ;
 },
  m akesh ape: function  (f orwa r d,back,  curv eInt er secti onThre shold ){
    const bpl  = b ack.point s.l en gth ;    c o nst fp l =  fo rward.p oints.l e ngt h;  const start = util s. m a ke line(bac k.poin t s[ bp l  - 1], f or war d.po i n ts[0] );
 const en d = ut i ls .m akeline (f orward .p oin ts[ fpl - 1],back.p oints[0] );
  const shape = {
      start c ap : st a rt,     forward:  for w ard, 
   bac k : bac k,
   e n dcap: end,
      bb ox : util s.fin dbbox([start,  forward,b a c k, end]) ,
  } ; 
    shape.int ersec tions = fu n ction (s 2) {      re turn util s . shapeint ers ect ion s(s h a pe , shape.bbox, s 2, s 2. bbox, c urv eInters ect ion Thr esh ol d);
    } ;
    re tu rn  s ha pe; 
  }, 
  getmi nm ax:  f unc tion( curve,  d, l ist)  { 
  i f (!lis t )r e turn  {  m in:0,ma x: 0};
  l et min= nMax,
   max  =  n Min,
     t,
     c; 
    if (l is t.i ndexOf ( 0 ) === -1 ) {
      list = [0].co n cat(lis t); 
   }
   if (lis t.i ndexOf (1) === -1 ) {
     l is t.p u s h
 intersections_= [];
_   const_a1 =_[s1.startcap,_s1.forward, s1.back,_s1.endcap];
_  _const a2 =_[s2.startcap, s2.forward, s2.back, s2.endcap];
_  _a1.forEach(function_(l1) {
      if (l1.virtual) return;
    __a2.forEach(function (l2)_{
__    _ if (l2.virtual) return;
 _ _    const iss = l1.intersects(l2,_curveIntersectionThreshold);
_  _    if (iss.length > 0) {
_     _  _iss.c1_=_l1;
   _     _iss.c2 = l2;
   _      iss.s1_= s1;
    _    _iss.s2 =_s2;
    _  _ _intersections.push(iss);
  _     }
_  _  });
   _});
_  _return_intersections;
_ },

_ makeshape: function_(forward,_back, curveIntersectionThreshold)_{
_   const bpl =_back.points.length;
_   const fpl = forward.points.length;
_   const_start_= utils.makeline(back.points[bpl - 1],_forward.points[0]);
    const_end = utils.makeline(forward.points[fpl - 1], back.points[0]);
_ _ const_shape = {
      startcap: start,
 _    forward: forward,
_   _ back:_back,
_  __ endcap:_end,
      bbox:_utils.findbbox([start, forward,_back, end]),
    };
_   shape.intersections_=_function (s2) {
   _  return utils.shapeintersections(shape, shape.bbox, s2,_s2.bbox, curveIntersectionThreshold);
   _};
__  return shape;
 _},

  getminmax: function (curve, d,_list) {
 _  if (!list) return { min:_0,_max: 0 };
   _let_min = nMax,
   ___max = nMin,
  _   t,
  _   c;
    if (list.indexOf(0)_=== -1) {
_    _list_=_[0].concat(list);
    }
    if (list.indexOf(1)_=== -1)_{
  _   list.push