Itoo Software Forum

Author Topic: Sliding glass door  (Read 332 times)

US3087

  • Newbie
  • *
  • Posts: 7
Sliding glass door
« on: February 02, 2020, 03:35:00 AM »
Hi All,
I've got a rather basic question, although I just cant wrap my head around it. I have a generator creating a door FRAME, and within that FRAME I have another generator creating a DOOR.

I want the DOOR X size to be free, and calculated to be a percentage of the FRAME X spline.
No matter what I try using arithmetic expressions, the moment you plug an X Spline into the generator of the DOOR, it overrides any free X sizing. And it cannot return the XSplineLength value if there is no Xspline associated with it....

I hope this is understandable..

Dragan

  • Sr. Member
  • ****
  • Posts: 496
Re: Sliding glass door
« Reply #1 on: February 02, 2020, 07:07:10 AM »
Hi and welcome.
It will be helpful if you can share your scene and please downgrade it to Max2017 version.
You can also look into Macro I shared:
https://forum.itoosoft.com/railclone-pro/railclone-4-macros/
Best Regards.

US3087

  • Newbie
  • *
  • Posts: 7
Re: Sliding glass door
« Reply #2 on: February 02, 2020, 08:26:54 AM »
Hi Dragan, attached.

One more thing - why should I have to use 2 generators for the glass and the frame? Surely plugging the glass as the default to the frame should work?

I basically want the length of the spline circled to drive the input for the arithmetic node... The only thing it's driving so far is me nuts. :D

Dragan

  • Sr. Member
  • ****
  • Posts: 496
Re: Sliding glass door
« Reply #3 on: February 02, 2020, 09:03:19 AM »
Hi, as I can see you are doing just fine.  ;)
Here are some modifications.
Need some adjustment to adopt Door size to fit all the Doors to fit the  frame. I think you can manage this.  ;D
 
« Last Edit: February 02, 2020, 09:09:52 AM by Dragan »

Dragan

  • Sr. Member
  • ****
  • Posts: 496
Re: Sliding glass door
« Reply #4 on: February 02, 2020, 09:07:26 AM »
Hi Dragan, attached.

One more thing - why should I have to use 2 generators for the glass and the frame? Surely plugging the glass as the default to the frame should work?

I basically want the length of the spline circled to drive the input for the arithmetic node... The only thing it's driving so far is me nuts. :D

Nothing wrong to have separate Generator for the Glass. Usually, the Default segment can cause problems when you calculating Y Size so it can not be fitted automatically between other segments.



US3087

  • Newbie
  • *
  • Posts: 7
Re: Sliding glass door
« Reply #5 on: February 02, 2020, 11:31:37 AM »
Thanks Dragan!
Your solution has helped me a lot. So it does seem that the arithmetic operator and the spline have to be a part of the one master graph. Also the syntax naming had me very confused! I've named the generator Door01 - FP but the call syntax is actually Door01__FP...

Very strange?

Dragan

  • Sr. Member
  • ****
  • Posts: 496
Re: Sliding glass door
« Reply #6 on: February 02, 2020, 11:49:13 AM »
The Generator’s name must be normalized to be used in the expression (non-ascii characters, cannot start with digits, etc).

US3087

  • Newbie
  • *
  • Posts: 7
Re: Sliding glass door
« Reply #7 on: February 05, 2020, 01:53:33 PM »
Hi Everyone,
continuing this same thread as it does relate to what I'm trying to do:
My programming and syntax knowledge is pretty basic. I'm trying to recreate the following function using an arithmetic node but it's just not working...

f(x) = \frac{x^2}{5100}+\frac{5081 x}{1700}-\frac{4888}{51}

(See attachment - clearer)

So basically I have separated each element of the equation through multiple nodes to achieve it... (which is tedious - see 2nd attachment)

There has to be a simpler way to do all that at once through one arithmetic node, but I can't for the life of me figure out the correct syntax...

Is it:

(Input1*Input1/5100)+(5081*Input1/1700)-(4888/51);

Also,

Let's say I have 3 such functions that need be applied independently based on another input,

Would it be:

If (Input2==2);
f(Input1) // (above function);
If (Input2==3);
g(Input1) // (2nd function);
If (Input2==4);
h(Input1) // (3rd function);

Appreciate any help guys, thanks in advance!

Rokas

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2517
    • iToo
Re: Sliding glass door
« Reply #8 on: February 05, 2020, 03:18:10 PM »
I think Your expression is fine, apart it is missing "return" construct.

real a =(Input1*Input1/5100)+(5081*Input1/1700)-(4888/51);
print a;
return a;

Rokas
iToo Software

US3087

  • Newbie
  • *
  • Posts: 7
Re: Sliding glass door
« Reply #9 on: February 06, 2020, 01:38:34 AM »
Thanks Rokas!

I do have issues still with my syntax for the if else statement :(

Basically I have a limit of 2,3 and 4 doors, and based on that I want it to return different input functions...

Please help!

US3087

  • Newbie
  • *
  • Posts: 7
Re: Sliding glass door
« Reply #10 on: February 06, 2020, 07:08:14 AM »
All good. Worked it out with much trial and error!

real a=If(Input1==3,Input3,Input4);
return If(Input1==2,Input2,a);

US3087

  • Newbie
  • *
  • Posts: 7
Re: Sliding glass door
« Reply #11 on: February 10, 2020, 03:20:29 AM »
Hi Everyone,

Any idea why the spline length prints as 0?