OpenStudio: Create window with nothing but offset from floor and offset from ceiling?
My windows are basically from 1' off the floor until 3' from the ceiling and span the surface width of the surface.
The existing method is setWindowToWallRatio (double wwr, double desiredHeightOffset, bool heightOffsetFromFloor)
: it doesn't accept TWO offsets, and you must specify a window to wall ratio, and this window to wall ratio MUST not be too large to fit on the surface after the offset is done (and offset from floor of 1 meter and a wwr of 0.99 will not work).
So, using a (bad) while loop decrementing the wwr until the setWindowToWallRatio returns an initialized window, I can quickly put a window on my wall that will take the largest admissible wwr given an offset from the floor OR from the ceiling, but not BOTH.
Is there a method similar to surface.setWindowToWallRatio(double desiredHeightOffsetFromFloor, double desiredHeightOffsetFromCeiling)
somewhere?
Comments
Apparently not. And it doesn't look like you can synthesize that behavior from other methods either. I would create a feature request on the uservoice site.
Couldn't you do this with math and surface vertices? Like, get the min/max z-values of the surface vertices, increase/decrease them by your offset distance, and create a new subsurface with the new set of vertices. You'd have to figure out how to do a slight offset of the vertical edges (so you don't break up the base surface), but I think that's done in the WWR user script, so there's probably code there that could help.
I'm sure you can do that. I've done similar stuff to resize existing windows around the centroid, it's a fun exercise that makes you refresh trigonometry and 3D geometry, but that requires time I don't have for now =)
I agree it's fun to dust off those old math skills. But yeah, Dan's is the more elegant (and faster) solution.
And how would you know wall height and rectangularity (rectangularness? rectanguaritude?) without looking at the vertices? I was trying to stay away from that kind of stuff. Given that most of the code already exists in the SDK, the full monty should probably go in there too.