Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: James Vella on July 09, 2018, 01:50:27 PM

Title: Complex Windows
Post by: James Vella on July 09, 2018, 01:50:27 PM
Hi,

I thought I would start a new thread so I can keep my window questions together.

I am attempting to build some window frames which have multiple pieces on the left as well as the right, centre, and separate bottom pieces. Hopefully I can get to the bottom of this as it seems to be quite difficult so far however I think Im just missing some important parts of the expressions which should tie this together and keep it parametric as a template.

To start with I am trying to get the centre piece to work on X evenly which has 5 different pieces as below:

(http://i67.tinypic.com/fayazp.jpg)

My expression does not work correctly and wondering how else to achieve this without an else section:

return if(YSplinePosition==0,5,
if(YSplinePosition==1,1,
if(YSplinePosition>0.75 <1,4,
if(YSplinePosition>0.5 <.0.75,3,
if(YSplinePosition>0.25 <0.5,2)))));


Parse error. Expected expression at line 4:
if(YSplinePosition>0.5 <.0.75,3,
                                        ^


Many thanks,
James
Title: Re: Complex Windows
Post by: Rokas on July 09, 2018, 03:05:29 PM
well if You want to have 2 conditions for one if You can use & operator
return if(XSplinePosition>0.5 & XSplinePosition<0.75,1,2);

(https://i.imgur.com/sj59V7h.jpg)
Title: Re: Complex Windows
Post by: James Vella on July 10, 2018, 09:08:33 AM
Thanks Rokus, this works for 2 variables however when I add a third it seems to break on if:

return if(YSplinePosition>0.5 & YSplinePosition<0.75 & YSplinePosition<0.25 ,1,2,3);

Compile error. Wrong number of arguments in function: "if" at line 1:
return if(YSplinePosition>0.5 & YSplinePosition<0.75 & YSplinePosition<0.25 ,1,2,3);


Is there a syntax reference somewhere, it seems like I cannot get a good reference as to what write as a custom expression?


Cheers!
Title: Re: Complex Windows
Post by: Rokas on July 10, 2018, 09:50:59 AM
Hi,

You misunderstand how & works.
It checks if all conditions match then it is true. You then need to define else which can have anther if with multiple and

Your condition with 3 arguments are not good. Let say yellow line is whole Yspline.
Then first range defined by green and 2nd range defined by blue rectangles. their both AND is what intersects. If You add 3rd condition it should intersect with that also. In other case there is no sense to write it.
(https://i.imgur.com/d1QhKGi.jpg)


That is one problem.

Other problem which makes compiler to error is not the number of & but if misuse:
if(condition,true,false);
what You have is if(condition,true,false,EXCESS PARAMETER); which makes it to error.

Syntax reference can be found here (https://docs.itoosoft.com/railclone/style-editor/operators#Operators-ExpressionsSyntax)

Every function has little help in the Expression editor too:
(http://lonelymonk.com/forum_images/ebb6983b19b14daeb73f13d5a52567db.jpg)
Title: Re: Complex Windows
Post by: James Vella on July 10, 2018, 12:55:15 PM
Thank you Rokus, that makes somewhat sense. So I guess Im looking at the wrong kind of formula here for my expression.

If I understand you correctly - what I want to do is just define each separately if possible, so in this case I still get an error when trying to define just one of these.

return YSplinePosition == 0,1;


Parse error. expected ';' at line 1:
return YSplinePosition == 0,1;
                                      ^


I have 5 Inputs, the start,end,middle need to remain constant size and the two others need to scale. What Im thinking is:

return YSplinePosition == 0 ,1;
return YSplinePosition >0 <0.5 ,2;
return YSplinePosition ==0.5 ,3;
return YSplinePosition <0.5 <1, 4;
return YSplinePosition ==1 ,5;

(http://i67.tinypic.com/22r6t.jpg)

Thanks for the help mate

Edit: From reading the Operators page I see I can only use 1 return function within the expression, not sure how I would add 5 items to this (I cant even get 1 to work so far! lol)

Edit2: I can get it to accept this without an error (although not working still) using this syntax but i would rather not use an if statement if possible, just statements - if that makes sense?

return if(YSplinePosition == 0, 5,
if(YSplinePosition >0 <0.5, 4,
if(YSplinePosition == 0.5, 3,
if(YSplinePosition >0.5 <1, 2,
if(YSplinePosition == 1, 1,2)))));
Title: Re: Complex Windows
Post by: James Vella on July 10, 2018, 02:46:14 PM
Im starting to think I am going about this entirely the wrong way - the node network seems super complicated at this stage for something that appears so simple and requires multiple expressions - when I would expect a sequence node to act accordingly such as on the X Evenly - 5 segments in order of how I have selected them.

Is there a better way to achieve this (Blue Areas Highlighted are Constant)?

(http://i64.tinypic.com/dq4w2x.jpg)

- Have ability to change width/length of Spline rectangle Clipping Area
- Keep all mullions 50mm
- Only scale Top 1&2, Btm 1&2 along the X axis
- Only scale Left 1&2, Right 1&2 along the Y axis
- Remaining segments to remain consistent x/y length
- The bottom window stays in the bottom third of the Clipping Area
- I dont want the window to tile, I want it to keep all proportions so that when the Clipping Area increases or decreases it adjusts all the scaleable areas to match the consistent areas.

So far I have used a Selector with your expression from the other thread Rokus for the left and right sides - which place it in the centre:

Expression:

(YSplineLength-117.9-140.7)/2-294.3/2;

I then also converted this to be parametric using the nodes for the arithmetic to calculate the length of those variables listed above (117.9, 140.7 etc)
This puts the item in the centre, which is a good start however I want to move this to the bottom third and have had no luck so far.

Now I am attempting to use an expression for the X evenly to place the 5 centre pieces along the Y. When it seems to me shouldnt a Sequence Node work for this (not sure as to why its not)?

Which leads me to think maybe there is a better way...

I like the idea of the nested railclones which I followed in the tutorial Creating Panelling and Wainscoting (https://www.itoosoft.com/tutorials/creating-panelling-and-wainscoting?back=page%3D2%26tag%3Drc). I can see how this concept is a simpler way of doing things but having issues translating this across to my model or if this is indeed a better way.

Any tips on powering through this is much appreciated, I didn't expect so much of an up hill battle for a window this basic lol.

Title: Re: Complex Windows
Post by: Rokas on July 11, 2018, 11:57:43 AM
I would suggest creating a nested style. It should be easier in this case.
I wouldn't say it is a simple window setup. It has all different segments, not according to default scheme:
(https://i.imgur.com/VsiG5c8.jpg)
Title: Re: Complex Windows
Post by: James Vella on July 12, 2018, 10:36:41 AM
Ok ill give it a shot thanks Rokus!

I am doing the kitchen cabinets tutorial (https://www.itoosoft.com/tutorials/kitchen-cabinets-with-railclone?back=page%3D2%26tag%3Drc) which has lots of nested setups, I think this is going to be applicable to this situation. Ill post back my findings!

One thing I am curious about, is there a way to have the Y Evenly overlap the X Evenly? It looks like X Evenly always takes precedence.

Cheers
Title: Re: Complex Windows
Post by: James Vella on July 17, 2018, 09:05:30 AM
Is there a bug with the XSplinePosition in the latest version Railclone (320)?

I have the Selector working correctly on the YSplinePosition however when I try to do a similar function on the XSplinePosition it does not seem to work - specifically the last ID3 on Position 1 of X?

return
if ( XSplinePosition == 0, 1,
if ( XSplinePosition == 1, 3, 2 ))
;


Im using A2 Generators and tested this just on its own with a fresh setup and I cannot get the selector to just place the end pieces at Position 1 for the XSpline as shown:

(http://i64.tinypic.com/2ikflom.jpg)


Title: Re: Complex Windows
Post by: James Vella on July 17, 2018, 01:35:14 PM
Ok, I have changed my approach on this and getting closer to the result Im after, however I am having trouble with 1 thing which should solve a few other things. So we can ignore my previous question for now (Although still curious as to why it does not work on the X as well as the Y for the Sequence Expression)

Ill post up the entire resolution when this is complete for anyone else building Complex windows.

On to my next issue lol...

How do I reference the Y Position of the "Bottom" piece from another Array?

Essentially I want to use this as a base point for my Centre Mullion to then Offset the Y.

Example:
(http://i66.tinypic.com/if4tqh.jpg)

This is what I have tried so far...

The Centre Piece (in the red box) > Export Y Fixed Translation > Wire to Arithmetic >

return
YSplinePosition == 0
;


I also tried

return
YSplineCoords.y == 0
;


return
min (YSplinePosition, 0) + (-Input1)
;


I also tried to Wire the Bottom Piece Y Translation to an arithmatic to wire its Translation into the Translation of the Top Piece of my other Array but it seems like the green dots are on the wrong side (more likely my brain is on the wrong side).

Really appreciate any advice as to how to wire this information across for translation purposes. Thanks!

Edit:
I have looked through the manual pages and still cannot find reference to good examples using the Expressions - I would like to know how to use it like this:

If Y Fixed Translation = 0 then Place Object2 at 0

or Reference other objects in the node system such as:

If Object1 is located at Y Fixed Translation 0 then Place Object1 at Object 2 then Add Input1 (the Offset I have entered in a numeric/constant)

I know what I need but I cannot find reference to examples to do specific things as such. At this point I feel like im just completely guessing based on the Autodesk reference guide and information provided in the help docs which dont show many examples. I type in what I think should happen and most of the time, and it doesnt happen. For Example, I would think that adjusting an object's (Top Piece) YPadding based on the 0 Position of YSpline I would do something like this:

return
(YSplineCoords.y == 0)
;


However this does nothing? It says OK in the box but does not move the Top Piece to the Bottom of the YSpline? But when I move it manually using the padding units it does but I need this to be linked to the size of the Spline.  I have read all the links you have provided so far Rokus and Im still having lots of trouble finding any examples on how to use the Operators.


Edit2:


I have attached a new version which I think is almost there, Im just missing 1 component which will set the Initial Y Offset of the Generator Btm Mullion to the Bottom Piece of Generator Outside Frame, before I add the Offset I require Numerical Node Y Offset

Im not sure how but any advice is helpful thank you!
Title: Re: Complex Windows
Post by: Rokas on July 17, 2018, 04:26:29 PM
Hi James.

Regarding Your first issue:
Expression works fine. The point is that vertical is calculated differently. Top Input always has a whole segment aligned to Top. That is not the case with Horizontal Right Input.
Workaround use included A2S with intersections macro:
(https://i.imgur.com/5RgGWsU.gif)

2nd issue:
I moved Your Top segment in Y direction, -YSplineLength distance:
(https://i.imgur.com/qMaMvSc.gif)
Title: Re: Complex Windows
Post by: James Vella on July 17, 2018, 07:32:54 PM
Thank you Rokus, that looks like what I am trying to do in the second example. Can you please upload a 2017 version for inspection?

I have had a look at the intersections macro... I think this may take awhile to dissect lol.
Title: Re: Complex Windows
Post by: James Vella on July 18, 2018, 05:39:07 AM
Ok I understand now what you have done (I think), however this flips the Top piece upside down (Puts the glass that goes in that bottom panel into the top panel).

Is there a way to achieve the same however keeping the Top piece so that when its translated to 400mm on the Y the glass stays beneath it?

(http://i67.tinypic.com/21o4p5z.jpg)

(http://i63.tinypic.com/168fted.jpg)

Edit:


Ok! I got it working by doing: return -YSplineLength -Input1 -Input2 ; for the Y Translation of the Default piece aswell - not sure if this is exactly correct but it seems like its doing what I need for now.

Input1 = The inverse of the Y Offset parameter
Input2 = Top Mullion Size Y

Thank you so much Rokus for the helpful advice!!
Title: Re: Complex Windows
Post by: James Vella on July 23, 2018, 10:26:51 AM
Thank you for the help Rokus! I have it fully working now and animatable (mullion widths remain consistent as the spline changes length/width). Ill post up a tutorial of this soon as I think Im seeing more people interested in windows for railclone and I have a few more I want to do with different types of layouts and parameters - all parametric so you can swap out the window pieces with your own or chanege lenghts/widths for your own (or to match CAD) :D

(https://image.ibb.co/e7t1yd/2018_07_23_10_13_37_2.gif)
Title: Re: Complex Windows
Post by: James Vella on July 24, 2018, 09:03:13 AM
Small Update:

Window Mullion width can now be adjusted

(https://image.ibb.co/j8HEm8/2_Mullions_Adjust_1.gif)
Title: Re: Complex Windows
Post by: M55 on July 26, 2018, 06:54:56 AM
Looks nice

 ... would be a good addition to the RC Library
Title: Re: Complex Windows
Post by: James Vella on July 26, 2018, 03:24:35 PM
Thanks M55, I will be making a complete pack of different types soon enough as presets, hold onto your chair!
Title: Re: Complex Windows
Post by: M55 on July 27, 2018, 07:29:59 AM
 :)
Title: Re: Complex Windows
Post by: LB4858 on August 08, 2018, 11:42:18 AM
This topic is golden and Im looking forward to do the same thing! Hope that you will share this project.
Title: Re: Complex Windows
Post by: M55 on September 24, 2018, 08:00:23 AM
her i am on my chair again  :)
Title: Re: Complex Windows
Post by: James Vella on October 29, 2018, 11:05:03 AM
I will release the workflow for this in the coming tutorials, for the mean time this is just a short basic video on how to create a basic window profile using the conditional node. This allows you to have a separate window profile on the left to the right. This is just a slight modification of itoo's parameterise windows tutorial so I wont be explaining the arithmetic node as they have already done an excellent job on this.

Windows Part 1

https://youtu.be/UHDF_f0JNkg

(http://i68.tinypic.com/2i9se13.jpg)
Title: Re: Complex Windows
Post by: James Vella on October 30, 2018, 12:27:26 PM
I think ill have to extend this to a 4 part series as I thought I would extend a little more on the conditional nodes. You can see how to create a 3 Panel Window quickly in the video below. I also give a quick preview to the other window types we will be covering in the series at the end of the video.

https://youtu.be/Xo8RuLjLPYY

(http://i63.tinypic.com/30xddlf.jpg)
Title: Re: Complex Windows
Post by: TL1895 on October 30, 2018, 03:35:33 PM
James,
Thanks for making these videos, I'm learning nicely, so far.
Best regards
Title: Re: Complex Windows
Post by: M55 on October 31, 2018, 06:11:04 AM
James,

thanks for sharing your  experience. Very nice tutorials with interesting approaches. I learn a lot.
keep on ... i am ready for the next one  8)

greetings from germany
Klaus
Title: Re: Complex Windows
Post by: Mouton on November 08, 2018, 10:34:50 AM
Yeay finaly some creating some nice tutorials  8)
Title: Re: Complex Windows
Post by: James Vella on November 28, 2018, 03:49:02 PM
Thanks for the feedback its much appreciated! I will be adding more in the coming weeks after I get through some jobs Im working on. Keep you posted :)