Polygons revisited

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10416
Joined: Fri Feb 19, 2010 10:17 am

Polygons revisited

Post by richmond62 »

Sorry, Happy people: been dead busy for a while so missed to comment on the recent thread over on the Use-List
re the possibility of polygons that look like this:
-
Polywog.png
-
Sad to tell, that's a fake, and a bad fake at that as it was made using GIMP.

As far as I can work out for this sort of thing to be possible each vertex of a polygon has to be a separate object and
have its own property profile, so a graphic object with this sort of possibility would have to be be a composite object in a similar way
that a dataGrid is.
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10416
Joined: Fri Feb 19, 2010 10:17 am

Re: Polygons revisited

Post by richmond62 »

polygonQ.png
-
I would be most grateful if someone could explain what these bits are.
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10416
Joined: Fri Feb 19, 2010 10:17 am

Re: Polygons revisited

Post by richmond62 »

Markers.png
Markers.png (7.45 KiB) Viewed 3625 times
-
What is the point of those?
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10502
Joined: Wed May 06, 2009 2:28 pm

Re: Polygons revisited

Post by dunbarx »

If you have a regular polygon, that grc has no points, though it has effective points. So do this.

1- Make a regular polygon.

2- Make a polygon grc.

3 - Set the points of the polygon to the effective points of the regular.

4- Lose the regular.

5- In the inspector for the poly, place a blank line after every TWO lines of the points, so that you get something like this:

Code: Select all

294,167
244,252

146,252
96,167

146,82
244,82

294,167
Craig
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10502
Joined: Wed May 06, 2009 2:28 pm

Re: Polygons revisited

Post by dunbarx »

Well, one should not be too clever or cavalier. It turns out that one cannot easily color the interior of a polygon graphic if it has blank lines in its list of points.

I suppose one could alway underlay a "regular" polygon, perhaps the very one used to create the polygon graphic, instead of losing it, and color that:
Screen Shot 2021-04-06 at 4.26.47 PM.png
Screen Shot 2021-04-06 at 4.26.47 PM.png (6.78 KiB) Viewed 3581 times
My first one, Richmond. You were right to direct me down that path. :wink:

Craig
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10416
Joined: Fri Feb 19, 2010 10:17 am

Re: Polygons revisited

Post by richmond62 »

All graphic objects in LiveCode have a bounding rectangle, and that may be part of the problem
aas what they need are for their vertices to be their boundaries, and then the possibility for
each vertex to be set as visible or invisible, and the 'fill' of a graphic object not to depend
on the visibility of individual vertices.
Post Reply