Kaynağa Gözat

added sketch2PNG

Gilbert Brault 5 yıl önce
ebeveyn
işleme
f382c67fa2

Dosya farkı çok büyük olduğundan ihmal edildi
+ 288 - 12
notebooks/.ipynb_checkpoints/DryFriction-checkpoint.ipynb


BIN
notebooks/.ipynb_checkpoints/dryfriction-checkpoint.png


Dosya farkı çok büyük olduğundan ihmal edildi
+ 219 - 8
notebooks/.ipynb_checkpoints/test-checkpoint.ipynb


Dosya farkı çok büyük olduğundan ihmal edildi
+ 288 - 12
notebooks/DryFriction.ipynb


BIN
notebooks/dryfriction.png


Dosya farkı çok büyük olduğundan ihmal edildi
+ 102 - 0
notebooks/test.ipynb


+ 7 - 0
pysketcher/shapes.py

@@ -15,6 +15,7 @@ import pprint, copy, glob, os
 from math import radians
 from io import BytesIO
 from ruamel.yaml import YAML
+from PIL import Image
 
 from .MatplotlibDraw import MatplotlibDraw
 drawing_tool = MatplotlibDraw()
@@ -24,6 +25,12 @@ def sketch2SVG():
     drawing_tool.mpl.savefig(f, format="svg")
     return f.getvalue()
 
+def sketch2PNG():
+    f = BytesIO()
+    drawing_tool.mpl.gcf().canvas.print_png(f)
+    img = Image.open(f)
+    return img
+
 def sketchParse(sketch, container):
     yaml = YAML()
     gwd = yaml.load(sketch)