Home › Forums › Nazca › Edge functions for a parallelogram? › Reply To: Edge functions for a parallelogram?
26 September 2020 at 09:39
#6250
Ronald
Keymaster
Dear lumico,
A paralellogram function as you describe can be defined along these lines:
def paralellogram(x=10, y=20, dy=None, y2=None):
if y2 is None:
y2 = y
if dy is None:
dy = 0.5 * (y - y2)
return [(0, 0), (x, dy), (x, y2+dy), (0, y)]
nd.Polygon(points=paralellogram(y2=2), layer=1).put()
nd.Polygon(points=paralellogram(dy=1, y2=5), layer=1).put(15)
nd.export_png()
Ronald