     }
     
     public var boundary : Rect {
-        if rotate == 0 && scale == 1 && baseTransform == SDTransform.Identity() {
-            return originalBoundary
-        }
-        let transform = self.transform
-        if transform == SDTransform.Identity() {
-            return originalBoundary
-        }
         if cache.boundary == nil {
-            var bound: Rect? = nil
-            self.apply { commands, state in
-                switch commands {
-                case let .line(p1): bound = bound?.union(Rect.bound([state.last * transform, p1 * transform])) ?? Rect.bound([state.last * transform, p1 * transform])
-                case let .quad(p1, p2): bound = bound?.union(QuadBezierBound(state.last, p1, p2, transform)) ?? QuadBezierBound(state.last, p1, p2, transform)
-                case let .cubic(p1, p2, p3): bound = bound?.union(CubicBezierBound(state.last, p1, p2, p3, transform)) ?? CubicBezierBound(state.last, p1, p2, p3, transform)
-                default: break
-                }
-            }
-            cache.boundary = bound ?? Rect()
+            cache.boundary = identity.originalBoundary
         }
         return cache.boundary!
     }

            }
        }
    }
    
    public init() {
        self.commands = []


extension Shape {
    
    public var identity : Shape {
        if rotate == 0 && scale == 1 && baseTransform == SDTransform.Identity() {
            return self
        }
        if cache.identity == nil {
            let transform = self.transform
            if transform == SDTransform.Identity() {
                let _path = Shape(self.commands)
                _path.cache.originalBoundary = cache.originalBoundary
                _path.cache.boundary = cache.boundary
                _path.cache.area = cache.area
                cache.identity = _path
            } else {
                var _path = Shape()
                _path.reserveCapacity(self.commands.count)
                for command in self.commands {
                    switch command {
                    case let .move(point): _path.commands.append(.move(point * transform))
                    case let .line(point): _path.commands.append(.line(point * transform))
                    case let .quad(p1, p2): _path.commands.append(.quad(p1 * transform, p2 * transform))
                    case let .cubic(p1, p2, p3): _path.commands.append(.cubic(p1 * transform, p2 * transform, p3 * transform))
                    case .close: _path.commands.append(.close)
                    }
                }
                cache.identity = _path
            }
        }
        return cache.identity!
    }
