Results 1 to 8 of 8

Thread: which block I can see

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Location
    UK
    Posts
    87

    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

  2. #2
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    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.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Location
    UK
    Posts
    87

    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

  4. #4
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: which block I can see

    maybe it's the english, but i'm confused.. what is he actually asking?

  5. #5
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    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.

  6. #6
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    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?

  7. #7
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    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.

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Location
    UK
    Posts
    87

    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
  •  



Click Here to Expand Forum to Full Width