import shapely.geometry as sg
from foldable_robotics.layer import Layer
from foldable_robotics.laminate import Laminate
a = sg.Point(0,0)
a

svg

b = sg.box(0,0,1,1)
b

svg

c = Layer(b)
c

svg

c.translate(.5,.5)

svg

c|(c.translate(.5,.5))

svg

c.union((c.translate(.5,.5)))

svg

d = Layer(a.buffer(.25))
d

svg

e = c-d.translate(.5,.5)
e

svg

import foldable_robotics
foldable_robotics.resolution=4
e.dilate(.2)

svg

e.erode(.1)

svg

e.plot()

png

e.erode(.1).plot()

png

list(b.centroid.coords)
[(0.5, 0.5)]
d.bounding_box().plot()
d.plot()

png

e<<(.1)

svg

e>>.1

svg

f = Laminate(e<<.1,e, e>>.1)
f

svg

g = [1,2,3]
g
[1, 2, 3]
g[::-1]
[3, 2, 1]
f[0]

svg

f[1]

svg

f[2]

svg

f[::-1]

svg

len(f+f)
6
[1,2,3]+[4,5,6]
[1, 2, 3, 4, 5, 6]
f<<.1

svg

g = f.rotate(30)
g

svg

h = g.translate(.5,.5)
h

svg

f|h

svg

f&h

svg

f.symmetric_difference(h)

svg

import foldable_robotics.manufacturing as fm
k  = fm.unary_union(f)
k

svg

l = (k<<.2).bounding_box()
m = Laminate(l,l,l)
m

svg

n = m-f
n

svg

# this can kill jupyter so do it last in your script or comment it out
f.plot_3d()
An exception has occurred, use %tb to see the full traceback.


SystemExit: 0



C:\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py:3445: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.
  warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)