cdelker / schemdraw

MIT License
103 stars 20 forks source link

Add .scalex() and .scaley() (feature request) #25

Closed pozitron57 closed 7 months ago

pozitron57 commented 7 months ago

Consider the Inductor2 element: image

I propose to add .scalex() method to stretch the element in x direction like so: image

and .scaley() to stretch in perpendicular direction: image

Other use cases: sometimes it is useful to show that two capacitors differ in plate area and/or distance between plates; .scalex and .scaley will be handy for that. Perhaps, it will be more semantic to use something like

d += elm.Capacitor(A=5, d=7)

(A for area and d for distance)

cdelker commented 7 months ago

Added in 40311edb6be70cd9ae8886e70627db23edb660f2.

pozitron57 commented 6 months ago

Added in 40311ed.

Thanks! I tested it a bit. As far as I understand, if scale, scalex and scaley are applied together, only the last option is used. I think it is sane when scale is mixed with scalex and/or scaley, but .scalex(3).scaley(2) can work together just fine.

cdelker commented 6 months ago

Yeah, one function overwrote the other. f507534cf95f0da1f051a2a87e65d37aee447f7c should fix it so both may be applied at the same time.