Complete list points
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Complete list points
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
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
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
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
Hi,
If you make, 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
If you make
Code: Select all
put the points of grc "test"
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
-
- VIP Livecode Opensource Backer
- Posts: 10058
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Complete list points
Are you referencing the correct object? In 12 years I've never seen a problem obtaining the points of a polygon.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Complete list points
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
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
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
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
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
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
- Attachments
-
- BallsOnAnEllipse.rev.zip
- (5.56 KiB) Downloaded 403 times
Last edited by bn on Wed Apr 14, 2010 6:07 pm, edited 1 time in total.
Re: Complete list points
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
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
- Attachments
-
- calculate points of polygon.rev.zip
- (4.85 KiB) Downloaded 386 times
Re: Complete list points
Thank you bn,
For the eclipse I have the error (divide by zero), but for your application it works good.
See you
For the eclipse I have the error (divide by zero), but for your application it works good.
See you
Re: Complete list points
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
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