[Ipe-discuss] Position of a Mark

Otfried Cheong ipe at otfried.org
Sun Feb 11 20:55:32 CET 2024


When m is an object of type "Reference", then m:position() gives you the coordinates of the object's "reference point".  For marks, this is simply the position of the mark.

As usual, you'll have to transform this position by the object's matrix (in case it was moved or otherwise transformed), so the actual position of the point is:

m:matrix() * m:position()

Cheers,
Otfried

On Sun, Feb 11, 2024, at 20:48, Ernst Schrewe via Ipe-discuss wrote:
> Hi,
> I recently started to learn writing Ipelets with Lua. My ultimate goal
> is to be able to create an Ipelet that draws the visibility polygon for
> a given point
>
> https://en.wikipedia.org/wiki/Visibility_polygon
>
> The starting point would obviously be, that I place a selection of given
> polygons and one Mark on the canvas. The Mark represents the point, from
> which the visibilty of the surrounding areas shall be calculated.
>
> And when my (future) Ipelet is launched, it should retrieve the
> coordinates of all these selected polygons and the Mark and then do the
> calculations, etc.
>
>
> But I am currently struggling with retrieving the coordinates of a Mark
> from within a purely Lua-based Ipelet.
>
> Apparently a Mark has a designated type "reference" in Lua. The manual
> states that this data type is quite different from regular path objects,
> but unfortunately does not go into further details.
>
> I would be very grateful for any hints or advice on what attributes
> and/or methods can be utilised on this kind of data type.
>
> Thanks in advance and
>
> best regards
>
> Ernst
>
>
> _______________________________________________
> Ipe-discuss mailing list
> Ipe-discuss at lists.science.uu.nl
> https://mailman.science.uu.nl/mailman/listinfo/ipe-discuss


More information about the Ipe-discuss mailing list