Page 1 of 1

How to scale grouped polygons?

Posted: Thu Mar 18, 2010 8:37 pm
by heyvern
I found I can import and translate vector graphics from another file format and use that as a thumbnail for a project manager application I am creating.

So basically the original application is a vector based animation program. I can read in the files and extract the vector data, convert it to RR "polygons" and redraw it to the screen as a group of polygon shapes. However what I am doing is converting to SVG and then converting SVG to RR. This works well for my project since I want the whole thing to be XML anyway.


Here's the issue:
The imported vector polygon "group" can't be scaled after the fact. I can ungroup until the individual shapes are editable but then I can't seem to "scale" all the items uniformly. Once they are grouped and I change the dimensions it only "crops" the area viewable. It doesn't actually scale the group. I am probably doing something wrong or missing something, but I just can't figure it out.

There is no real "scale" information in the file format I am importing, although I could extract and convert some size data based on the file format settings if I have to. It would be tricky and a pain in the arse. Each layer of the file format can have its own scale relative to the entire file. When I convert this vector information to SVG I am just using a scale of "1" which is 100%. However some files are HUGE because the layer is scaled relative the overall size.

What I would like to do is import as polygons and then at the end determine the scale of the group to fit a specific width/height so I can either view that image or use it as a thumbnail or preview at various sizes.

I have thought of "exporting" the vector group to an image inside the application so then it becomes a raster graphic and can be scaled. I will do that if there is not an easier way.

Re: How to scale grouped polygons?

Posted: Thu Mar 25, 2010 3:01 pm
by Mark
heyvern,

It is not clear to me, whether you want to do this manually or by script. Either way, you can just set the width and height of each polygon and reposition them.

Best,

Mark

Re: How to scale grouped polygons?

Posted: Fri Mar 26, 2010 12:56 am
by BvG
for freehand polygons, you can also multiply each of the items of the points by a given factor.