Itoo Software Forum

Author Topic: Change scale and distance over spline  (Read 3619 times)

OU9561

  • Jr. Member
  • **
  • Posts: 52
Change scale and distance over spline
« on: January 11, 2018, 05:50:28 PM »
Hi!
I'm trying to distribute some playing cards along a spline, so that they get smaller as they travel through the spline.
I managed that by using an arithmetic Operator with this expression: return (XSplinePosition*100)+10; and a transform modifier with the 3 scale parameters exported. (the smaller cards will be scaled to 10%)

That works fine for the scale. The problem I have is that I want the cards to be superimposed a little one over another, so I don't use the Linear 1S in default, I have it set to evenly, and play with the left padding on the segment. This causes the problem you can see in the file, I have a lot of cards on the start of the spline but to few at the end.
The ideal thing would be to have the left padding set at 150cm at the start of the spline and at 0cm at the end. I tried doing another arithmetic operation with return XSplinePosition*150; but i don't know why it doesn't work.

Any help would be really apreciated!


iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4388
    • iToo Software
Re: Change scale and distance over spline
« Reply #1 on: January 13, 2018, 09:51:39 AM »
Hi, the problem is that Evenly positions are not affected by Padding (same with Start, End and Corner). Only Default segments are affected by it.

This happens because RailClone first computes the positions of Start/End/Corner and Evenly segments (according to their respective parameters)... and then the gaps between them are filled with Default segments.
Basically the position of Evenly segments depends only of the Generator->Rules->Evenly parameters.

This interesting case can be solved just using Default segments. I made the following changes:

- I use only Default segments.
- Left padding is computed as a percentage of the card width: return - Input1 * Input2 / 100;, where Input1 is the Overlap percentage, and Input2 is the card width.
- To compute the card width properly,  i moved the Transform->Padding after all other transformations, exported "X Size" from the last transform, and connected it as "Input1" in the Padding expression. In this way, "X Size" is the final size, once applied all scale transformations.

You can find the modified scene attached. I hope that helps.
« Last Edit: January 13, 2018, 09:53:31 AM by iToo »
Carlos Quintero
iToo Software

OU9561

  • Jr. Member
  • **
  • Posts: 52
Re: Change scale and distance over spline
« Reply #2 on: January 16, 2018, 05:10:59 PM »
Thanks a lot! it works great