Author Topic: Find if objects are on top of each other (text, attributes)  (Read 9096 times)

0 Members and 1 Guest are viewing this topic.

LE

  • Guest
Re: Find if objects are on top of each other (text, attributes)
« Reply #15 on: October 30, 2007, 07:05:57 PM »
Yup. Now I just need to tweak it so it will run faster.  I have done some, but still more can be done to speed it up.

:)

MickD

  • King Gator
  • Posts: 3637
  • (x-in)->[process]->(y-out) ... simples!
Re: Find if objects are on top of each other (text, attributes)
« Reply #16 on: October 30, 2007, 07:12:21 PM »
Another way might be to create a region out of each bbox, do a boolean intersection on them and see if a result is returned (the result if they overlap). If an error is returned it there is probably no intersection (or check error code to be sure). If you do get something returned you could also grab its bbox if required.
Just a thought...

edit: this will only work in 2d on the same plane of course.
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Find if objects are on top of each other (text, attributes)
« Reply #17 on: October 30, 2007, 07:29:41 PM »
Another way might be to create a region out of each bbox, do a boolean intersection on them and see if a result is returned (the result if they overlap). If an error is returned it there is probably no intersection (or check error code to be sure). If you do get something returned you could also grab its bbox if required.
Just a thought...

edit: this will only work in 2d on the same plane of course.
The problem was trying to get the bbox.  It would not return the correct bbox, so I found a way to do it, but it doesn't work quite right either.  If you have letters that hang below the imaginary line it does not reflect that, but it works for what I need.  Mine only works for one plane now, at least I think it only works for one plane, and that is good enough for what I need.  Thanks for the idea.  I love seeing more than one way to solve a problem.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.