liuyuqi-dellpc 4 years ago
commit
48521bf988
5 changed files with 63 additions and 0 deletions
  1. 37 0
      README.md
  2. 26 0
      convert.py
  3. BIN
      example/WeUI.sketch
  4. BIN
      example/WeUI.xd
  5. 0 0
      requirements.txt

+ 37 - 0
README.md

@@ -0,0 +1,37 @@
+# xd2sketch
+
+Adobe xd convert to Sketch file.
+
+Adobe 公司推出 XD 与 sketch 抗衡,可以解析导入 sketch 文件,却只能保持 xd 源文件。xd 转 sketch 是刚需,目前有一个在线服务,转换需要美元支付,不太方便。为此开启本项目,实现 xd 文件转化为 sketch。
+
+
+## sketch 文件解析
+
+sketch 文件格式是开放的,官方文档: https://developer.sketch.com/file-format/
+
+```
+├─images
+├─pages
+└─previews
+```
+
+## xd 文件解析
+
+xd 的文件格式比较复杂。
+
+```
+├─artwork
+│  ├─artboard-025d8c29-33d5-473d-8658-c9dd691304d8
+│  │  └─graphics
+│  └─pasteboard
+│      └─graphics
+├─interactions
+├─META-INF
+├─renditions
+├─resources
+│  └─graphics
+└─sharing
+```
+
+
+

+ 26 - 0
convert.py

@@ -0,0 +1,26 @@
+import os, sys, re
+
+xd_file = r"example/WeUI.xd"
+sketch_file=r"example/WeUI.sketch"
+
+# 读取xd文件,其实就是zip格式,解压
+os.system("unzip " + xd_file)
+
+# 遍历解压文件夹
+
+for dir in os.listdir("xx"):
+    pass
+
+
+# 解析xd文件
+
+
+# 转换为sketch文件
+
+
+# 保存
+
+
+
+if __name__ == "__main__":
+    pass

BIN
example/WeUI.sketch


BIN
example/WeUI.xd


+ 0 - 0
requirements.txt