Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: satoer on December 30, 2014, 03:11:48 PM

Title: Auto scale bridge pillars to an uneven ground plane.
Post by: satoer 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?
Title: Re: Auto scale bridge pillars to an uneven ground plane.
Post by: Paul Roberts 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.

(http://lonelymonk.com/forum_images/86a0403ee00d48e2b7d5ffe30e4a31f7.jpg)

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.

(http://lonelymonk.com/forum_images/bcb0735ed8164ce18fd604fd5db7f319.jpg)

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
Title: Re: Auto scale bridge pillars to an uneven ground plane.
Post by: Rokas on December 31, 2014, 12:28:18 PM
Phenomenal !
Title: Re: Auto scale bridge pillars to an uneven ground plane.
Post by: satoer 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 :)
Title: Re: Auto scale bridge pillars to an uneven ground plane.
Post by: eligiusz 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 ?
Title: Re: Auto scale bridge pillars to an uneven ground plane.
Post by: Paul Roberts 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
Title: Re: Auto scale bridge pillars to an uneven ground plane.
Post by: eligiusz 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 ?
Title: Re: Auto scale bridge pillars to an uneven ground plane.
Post by: Paul Roberts 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
Title: Re: Auto scale bridge pillars to an uneven ground plane.
Post by: eligiusz 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)
Title: Re: Auto scale bridge pillars to an uneven ground plane.
Post by: Paul Roberts 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.

(https://i.imgur.com/2agVLAp.gif)

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

Title: Re: Auto scale bridge pillars to an uneven ground plane.
Post by: Paul Roberts 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
Title: Re: Auto scale bridge pillars to an uneven ground plane.
Post by: Dragan on December 09, 2020, 05:55:37 PM
Very nice!
I`m stealing the idea for the macro! ;)
Title: Re: Auto scale bridge pillars to an uneven ground plane.
Post by: eligiusz 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.
Title: Re: Auto scale bridge pillars to an uneven ground plane.
Post by: eligiusz on December 10, 2020, 02:00:08 PM
Ok, I have installed new railclone and managed to get it to work ! woo hoo !  ;D 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
Title: Re: Auto scale bridge pillars to an uneven ground plane.
Post by: Rokas on December 10, 2020, 02:21:33 PM
I would see that as requirements for style, not limitations.
Title: Re: Auto scale bridge pillars to an uneven ground plane.
Post by: Paul Roberts on December 10, 2020, 02:24:32 PM
Glad to hear it works after an update. This does use nested generators so it needs to be used with RC4 or above.

I'm not sure what you mean by "It works only below Z=0" - for me the RailClone object, the spline and surface can all be at any position on the Z Axis. The only limitation is that the spline cannot go below the surface anywhere. Would you mind elaborating?

The second issue I'm not sure I could fix. This is a workaround to do something that technically shouldn't be possible in this version, so we are a bit limited  :)

I would suggest it might be easier to modify the rest of the style to fit in with the Macro's limitation until we can update RC with a more robust solution.

Cheers!
Paul
Title: Re: Auto scale bridge pillars to an uneven ground plane.
Post by: eligiusz on December 10, 2020, 03:41:24 PM
Sorry about this below Z=0, You are right, I was moving the spline and surface UP, without the RC object itself.... so it seams that something strange was happening when the surface was above the RC object. By the way, because rokas mentioned that these are not limitations , so i want to make it clear that i wrote about what I noticed not as a criticism but for information for other users that might use it :) ofcourse i'm very thankful for Your help and quick solution !

The most important thing is that it works and RC is even more powerful now !  ;D

by thw way I like Your idea of stacking those support segments instead of scaling them, I will try to implement this also to my platform.
Title: Re: Auto scale bridge pillars to an uneven ground plane.
Post by: eligiusz on January 04, 2021, 05:10:39 PM
what do You think ? heres how the  platform looks in the scene
Title: Re: Auto scale bridge pillars to an uneven ground plane.
Post by: Paul Roberts on January 06, 2021, 01:17:14 PM
Thanks for sharing the final project. Really glad that RailClone could help you with this project. I think this technique will make an interesting tutorial, so thanks for bringing it to our attention.

Paul