Itoo Software Forum

RailClone => Work in Progress => Topic started by: Shinobi on May 18, 2022, 09:57:56 AM

Title: how to array an object along the the spline BUT with manual or differnt height
Post by: Shinobi on May 18, 2022, 09:57:56 AM
how to array an object along the the spline BUT with manual or differnt height along the path? :-* :-*
Title: Re: how to array an object along the the spline BUT with manual or differnt height
Post by: Shinobi on May 18, 2022, 10:01:21 AM
I would be gratful for your help!
Title: Re: how to array an object along the the spline BUT with manual or differnt height
Post by: Dragan on May 18, 2022, 10:59:26 AM
Simple example.
Title: Re: how to array an object along the the spline BUT with manual or differnt height
Post by: Dragan on May 18, 2022, 03:23:42 PM
I don`t have Max at the moment but I`ll use RC Spline markers to solve this.
I think this will be the easiest way with maximum control.

https://www.youtube.com/watch?v=rmG2mM6MMnM


As I remember I did an Arithmetic Operator with two inputs for start and end.
I think the expression was:
Return
Input1+xsplineposition*(input2-input1);

Xsplineposition is a value from 0 to 1. Think about the whole spline the value of 0 is the start of the spline, the value of 0.5 is the middle of the spline, and the value of 1 is the end of the spline.
So following the expression: the height will start with Input1 and raise up gradually to the rest of the height which is Input2-input1 times from 0 to 1 (position)

We can do the same but with Markers and SplineSections.
When you add a Marker somewhere on the spline. The marker will "split" the Spline and you will get two SECTIONS. If you add more Markers you will get more SECTIONS of the Spline.

We are going to use two user data fields:
User Data 0 for Start Height
User Data 1 for End Height
Those will be values for Each Section where you have a Marker. This should be Section after the selected Marker.

Now. Go to the Style editor and instead of the current inputs we need to get values from the Markers.

For Input1 (Start Height) add the Arithmetic Node set to Expression enter:
Return
Xmarkerdata[0];

Connect this Node instead Numeric node for the start height

Do the same with Input2. Add the Arithmetic Node set to Expression enter:
Return
Xmarkerdata[1];

Connect this Node instead Numeric node for the end height

Next, edit the expression for the 'main' Arithmetic Operator to:
Return
Input1+xsectionposition*(input2-input1);


That will do the same job as the previous generator but now on the SECTION level.

And the most important!! Add a default segment object in the style (orange one) but leave it empty. We call this a NULL Segment and connect it to the Marker input. This Null Segment will create Sections for RC to calculate all the values.

Now. Select the Spline and in modifier select the Marker and change Values in User Data 0 and UserData 1 fields.

Hope you will manage something :D










Title: Re: how to array an object along the the spline BUT with manual or differnt height
Post by: Shinobi on May 18, 2022, 03:50:58 PM
 :o :o :o :-\  ;D Dudee!!! you are an expertttt! Salute!

I did the same procedure with Grasshopper by using Polyline graphmapper to controll the height at everypoints and as you discribed I actully did the same procedure in GH by defination of domains but in Railclone it looks nice too! In fact knowing the expressions or each parameter looks challanging for me but with your insturction I believe I could do more!!!!

Thank you veryyyyyyyyyyyy much for support and your time Dragon. :-* :-* :-* :-* :-* :-* :-*
Title: Re: how to array an object along the the spline BUT with manual or differnt height
Post by: Dragan on May 18, 2022, 04:49:49 PM
Glad to help.  ;)