If memory serves the vertex adding gesture isn't an engine feature, but an IDE script. If you find the script you can add it into your stack with your own message trigger.richmond62 wrote: ↑Thu Jan 19, 2023 3:26 pmSuper! Thank you very much.If you click on a vertex while the option key is down you create a new vertex which you can drag to where you want.
I wonder if there is a way to fake the Option key being down so that would happen when an end user does a left-click
(i.e. standard mouse-click on a line)?
Tessellation
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 9856
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Tessellation
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
-
- VIP Livecode Opensource Backer
- Posts: 4027
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Tessellation
Richmond,
Here is a stack I made long ago which lets you insert a new vertex into a polygon.
You can paste a poligon and make sure it fits into the rectangle of an image.
Then activate "reshape" and click on "add point", the cursor changes and you click close to where you want to insert a new vertex.
It sometimes misplaces the new vertex because of the assumptions I have to make in code. (see script of the button "add Point".
I think it is easier to use the built-in function to add a vertex and drag it to the desired location. If I remember correctly it was not available at that time or I did not find out about it.
Please consider this "abandonware" since the built-in functions work a bit differently but better. Although even the built-in features have trouble at times to decide where to place the new vertex.
In LC there is a revreshapelibrary.livecodescript that contains much of the pertaining code; although there are also calls to revinternal apparently the engine helps a bit.
Kind regards
Bernd
Here is a stack I made long ago which lets you insert a new vertex into a polygon.
You can paste a poligon and make sure it fits into the rectangle of an image.
Then activate "reshape" and click on "add point", the cursor changes and you click close to where you want to insert a new vertex.
It sometimes misplaces the new vertex because of the assumptions I have to make in code. (see script of the button "add Point".
I think it is easier to use the built-in function to add a vertex and drag it to the desired location. If I remember correctly it was not available at that time or I did not find out about it.
Please consider this "abandonware" since the built-in functions work a bit differently but better. Although even the built-in features have trouble at times to decide where to place the new vertex.
In LC there is a revreshapelibrary.livecodescript that contains much of the pertaining code; although there are also calls to revinternal apparently the engine helps a bit.
Kind regards
Bernd
- Attachments
-
- add point to polygon.livecode.zip
- (12.08 KiB) Downloaded 65 times
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Tessellation
Easier to work with when rotated through 90 degrees:
- -
So the distance between the centres of the hexagons is 104 pixels.
Vertical displacement is ((cos (30)) * 104) = 90
Horizontal displacement is ((sin (30)) * 104) = 52
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Tessellation
All "very groovy", BUT, no good for these purposes as it does NOT constrain the graphics surface area to the size of the original hexagon.
Last edited by richmond62 on Fri Jan 20, 2023 1:56 pm, edited 2 times in total.
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Tessellation
1. Having chosen Reshape Graphic, what that did was DUPLICATE the graphic.If you click on a vertex while the option key is down you create a new vertex which you can drag to where you want.
2. Without choosing Reshape Graphic, what that did was DUPLICATE the graphic.
So, that's a busted flush unless something changed post LC 8.1.10.
Oh-Oh, wait a minute: I was clicking on a line . . .
- -
HOWEVER, the problem of surface area constraint still remains.
-
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Tessellation
That's marvellous, Bernd!
BUT, I am still faced with the surface area constraint problem.