Page 1 of 1

Complete list points

Posted: Tue Apr 13, 2010 10:24 am
by tal
Hi,

I have a polygon defined with 10 points, but I want to have have all the points pixel by pixel ( 110,120 111,120, 112.....).
Have you an idea how I could make this?

Thanks

Re: Complete list points

Posted: Tue Apr 13, 2010 10:55 am
by Klaus
Hi Tal,

I have no idea what you want, but maybe getting/setting the points of a graphic is what you are after? :)
Check "points" in the docs (Rev Dictionary).


Best

Klaus

Re: Complete list points

Posted: Tue Apr 13, 2010 2:18 pm
by tal
Hi,
If you make

Code: Select all

 put the points of grc "test" 
, you will have a list of points....

But this list will not contain al the pixels, for example :

the result of the previous instruction for my polygon will be :

630,464
630,315
636,297
648,287


But my polygon does not contain only 4 points, i want to have the complete list and I wanted to know if there was an easy way to get this.

Thanks

Re: Complete list points

Posted: Tue Apr 13, 2010 2:23 pm
by FourthWorld
Are you referencing the correct object? In 12 years I've never seen a problem obtaining the points of a polygon.

Re: Complete list points

Posted: Tue Apr 13, 2010 2:55 pm
by bn
Hi tal,

if you want all the intermediate points, the ones between the corners of your list then you have to calculate them. What do you want to do with the points?
regards
Bernd

Re: Complete list points

Posted: Tue Apr 13, 2010 3:22 pm
by tal
Hi bn,

I want them cause I want to place an object on a specific point of the polygon :
- I have a group and I want to place an object on the border of the group, which can be a polygon or an oval , not only rectangle ( only the border, which delimitate the group)
- So I click on the group, and the object is placed in the nearest position in the border of the group.
- And then I can move the object I placed, but its move will be constrain to the points of the polygon.

Hope you understood what I explained

Thanks

Re: Complete list points

Posted: Tue Apr 13, 2010 5:56 pm
by bn
tal,
for the oval this stack by Jim James Hurley might be helpful (attached below). It constructs the points of an ellipse and lets you move an object manually along those points. There is no way to get the points of an oval from a Rev graphic, as far as I know.

for the polygons have a look at
http://forums.runrev.com/phpBB2/viewtop ... 68&p=20634
it is not exactly what you want but has some of the math you need.

let us know how it goes.
regards
Bernd

Edit: uploaded improved version of file

Re: Complete list points

Posted: Tue Apr 13, 2010 10:21 pm
by bn
tal,

I did a little stack that gives you all the intermediate points of a polygon graphic. It is attached below. Should do the trick. Not extensively tested. Tell us how it works.
regards
Bernd

Re: Complete list points

Posted: Wed Apr 14, 2010 5:47 pm
by tal
Thank you bn,

For the eclipse I have the error (divide by zero), but for your application it works good.

See you

Re: Complete list points

Posted: Wed Apr 14, 2010 6:10 pm
by bn
tal,

I uploaded an improved version of BallsOnAnEllipse in the original post. It should work now without initializing it by drawing the ellipse first.
The button "Draw Ellipse" contains the code that makes the actual ellipse, which is what interests you.
regards
Bernd