Intersection problem

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
MagicBoy
Posts: 3
Joined: Wed Feb 06, 2019 12:35 am

Intersection problem

Post by MagicBoy »

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
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Intersection problem

Post by bogs »

Well, mind you I only just woke up and aren't yet up to *thinking* level Image 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) -

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
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 :wink:
Last edited by bogs on Wed Feb 06, 2019 4:52 pm, edited 1 time in total.
Image
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: Intersection problem

Post by dunbarx »

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
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: Intersection problem

Post by dunbarx »

Klaus et al...

I would move this to the beginners pane; it has nothing to do with new features.

Craig
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Intersection problem

Post by Klaus »

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...
capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Intersection problem

Post by capellan »

Hi Geoff,

Check the stacks posted in this other forum thread:
https://forums.livecode.com/viewtopic.php?f=10&t=32027

Al
Post Reply