|
I enjoy SIS. Thank you. It is doing everything I need, but there is one feature I have yet to get my head around. How to resize a path object that was imported via objects_from_svg_file(). I've tried for a month, learned a lot, and re-size is a no-go. I've mostly focused around Transform. What I need to do is change variable Height/Width objects of various canvas sizes and viewport scales (embedded and not), into fixed sized (25mm x 25mm) objects. This is an example of what I am trying.... the transform correctly positions the XY origin, but resizing does not Modify Boxdef get_percentage_increase(num_a, num_b): Any help is greatly appreciated. Thank you, Dan |
Replies: 1 comment 1 reply
|
I see two mistakes in the preceding code. First, hx_y = 5should be hc_y = 5Second, in horse_cow_obj.transform ='translate(%s, %s), first= True' % (hc_x, hc_y)the horse_cow_obj.translate((hc_x, hc_y), first=True)If you're targeting 25mm × 25mm objects, see Unit conversions in the Simple Inkscape Scripting documentation and also the documentation for Inkscape's |
I see two mistakes in the preceding code. First,
should be
Second, in
the
transformmethod accepts either aninkex.Transformor a string that can be used to construct aninkex.Transform. Neither of those recognizefirst=True. You were probably thinking ofIf you're targeting 25mm × 25mm objects, see Unit conversions in the Simple Inkscape Scripting documentation and also the documentation for Inkscape's
inkex.unitsmodule. Those may facilitate targeting an absolute size.