Ray bounce and parallel lines

Good morning everyone,

I am developing a script to calculate the depth of rooms relative to the wall with windows. Currently, I use ray-bounce to measure the distances between the window and the wall in front of it, but I also need to know the maximum depth of the room (ALWAYS IN THE DIRECTION PARALLEL TO THE RAY-BOUNCE). This is because if the room has an articulated shape or there are obstacles like in the image, the value of the room depth must always be the maximum existing one.

I thought of using the bounding box for the rooms first, so whatever shape the room has, it returns the maximum depth. However, with the bounding box, I cannot extract (doing room bounding box → cuboid, i can only extract width and depth, but it doesn’t tell me which curve is one and which is the other, so I can’t verify that the greater of the two is parallel to the ray-bounce.) the curve of the cube’s side to query it and check if its direction vector is parallel to the ray-bounce vector.

In essence, I need advice on how to obtain the single room’s edge curve constituting the longest side parallel to the ray-bounce.

Thank you all!

Hi @f.amman not really sure is it something here you are after…if so here is a dirty way :wink: there probably could work

Revit_Nlmy5lEC88

hi @sovitek the rays should remain contained within the room. I think setting a number of “passthroughs” is dangerous because, if I have a room without obstacles, the ray could go outside the room, as it seems to happen in the room on the left in the video.

allright as here ?

D29pvgT73c

yes how do you make only “obstacle walls” to be trapassed? and boundry ones solid?

Just filter that wall out [many ways it can be done] then temp hide that wall and then raybounce and then unhide again and thats why we need some passtrough

i would like to find an automatic way for get the job done, cause of the building is big i cant go around hiding walls, error is behind the corner!
any idea?

Not really then, right now…btw everything is automatic in my exemple [except select windows but could be automatic as well] without error and cant see error around corner even on big models but will probably run a little bit slower…good luck with that :wink:

I’d skip the ray bounce entirely.

  1. Select the room
  2. Get the perimeter curves and patch to a surface
  3. Grab all windows in the room
  4. Get the transform of each window (a coordinate system)
  5. Transform the surface from the window’s coordinates to the origin coordinate system
  6. Pull the bounding box of the transformed surface
  7. Pull the maximum point of the bounding box and get the Y component - this is the depth of the room relative to the window

That said, if you’re looking to find ‘percentage of the room with light from a window’ you’re likely better off looking at VASA as it will manage this much faster and more accurately than ray casting.

1 Like

yeah good idea i just tried with ray as the user ask…but could probably be done other way as well…depends :wink: :wink:

1 Like

Continuing the discussion from Ray bounce and parallel lines:

sovitek is it possible to see your script? Thank you

sorry dont have it anymore…but basicly i just filter that wall out there dont connect to other, and then make a temp hide, raybounce and then unhide again… :wink: try it or try what Jacob suggest…good luck

thanks, in the end solved whit roome bounding box longest edge
look at the result

thanks to all

script available?