Round Vector vertex coordinates? - RealWorld forums

Log-in or register.

Round Vector vertex coordinates?

This would create smooth edges
Mikey Z
on November 3rd 2013

Hey, would it be possible to make a script that would modify all the coordinates of vector vertexes, and round them to the nearest whole number? The idea would be to make the edges line up and make things line up. Is there a way to do this?

... and now that I mention it, what if there was a plugin to make this happen live while adjusting the vector tools? To make them snap to the pixel grid?

Vlasta
on November 4th 2013

If you only want to round to a whole number, activating or deactivating and reactivating the Integral coordinates more should help.

If you wanted to change selected shape to snap to a custom grid (when a script is run), it should be possible via the VectorImage interface. The script would first need to use GetIDsFromState to access the selected shape and then use GetElementToolID to find out what kind of element it is (ellipse, rectangle, ...) and then read and analyze its parameters GetElementToolParams, change them and finally use ModifyElement to apply the changes. It will not be trivial.

Mikey Z
on November 6th 2013

The "integral" setting works for the raster images, but vector images seem to constantly run on the "arbitrary" setting. A glitch?

And I hardly understand the part about scripting, but that's just me being relatively new to coding. And you think it's not trivial... whoo, that's hard to wrap my head around.

Oh, and on the page about VectorImage interface, the Interface Wrapper link is dead.

Page views: 2492       Posts: 3      
What about ICL files?
Select background
I wish there were...