cduck/drawsvg

how to move the drawSvg.elements integrally

Closed this issue · 1 comments

Discussed in #72

Originally posted by lythhh April 9, 2022
I make a simple drawSvg.elements(a triangle), what i want to do is to move the triangle a certain distance, and finally form a series of ordered triangles. So i want to konw is there any function can help me? Thank you very much
the code is as follows:
import drawSvg as draw
def mm2pt(x):
return 2.835x
dw=mm2pt(3)
dh=mm2pt(3)
d = draw.Drawing(dw, dh, origin=(0, 0), displayInline=False)
r = draw.Lines(dw/4,dh/4,dw/4
3,dh/4,dw/2,dh/4*3,close=True,fill='none',stroke='black',stroke_width=mm2pt(0.1))
r.appendTitle("角砾")
d.append(r)
d.setPixelScale(5)
d
#def move(drawSvg,w,h): #i want to construct a function with a drawSvg object and certain distance on x and y, to realize the movement of drawSvg objects.
1

cduck commented

Please do not double-post. GitHub issues are to let me know potential problems with the library and discussions are for questions.