         }
         return ["type": "Path", "segments": pathSegments]
     }
-    
-    convenience init(dictionary: [String:Any]) {
-        guard let array = dictionary["segments"] as? [[String:Any]] else { self.init(); return }
-        var pathSegments = [PathSegment]()
-        for dict in array {
-            pathSegments.append(PathSegment(dictionary: dict))
-        }
-        self.init(segments: pathSegments)
-    }
-}
+}
+
+extension Polygon: Serializable {
+    
+    func toDictionary() -> [String:Any] {
+        return ["type": "Polygon", "points": points]
+    }
+}
+
+extension Polyline: Serializable {
+    
+    func toDictionary() -> [String:Any] {
+        return ["type": "Polyline", "points": points]
+    }
+}
+
+extension Rect: Serializable {
+    
+    func toDictionary() -> [String:Any] {
+        return ["type": "Rect", "x": x, "y": y, "w": w, "h": h]
+    }
+}
+
+extension RoundRect: Serializable {
+    
+    func toDictionary() -> [String:Any] {
+        return ["type": "RoundRect", "rect": rect.toDictionary(), "rx": rx, "ry": ry]
+    }
+}
+
+
 
 extension PathSegment: Serializable {
     

    func toDictionary() -> [String:Any] {
        return ["type": "Arc", "ellipse": ellipse.toDictionary(), "shift": shift, "extent": extent]
    }
    
    convenience init(dictionary: [String:Any]) {
        self.init(ellipse: Ellipse(dictionary: dictionary["ellipse"] as? [String : Any] ?? [:]),
                  shift: parse(dictionary["shift"]),
                  extent: parse(dictionary["extent"]))
    }
}

extension Circle: Serializable {

        return result
    }
    
    convenience init(dictionary: [String:Any]) {
        
        let locusDict = dictionary["form"] as! [String:Any]
        let locus = LocusSerializer().instance(dictionary: locusDict)
        
        self.init(form: locus)
        
        if let fillDict = dictionary["fill"] as? [String:Any], let fillType = fillDict["type"] as? String, fillType == "Color" {
