` //获得布尔运算后的全部曲线     function getOperatedCurves(sourceCurs: Curve[], targetCus: Curve[])     {         let source: Polyline | Circle = (sourceCurs[0] instanceof Circle) ? sourceCurs[0] as Circle : new Polyline().Combine(sourceCurs)[0];         let target: Polyline | Circle = (targetCus[0] instanceof Circle) ? targetCus[0] as Circle : new Polyline().Combine(targetCus)[0];         try         {             if (!source.IsClose || !target.IsClose) throw new Error("不是封闭曲线");         }         catch (err)         {             console.log(err);         }          let interPts = source.IntersectWith(target, IntersectOption.OnBothOperands);         let sourceContainerTarget = isTargetCurInSourceCur(source, target);         let targetContainerSource = isTargetCurInSourceCur(target, source);          let isContainer = sourceContainerTarget || targetContainerSource;         let intersectionList: Curve[] = [];  //交集         let unionList: Curve[] = []; //并集         let subList: Curve[] = []; //补集          /*         *两封闭区域有交点并且不是包含关系,则通过交点把区域分割         */         if (interPts.length && !isContainer)         {             let pars1 = interPts.map(p => source.GetParamAtPoint(p)).sort((a, b) => a - b);             let pars2 = interPts.map(p => target.GetParamAtPoint(p)).sort((a, b) => a - b);              let cus1: Array = source.GetSplitCurves(pars1);              cus1.forEach(pl =>             {                 if (isTargetCurInSourceCur(target, pl))                 {                     intersectionList.push(pl);                 }                 else                 {                     subList.push(pl);                     unionList.push(pl);                 }             })              let cus2: Array = target.GetSplitCurves(pars2);             cus2.forEach(pl =>             {                 if (isTargetCurInSourceCur(source, pl))                 {                     intersectionList.push(pl);                     subList.push(pl);                 }                 else                 {                     unionList.push(pl);                 }             })          }         else         {             if (isContainer)             {                 if (sourceContainerTarget)                 {                     intersectionList.push(target);                     subList.push(source, target);                     unionList.push(source);                 }                 else                 {                     unionList.push(target);                     intersectionList.push(source);                 }             }             else             {                 unionList.push(source, target)                 subList.push(source);             }          }         return {             intersectionList, unionList, subList         }     }`

` //获得布尔运算后的全部曲线     function getOperatedCurves(sourceCurs: Curve[], targetCus: Curve[])     {         let source: Polyline | Circle = (sourceCurs[0] instanceof Circle) ? sourceCurs[0] as Circle : new Polyline().Combine(sourceCurs)[0];         let target: Polyline | Circle = (targetCus[0] instanceof Circle) ? targetCus[0] as Circle : new Polyline().Combine(targetCus)[0];         try         {             if (!source.IsClose || !target.IsClose) throw new Error("不是封闭曲线");         }         catch (err)         {             console.log(err);         }          let interPts = source.IntersectWith(target, IntersectOption.OnBothOperands);         let sourceContainerTarget = isTargetCurInSourceCur(source, target);         let targetContainerSource = isTargetCurInSourceCur(target, source);          let isContainer = sourceContainerTarget || targetContainerSource;         let intersectionList: Curve[] = [];  //交集         let unionList: Curve[] = []; //并集         let subList: Curve[] = []; //补集          /*         *两封闭区域有交点并且不是包含关系,则通过交点把区域分割         */         if (interPts.length && !isContainer)         {             let pars1 = interPts.map(p => source.GetParamAtPoint(p)).sort((a, b) => a - b);             let pars2 = interPts.map(p => target.GetParamAtPoint(p)).sort((a, b) => a - b);              let cus1: Array = source.GetSplitCurves(pars1);              cus1.forEach(pl =>             {                 if (isTargetCurInSourceCur(target, pl))                 {                     intersectionList.push(pl);                 }                 else                 {                     subList.push(pl);                     unionList.push(pl);                 }             })              let cus2: Array = target.GetSplitCurves(pars2);             cus2.forEach(pl =>             {                 if (isTargetCurInSourceCur(source, pl))                 {                     intersectionList.push(pl);                     subList.push(pl);                 }                 else                 {                     unionList.push(pl);                 }             })          }         else         {             if (isContainer)             {                 if (sourceContainerTarget)                 {                     intersectionList.push(target);                     subList.push(source, target);                     unionList.push(source);                 }                 else                 {                     unionList.push(target);                     intersectionList.push(source);                 }             }             else             {                 unionList.push(source, target)                 subList.push(source);             }          }         return {             intersectionList, unionList, subList         }     }`