Itoo Software Forum

Author Topic: Divide Y size in half for sliding sash  (Read 7507 times)

Rio

  • Jr. Member
  • **
  • Posts: 91
Divide Y size in half for sliding sash
« on: June 21, 2024, 06:43:00 pm »
I've been over a few versions of this today, and this is the neatest I've got so far, but I'm not quite there because of a stmbling block, namely calling dividing my Y size in half, in order that I can stack two of the sashes over each other.

Any suggesions or tutorials on how to make this work? End goal is a sliding sash where the X and Y base objects extend to the perimter of the window, with the top sash able to slide down via a parameter, and mullions and transoms adjustable with a parameter.

I realise I can probably just use the same array for top and bottom sashes, as the 'nibs' will just stick into the cill and not be visible, but it's how to call the half heigh of the window. I tried using a shorted Y spline, but it didn't feel good having to guess where the end of it should be.

I see there's a Y spline variable' macro, but can't figure out how to use it to call the Y spline length and put this into an arithmetic node.

I guess I could have two sets of X and Y splines, but this feels messy.


Rio

  • Jr. Member
  • **
  • Posts: 91
Re: Divide Y size in half for sliding sash
« Reply #1 on: June 22, 2024, 09:22:10 am »
So I got it working last night using a mess of sequence and transform nodes. Haven't added the sliding sash functionality yet, that'll make it even more messy.

Would be much neater if I could call that Y height and divide it in half. Can't seem to export Y size from an 2D array but can from a transform node, so one idea is to create a (dummy) 2D array with blank segments, wire it in to a transform node and export the Y size from that into the 2D generators.

Any better methods?

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 3062
Re: Divide Y size in half for sliding sash
« Reply #2 on: June 24, 2024, 10:03:46 am »
Hi,

hanks for the question. I find the easiest solution is to next the segments inside a 2D generator instead of a 1D generator. In that way you can access the Y Size of the array and use it to control the attributes of any attached generators. For example, if the end generator is an A2S called top_sash, I can access the Y Size and divide it by two using the expression return top_sash.YSplineLength/2;

In the attached file I've used this technique to set the size of the top and bottom sashes. I've also added a Constant node to control the size of the overlap in the middle and for good measure, used the same value with a multiplier to allow you to open the top and bottom sashes.

I hope that helps, please let me know if any aspect needs further explanation.

All the best,
Paul
Paul Roberts
iToo Software

Rio

  • Jr. Member
  • **
  • Posts: 91
Re: Divide Y size in half for sliding sash
« Reply #3 on: June 25, 2024, 04:58:23 pm »
Check it out, really handy expression that I'm probably going to use a lot. Thanks!

I see what you're saying about nesting in a 2D array too....I think. going to try setting it up from scratch now & will check out that other functionality you added later.

Thanks again!