|
-
Feb 11th, 2008, 07:39 AM
#1
Thread Starter
Lively Member
which block I can see

from the above figure,which blcok the source rectangle can see.
Correct Answer: 2,3,4,6,7
Each Rectangle is insert poin(red star) [x,y], rotation angle, length(X direction), Depth(Y direction), and tolerance are in the database (Table rectangle)
I would like to know the best Algorithum.
Thanks guys
-
Feb 12th, 2008, 01:52 AM
#2
Re: which block I can see
What do you mean by Tolerance?
And can your Source rectangle only look in one direction?
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Feb 12th, 2008, 06:00 AM
#3
Thread Starter
Lively Member
Re: which block I can see
source rectangle only look 1 direction
tolerance is the distance between source to other rectangles
example
What source rectangle can see in 8ft
-
Feb 12th, 2008, 02:33 PM
#4
Re: which block I can see
maybe it's the english, but i'm confused.. what is he actually asking?
-
Feb 14th, 2008, 05:12 AM
#5
Re: which block I can see
My best guess is that he has a "source box", which looks in one direction for some distance, and attempts to see other destination boxes. These boxes are stored in an array that gives their position, rotation, and dimensions. What I believe he wants to know given this setup is, which boxes are completely hidden by other boxes? Conversely, which boxes can be partially seen from an eye facing only in one direction traveling along the entire edge of the source box.
This could be brute-forced pretty effectively, I would think, but I don't want to work out the math needed since it's really tedious and can be done with some basic knowledge of programming and algebra. If you post whatever you've tried clear_zero, I'd be happy to check it out and see where you're stuck.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Feb 14th, 2008, 01:31 PM
#6
Re: which block I can see
Can't you just check if block 1, 2, 3, 4 or 5 are hidden completely behind blocks 6 or 7?
Just do a check that calculates if the origin (star I presume) of block 6/7 is smaller than (in terms of the x-direction) the origin of block 1/2/3/4/5 and that the width of block 6/7 is larger than the width of block 1/2/3/4/5.
I think that's the only time a block can not be seen, so all the other times it can be seen?
-
Feb 14th, 2008, 07:47 PM
#7
Re: which block I can see
You also have to account for rotations, but I think that's the general idea. Like I said the brute force method isn't really that tough, which is why I asked where the OP got stuck
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Feb 15th, 2008, 06:41 AM
#8
Thread Starter
Lively Member
Re: which block I can see

I use AutoCAD to find the rectangle, the main thought is
scan the area (Red box is the area i need th scan) from the right bottom corner, if the selection square(yellow box) has more than 2 rectangle, then break the square into 2 small parts(white and blue box) then scan it, until only one rectangle in the selection square
The problem is it is slow. any other way to make it quicker
Thanks
ps: I am she
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|