Itoo Software Forum

Author Topic: Randomize Behaviour  (Read 100 times)

brovar64

  • Newbie
  • *
  • Posts: 5
Randomize Behaviour
« on: May 05, 2024, 01:07:55 PM »
Hi, is it a bug or I just don't understand something?
I made two modules with differend width, and when adding Randomize node to it - it generates RC object that doesn't fit the spline most of the time.


Michal Karmazín

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2504
Re: Randomize Behaviour
« Reply #1 on: May 06, 2024, 09:09:00 AM »
Hi,

Unfortunately, this is a limitation of the Adaptive mode which expects all the segments to be of the same size in order to be scaled accurately to fit the path. Due to the order of operations, it isn't possible to adaptively scale segments of different lengths.

The usual workaround is to prepare the geometry so that they are combined to form segments of the same length on the X-axis. You can see examples of this in this closely related post.

As mentioned in the Chapter 2 of our Next Steps with RailClone guide: "If you use default segments with different lengths and adaptive mode, you could find that the final segment sometimes overshoots the ends of the path. The Adaptive algorithm is only able to accurately scale the meshes if they are identically sized on the X-axis. So if you plan on using this mode with multiple segments, ensure they are all the same size."

I hope that clears it up.

Best regards,

Dragan

  • Hero Member
  • *****
  • Posts: 1424
Re: Randomize Behaviour
« Reply #2 on: May 06, 2024, 11:27:43 AM »
Well, there is a trick that could be used if you are ok with slightly scaled segments and include some nesting.
Since all segments are randomized the final size is unpredictable so you need either to scale/cut a final segment or to fit all of them into one size and as a result you will get slightly scaled segments from the original size.