intersection of lists of lines, in a tool

lohabithi shared this question 1 year ago
Answered

Hello, I am trying to make a tool for tracing funicular lines from a list of forces, with minimum clicking (minimum hand work).

For this I need to solve the following problem:

Here L_1 and L_2 are 2 lists of lines of equal length.

The following command returns a list of intersections of each line of L_1 with each line of L_2:Zip(Intersect(a, b), a, L_2, b, L_1)

It works fine.

However, when I try to make it into a tool, no error message appears, but the result is invariably a list of undefined points!

I am able to give a list of lines as a parameter to a tool, for example for making a translation. I am also able to give a list of coordinates (lists of numbers), then make the lines, but strangely the intersection does not seem to work when done within a tool!

Can anyone help me?

Best Answer
photo

generally the input of tool must be free object and the output descendant of them. so the input list of a tool must be defined without ascendant like in tools of attached

test it

Files: foro.ggb

Comments (3)

photo
1

generally the input of tool must be free object and the output descendant of them. so the input list of a tool must be defined without ascendant like in tools of attached

test it

Files: foro.ggb
photo
1

Wonderful! Thank you so much, especially for such a quick answer.

I opened your tool, which works fine, and I find exactly my definition.

I then opened my tool, and although the definition is also the same, it applies on empty lists! No objects are present!


Now I remember that this is a problem that happened to me earlier: A custom tool should be defined with free objects as inputs, After definition it can be applied to linked objects as required.

Thanks again,

Laurent

photo
1

OK, finally I probably understood in more details. In your tool definition you have defined the lists of lines as lists of equations. Therefore you have "forced" the tool to accept lists as input, so to say.

But in my attempts, I always defined the lines from points, then I put them in lists, and the tool wizard suggested the points as inputs, not the lists. It was possible to remove the points from the input list and put the lists instead, and there was no error message, but still it didn't work as the lists where systematically empty.

Finally I did like you did, I defined lists of lines by the list of their equations, and now the tool works.

I suggest to the developers that if possible in the future, allowing some more freedom in defining the inputs in custom tools, would be very welcome! Or, if it is too difficult, maybe some error message if the tool wizard eventually finds an input as a non-existent object, even after it has accepted it in principle.

photo
© 2019 International GeoGebra Institute