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 there probably could work
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.
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
Iâd skip the ray bounce entirely.
- Select the room
- Get the perimeter curves and patch to a surface
- Grab all windows in the room
- Get the transform of each window (a coordinate system)
- Transform the surface from the windowâs coordinates to the origin coordinate system
- Pull the bounding box of the transformed surface
- 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
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⌠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