         return breakLoop(intersects.filter { !$0.0.almostEqual($0.1) })
     }
     
-    fileprivate func breakLoop(_ points: [(ConstructiveSolidResult.Table.Split, ConstructiveSolidResult.Table.Split)]) -> [ShapeRegion.Solid] {
+    fileprivate func breakLoop(_ points: [(ConstructiveSolidResult.Split, ConstructiveSolidResult.Split)]) -> [ShapeRegion.Solid] {
         
         if points.count == 0 {
             return Array(OptionOneCollection(ShapeRegion.Solid(segments: self.bezier)))

        }
    }
    
    private func createSegments(_ other: Shape.Component, _ graph: Graph<Int, [(ConstructiveSolidResult.Table.`Type`, ConstructiveSolidResult.Table.Split, ConstructiveSolidResult.Table.Split)]>) -> [ShapeRegion.Solid] {
        
        var result: [ShapeRegion.Solid] = []
        
        var graph = graph
        
        for node in graph.nodes {
            if let splits = graph[from: node, to: node] {
                for split in splits {
                    switch split.0 {
                    case .left: result.append(contentsOf: OptionOneCollection(ShapeRegion.Solid(segments: self.splitPath(split.1, split.2))))
                    case .right: result.append(contentsOf: OptionOneCollection(ShapeRegion.Solid(segments: other.splitPath(split.1, split.2))))
                    }
                }
                graph[from: node, to: node] = nil
            }
        }
        while let graph_first = graph.first {
            
            var path = [graph_first.from, graph_first.to]
            var flag = [(0, graph_first.2[0].0)]
            
            while let last = path.last, let node = graph.nodes(from: last).first(where: { $0.1.contains { $0.0 != flag.last!.1 } }) ?? graph.nodes(from: last).first {
                let segments_idx = node.1.index(where: { $0.0 != flag.last!.1 }) ?? 0
                if let i = path.index(where: { $0 == node.0 }) {
                    let loop = path.suffix(from: i)
                    var segments: [ShapeRegion.Solid.Segment] = []
                    for ((_idx, _), (left, right)) in zip(flag.suffix(loop.count).appended((segments_idx, node.1[segments_idx].0)), loop.rotateZip()) {
                        if var splits = graph[from: left, to: right] {
                            let split = splits[_idx]
                            switch split.0 {
                            case .left: segments.append(contentsOf: self.splitPath(split.1, split.2))
                            case .right: segments.append(contentsOf: other.splitPath(split.1, split.2))
                            }
                            splits.remove(at: _idx)
                            graph[from: left, to: right] = splits.count == 0 ? nil : splits
                        }
                    }
                    result.append(contentsOf: OptionOneCollection(ShapeRegion.Solid(segments: segments)))
                    if i == 0 {
                        break
                    }
                    let range = path.index(after: i)..<path.endIndex
                    path.removeSubrange(range)
                    flag.removeLast(range.count)
                } else {
                    path.append(node.0)
                    flag.append((segments_idx, node.1[segments_idx].0))
                }
            }
        }
        
        return result

            return
        }
        
        let _l_list = data.enumerated().sorted { $0.1.left.ordering($1.1.left) }
        let _r_list = data.enumerated().sorted { $0.1.right.ordering($1.1.right) }
        
        print("\n\nConstructiveSolidResult.Table")
        
        print(_l_list.map { $0.0 })
        
        if var s0 = _l_list.first {
            var first_index = s0.0
            var first_winding = false
            var winding: Bool?
            var flag = true
            for (t0, t1) in _l_list.rotateZip() where !overlaps_index.contains(where: { t0.1.right.ordering(t1.1.right) ? $0 == t0.1.left.index && $1 == t0.1.right.index : $0 == t1.1.left.index && $1 == t1.1.right.index }) {
                let point = left.bezier[t0.1.left.index].point(t0.1.left.index == t1.1.left.index ? 0.5 * (t0.1.left.split + t1.1.left.split) : 0.5 * (t0.1.left.split + 1))
                let _winding = right.winding(point) != 0
                print(t0.0, t1.0, _winding, s0.0, winding)
                if winding == nil {
                    first_index = t0.0
                    first_winding = _winding
                    winding = _winding
                } else if winding != _winding {
                    l_graph[from: s0.0, to: t0.0] = (s0.1.left, t0.1.left)
                    winding = _winding
                    s0 = t0
                    flag = false
                }
                if t1.0 == first_index {
                    if first_winding == _winding {
                        let (end_index, (_, t1)) = l_graph.nodes(from: first_index).first!
                        l_graph[from: first_index, to: end_index] = nil
                        l_graph[from: s0.0, to: end_index] = (s0.1.left, t1)
                    } else {
                        l_graph[from: s0.0, to: t1.0] = (s0.1.left, t1.1.left)
                    }
                }
            }
            
            if flag {
                l_graph.removeAll()
                if left._contains(right, hint: Set(0..<right.count).subtracting(overlap_r_index)) {
                    overlap = .superset
                } else if right._contains(left, hint: Set(0..<left.count).subtracting(overlap_l_index)) {
                    overlap = .subset
                }
                return
            }
        }
        
        print(_r_list.map { $0.0 })
        
        if var s0 = _r_list.first {
            var first_index = s0.0
            var first_winding = false
            var winding: Bool?
            for (t0, t1) in _r_list.rotateZip() where !overlaps_index.contains(where: { t0.1.left.ordering(t1.1.left) ? $0 == t0.1.left.index && $1 == t0.1.right.index : $0 == t1.1.left.index && $1 == t1.1.right.index }) {
                let point = right.bezier[t0.1.right.index].point(t0.1.right.index == t1.1.right.index ? 0.5 * (t0.1.right.split + t1.1.right.split) : 0.5 * (t0.1.right.split + 1))
                let _winding = left.winding(point) != 0
                print(t0.0, t1.0, _winding, s0.0, winding)
                if winding == nil {
                    first_index = t0.0
                    first_winding = _winding
                    winding = _winding
                } else if winding != _winding {
                    r_graph[from: s0.0, to: t0.0] = (s0.1.right, t0.1.right)
                    winding = _winding
                    s0 = t0
                }
                if t1.0 == first_index {
                    if first_winding == _winding {
                        let (end_index, (_, t1)) = r_graph.nodes(from: first_index).first!
                        r_graph[from: first_index, to: end_index] = nil
                        r_graph[from: s0.0, to: end_index] = (s0.1.right, t1)
                    } else {
                        r_graph[from: s0.0, to: t1.0] = (s0.1.right, t1.1.right)
                    }
                }
            }
        }
    }
}

extension ConstructiveSolidResult.Split {
    
    fileprivate func almostEqual(_ other: ConstructiveSolidResult.Split) -> Bool {
        return self.index == other.index && self.split.almostEqual(other.split)
    }
    
    fileprivate func ordering(_ other: ConstructiveSolidResult.Split) -> Bool {
        return (self.index, self.split) < (other.index, other.split)
    }
}

extension Shape.Component {
    
    fileprivate func splitPath(_ start: ConstructiveSolidResult.Split, _ end: ConstructiveSolidResult.Split) -> [ShapeRegion.Solid.Segment] {
        
        if start.index == end.index && start.split.almostEqual(end.split) {
            return []
