Intersection problem
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Intersection problem
I want to define the points of intersection of a black & white graphic and a line.
The intersection function only returns "yes" or "no" if an intersection occurs.
I need to find the exact points that the intersection(s) occur.
Any ideas?
Thanks,
Geoff
The intersection function only returns "yes" or "no" if an intersection occurs.
I need to find the exact points that the intersection(s) occur.
Any ideas?
Thanks,
Geoff
Re: Intersection problem
Well, mind you I only just woke up and aren't yet up to *thinking* level so this may or may not make sense to you.
I would take the brute force method and do it in a repeat loop. You'll have all the points of both lines, shove them into 2 different variables, pick the variable of your preference, and then something like (psuedo code) -
any coordinate from the graphic that is the same as a coordinate from the line should wind up in var3. Or I could just not be awake yet, like I said
I would take the brute force method and do it in a repeat loop. You'll have all the points of both lines, shove them into 2 different variables, pick the variable of your preference, and then something like (psuedo code) -
Code: Select all
set the itemDelimiter to comma
repeat for each item x in var1
if x is among the items of var2 then put x into var3
end repeat
Last edited by bogs on Wed Feb 06, 2019 4:52 pm, edited 1 time in total.
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Intersection problem
Bogs is likely on the right track.
But what do you mean by a "black and white graphic"? A line is a graphic. Do you mean an image? And do you want to find the black pixels in the image that coincide with the points of a line graphic?
Craig Newman
But what do you mean by a "black and white graphic"? A line is a graphic. Do you mean an image? And do you want to find the black pixels in the image that coincide with the points of a line graphic?
Craig Newman
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Intersection problem
Klaus et al...
I would move this to the beginners pane; it has nothing to do with new features.
Craig
I would move this to the beginners pane; it has nothing to do with new features.
Craig
Re: Intersection problem
Hi Geoff,
welcome to the forum!
And Craig is correct, will move this thread now to the beginners section (Hint, Hint!).
Best
Klaus
P.S.
A little "Hello" or something will surely not hurt in the first posting...
welcome to the forum!
And Craig is correct, will move this thread now to the beginners section (Hint, Hint!).
Best
Klaus
P.S.
A little "Hello" or something will surely not hurt in the first posting...
Re: Intersection problem
Hi Geoff,
Check the stacks posted in this other forum thread:
https://forums.livecode.com/viewtopic.php?f=10&t=32027
Al
Check the stacks posted in this other forum thread:
https://forums.livecode.com/viewtopic.php?f=10&t=32027
Al