dr-geo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dr. Geo] Macro including scripts


From: Hilaire Fernandes
Subject: Re: [Dr. Geo] Macro including scripts
Date: Thu, 4 Nov 2021 23:18:57 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

Rafael,

A script is self sufficient, it is entirely defined by code, so it does not depend on other object in its construction process. I relax a bit the macro-construction validity check so that a script can appear in the tree of a macro-construction, but when it is an output parameters of the macro, the macro-construction tree can not be built. I think that's why it does not work. You can check the DrGMacro & al.

I write this from memory without checking the code. I wrote this code may be 15 years ago.

Hilaire

Le 04/11/2021 à 22:07, Rafael Luque a écrit :
Thank you Hilaire.

I think my misunderstanding is related to the way the construction path is searched. My thought was that as the script receives the segment as input and the segment is built using the points, then the macro could find the path between the points and the script.

What is the code I should read to understand the details of macro-construction?

Thank you.

El jue, 4 nov 2021 a las 19:26, Hilaire Fernandes (<hilaire@drgeo.eu <mailto:hilaire@drgeo.eu>>) escribió:

    Hum,

    DrGeo should not have validate this macro construction because
    there are no construction dependencies between the resulting
    script and the initial two points.

    You see, when constructing the macro-construction, DrGeo searches 
    for the construction path from the input parameters to the output
    results. And obviously, in your example there is no path, from the
    two point and the script, so the intermediate segment is not
    constructed.

    The macro-construction was accepted because I relaxed a bit the
    macro-construction process to allow non-independent object, as the
    script, to be part of the macro-construction. That's something I
    should take a look at.

    Hilaire

    Le 04/11/2021 à 19:14, Rafael Luque a écrit :
    Good hint, Kilaire.

    I've tried with 2 points, the segment between them and the script to mark
    that segment (see the attached image). The macro defined takes the 2 points
    as inputs and the script result as its output.

    When I execute the macro I get an error at "DrGeoScript64504876>>compute"
    because "#style was sent to nil" (see also the attached image).

    Maybe I don't understand something about macro construction in DrGeo.

    Thank you.

-- GNU Dr. Geo
    http://drgeo.eu  <http://drgeo.eu>
    http://blog.drgeo.eu  <http://blog.drgeo.eu>

--
GNU Dr. Geo
http://drgeo.eu
http://blog.drgeo.eu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]