### Author Topic: Auto scale bridge pillars to an uneven ground plane.  (Read 3753 times)

#### satoer

• Newbie
• Posts: 23
##### Auto scale bridge pillars to an uneven ground plane.
« on: December 30, 2014, 03:11:48 PM »
In the bridge tutorial, you can scale the pillars down to the ground using the Arithmetic “XplineCoords” function. But what do I need to do if the floor isn’t flat but hilly. Is there a way to scale to a ground plane that’s uneven?

One thing I can think of is to duplicate the spline, and model the beziers conforming the ground plate, scatter a dummy object and use that XplineCoords .z data to compensate the pillar scale. But without trying I think this is not going the work because the length of the spline differs from the master spline(Going up and down the hill) and the dummy object won’t be exactly below the pillars anymore.

Anyway, I was wondering if there’s a way to scale the pillars to an uneven ground plane?
« Last Edit: December 30, 2014, 03:32:54 PM by satoer »

#### Paul Roberts

• iToo Software
• Hero Member
• Posts: 2887
##### Re: Auto scale bridge pillars to an uneven ground plane.
« Reply #1 on: December 31, 2014, 11:44:07 AM »
Hi,

Unfortunately at present this is a tricky problem to solve. Ideally we would add a new generator that uses two parallel splines, this is on our to-do list but there are some technical issues that must be ironed out before we can implement it.

In the meantime there are a couple of possible workarounds that may be useful. Firstly, if the geometry allows it, you can telescope the top section of the bridge inside the bottom section. In this example the top section works exactly as described in the bridges tutorial but the RailClone object's z position is moved so that the geometry continues through the ground plane. The pillar base is then added using the same spline but with a surface to position it on the Z Axis. Because this uses the same spline to position both the top and bottom of the pillars, they shouldn't have any problems lining up.

If you cannot intersect the top and bottom of the pillars then the second alternative is to use the technique you suggest.

Using two generators with the RailClone objects Z coordinate between the top and bottom of the bridge you can scale the two halves to meet in the middle. Because of the different spline lengths it will be necessary to position the pillars by adding them to the Corner input instead of Evenly. In this way you can manually add a pillar by creating a vertex of a given type. I would do this for the top spline first to create the correct position and path for the bridge. When this is correct, clone the spline to create the bottom and move the vertices constrained to the Z axis down to the ground plane. Because the vertices line up in the top view, the pillars should align.

I hope this helps to solve your problem, I've attached a simplified demo file to help illustrate. If you have any further questions please let me know.

Cheers,

Paul
Paul Roberts
iToo Software

#### Rokas

• Hero Member
• Posts: 3324
##### Re: Auto scale bridge pillars to an uneven ground plane.
« Reply #2 on: December 31, 2014, 12:28:18 PM »
Phenomenal !
Rokas

#### satoer

• Newbie
• Posts: 23
##### Re: Auto scale bridge pillars to an uneven ground plane.
« Reply #3 on: December 31, 2014, 02:47:12 PM »
Hi Paul,

Thanks again for the solution, although it isn’t a solution for my particular case because the pillars needed to scale between the foot and the top. Tried adjusting the second solution by using the arithmetic xspline data from the lower pillar added to the scale of the top pillar. But this seems impossible because of the way the internal calculations of railpro works. It’s a bit vague how the Arithmetic operator gets its input data: Without any inputs it still knows data from the attached generators even though its attached at the end of the sequence.
Anyhow, thanks for the reply. Again, I really appreciate the comprehensive support over here . The easiest method for me is pacing the pillars by hand, no big deal. Next time I design the pillars to drive through the ground, this seems the easiest and best looking solution

#### eligiusz

• Newbie
• Posts: 20
##### Re: Auto scale bridge pillars to an uneven ground plane.
« Reply #4 on: December 09, 2020, 09:56:26 AM »
Would it be possible for railclone to extract the Z coordinate parameter of the surface thats below/above spline ?

Has this issue been resolved in newest versions ?

#### Paul Roberts

• iToo Software
• Hero Member
• Posts: 2887
##### Re: Auto scale bridge pillars to an uneven ground plane.
« Reply #5 on: December 09, 2020, 12:14:20 PM »
Hi,

Thanks for asking. At the moment the methods described above are still the only way to tackle this while maintaining parametric control.

Many thanks,

Paul
Paul Roberts
iToo Software

#### eligiusz

• Newbie
• Posts: 20
##### Re: Auto scale bridge pillars to an uneven ground plane.
« Reply #6 on: December 09, 2020, 12:23:31 PM »
Thanks for answering but could You explain how does it know where to put the object  on the surface ? doesnt RC already know the Z coordinate of the surface/object ?

#### Paul Roberts

• iToo Software
• Hero Member
• Posts: 2887
##### Re: Auto scale bridge pillars to an uneven ground plane.
« Reply #7 on: December 09, 2020, 12:26:29 PM »
Hi. Internally it works by projecting the spline onto the surface, so we can in fact easily find the Z position of the object. The issue is if you need the top and bottom to be different like with a bridge or similar structures. What is it you want to do? Perhaps we can give you a more detailed solution.
Cheers,
Paul
Paul Roberts
iToo Software

#### eligiusz

• Newbie
• Posts: 20
##### Re: Auto scale bridge pillars to an uneven ground plane.
« Reply #8 on: December 09, 2020, 12:33:46 PM »
if You project the spline to the surface cant You calculate the difference in Z position of those splines ? If we could extract that value in expression window then this would be solved ?

im making such a platform: (but the surface is uneven)

#### Paul Roberts

• iToo Software
• Hero Member
• Posts: 2887
##### Re: Auto scale bridge pillars to an uneven ground plane.
« Reply #9 on: December 09, 2020, 04:39:38 PM »
Hi,

We're going to take a look at this in the future and see what can be done. Unfortunately due to the way RailClone works internally, it's not as easy to do as you would imagine.

In the meantime, however, I may have a workaround. Please find attached a sample file containing a macro that can calculate the distance between a surface and the original spline.

Using it is pretty straightforward, just attach the bridge spline, the surface, and some kind of simple placeholder geometry (it won't be displayed so a simple box will do). This will output the distance between the surface and the spline that can then be used to scale your bridge support segments. The one important thing to note is that the Bridge generator must be named Linear 1S1 as this is referenced in the Macro.

I hope it helps,

Paul

« Last Edit: December 09, 2020, 04:41:45 PM by Paul Roberts »
Paul Roberts
iToo Software

#### Paul Roberts

• iToo Software
• Hero Member
• Posts: 2887
##### Re: Auto scale bridge pillars to an uneven ground plane.
« Reply #10 on: December 09, 2020, 05:16:29 PM »
Here's a better version that uses a nested generator instead of compose and has conditional controls to demonstrate how to swap the geometry based on the height of the bridge.

Cheers,

Paul
Paul Roberts
iToo Software

#### Dragan

• Hero Member
• Posts: 1356
##### Re: Auto scale bridge pillars to an uneven ground plane.
« Reply #11 on: December 09, 2020, 05:55:37 PM »
Very nice!
I`m stealing the idea for the macro!

#### eligiusz

• Newbie
• Posts: 20
##### Re: Auto scale bridge pillars to an uneven ground plane.
« Reply #12 on: December 10, 2020, 12:32:45 PM »
Thank You very, very much, excellent explanation. I noticed in only works if it's below the Z=0 , could it also work above ?
Do You know if this could work in RC pro 3.2.0 ? because there are some disconnections in the macro when I import it.

#### eligiusz

• Newbie
• Posts: 20
##### Re: Auto scale bridge pillars to an uneven ground plane.
« Reply #13 on: December 10, 2020, 02:00:08 PM »
Ok, I have installed new railclone and managed to get it to work ! woo hoo !  but I noticed a new limitation... it only works if the spline has one continuous line, it can't be split into parts. So there are 2 limitations:

1. It works only below Z=0
2. Spline has to be a 'one part' line

#### Rokas

• Hero Member
• Posts: 3324
##### Re: Auto scale bridge pillars to an uneven ground plane.
« Reply #14 on: December 10, 2020, 02:21:33 PM »
I would see that as requirements for style, not limitations.
Rokas