             }
             start = end + 1
         }
-        assert(j == self.points.count * (self.points.count+1) / 2)
+        assert(j == c * (c+1) / 2)
         return q;
+
+    }
+    
+    func hull(_ t: BKFloat) -> [BKPoint] {
+        return CubicBezier.Hull(self.points, t)
     }
 
 

        return ret;
    }
    
    func hull(_ t: BKFloat) -> [BKPoint] {
        var q: [BKPoint] = [BKPoint](repeating: BKPointZero, count: self.points.count * (self.self.points.count+1) / 2)
        q[0..<self.points.count] = self.points[0..<self.points.count]
        
        // we lerp between all points (in-place), until we have 1 point left.
        var start: Int = 0
        var j = self.points.count
        for count in (1 ..< self.points.count).reversed()  {
            let end: Int = start + count
            for i in start ..< end {
                let pt = Utils.lerp(t,q[i],q[i+1])

            while found {
                found = false
                for t2 in stride(from: t1+step, through: 1.0+step, by: step) {
                    let segment = p1.split(from: t1, to: t2)
                    if segment.simple == false {
                        let t2 = t2 - step
                        if abs(t1-t2) < step {
                            // we can never form a reduction
                            return
                        }
                        let segment = p1.split(from: t1, to: t2)
                        let taggedSegment = TimeTaggedCurve(_t1: Utils.map(t1,0,1,p1._t1,p1._t2),
                                                            _t2: Utils.map(t2,0,1,p1._t1,p1._t2),
                                                            curve: segment)
