PDA

View Full Version : Making a railing shape follow a path

Arch
05-13-2015, 05:43 PM
Hello. First post, and as to be expected of 3D, a "Please help me I've been trying this for a month and ripping my hair out" post. :p

I've been trying to solve this problem for a racing environment I'm making for some time now. I can't get this guardrail to follow a curve. Camber, elevation and attitude are also needed apart from just left and right bending.
Rail extrude does not do what I want and Spline Guide does not keep the post and the railing as one part and it stretches some areas that should stay in the same proportions, but otherwise works fairly well. To now, the best result comes from Rail Clone, but it does not merge the end points.

Is there any way to make a complex shape like this precisely follow a curve, but make it merge the "ends" so you get a smooth, realistic shape?

Here's a picture of the problem that needs to be solved, namely the rail following the path perfectly, with proportions intact, but not merging to become one continuing part.

128235

And just for perfect clarity, here is something like what I want to achieve:

128236

Thanks.

JoePoe
05-13-2015, 05:53 PM
First thought...

Can you Rail extrude the upper part... it'll be one continuous part.
And Rail Clone the posts separately.... they will still (hopefully) intersect the main part as before.

Arch
05-13-2015, 05:55 PM
I'll take a look. I fear it won't work, and the posts will be misplaced, but I'm putting full confidence in this for good measure.

EDIT: It seems I've ran into another issue. It seems to be merging completely incorrect ends. Is it a matter of my modeling? I've redone this shape two times up to now now, in different ways, to be sure this doesn't happen due to my modeling.
My method is to lay out a point cloud of the shape because it's so simple, then make polygons in the spaces where I want them. Does that have something to do with it, polygon creation order or something?

128241

Here's a clearer example of what happens when I R.Extrude a custom length of 2.

128240

JoePoe
05-13-2015, 06:37 PM
You're extruding a flat cross section right?

like this... 128242 128243

05-13-2015, 06:40 PM
quoted from the "HELP" file page1413

2015 Rail Extrude Tool
The Rail Extrude command (Multiply > Extend > Rail Extrude) will extrude a point, polygon, or object
along a curved path (single rail clone) or multiple paths (multiple rail clone). It is nearly identical to
the Rail Clone command, discussed later. The difference is that Rail Extrude forms a continuous skin
for the object instead of making individual copies of the object.
The curve(s) must be in the background layer and the polygons must be extruded in the
foreground layer. The orientation and position of the foreground polygons will affect the result.
Generally, they should be at the very beginning of the curve and oriented perpendicular to it - as if

Arch
05-13-2015, 06:41 PM
Ah, no. Of course that'd happen if I demand a solid, straight object to fill an infinite amount of dots. I'm new to LW, so slip ups happen.

I'll try extruding it properly then see what happens if I fill the gaps with the posts.

128244

I think I could get this to work if I place the extrudable/copiable parts 100% properly. I will find a way to do that. This is better than anything to now at least. Thanks.

Anyone with any better methods than essentially having to place this by hand, with a margin for error, go ahead and share.

Ma3rk
05-13-2015, 07:29 PM
Anyone with any better methods than essentially having to place this by hand, with a margin for error, go ahead and share.

Ummm, you might want to check out LWCad. www.wtools3d.com

It's not an inexpensive plug-in, but one of those that will be on your top 5 most wanted list.

jeric_synergy
05-13-2015, 08:26 PM
This should be totally doable, in the manner JoePoe suggested:

the solid(ish) guard rail extruded using RAIL EXTRUDE,
and then using the same curve ('rail') using RAIL CLONE to add the posts.

If you need a LOT of control, you might want to examine SPLINE PATH (in 'stretchy' mode) and use SAVE TRANSFORMED in Layout

Arch
05-14-2015, 06:29 AM
Is there any way to parent the post to the railing, so it always adds itself to a certain position? That'd be ideal. What I want is the post in the middle of the rail in completely even spacing, perpendicular to the angles of the post.

Ideally I'd want a method that lets me array, then merge points along a curve.
For example, in *gasp* Blender, the way you did this was great:

You make a curve, then assign an array and then a curve modifier to an object. It then copies the object along the curve, merging the points, at even spacing and proportions. Why LW can't do this is beyond me, and it makes the program look very bad.

MonroePoteet
05-14-2015, 07:59 AM
As BokadCastle mentioned, the placement and orientation of the geometry in the foreground layer to be cloned / extruded relative to the head of the curve (rail) in the background layer is exacting. If you use "Uniform Lengths" with specific values, say 20 for the posts and 60 for the railing, and make sure the initial post and railing geometry is placed correctly relative to the head of the background curve, you should be able to get good placement of the posts relative to the railing.

If possible, I usually position the head of the rail at (0,0,0), then position the geometry to be cloned / extruded relative to (0,0,0). If the head of the rail isn't at (0,0,0), then I position the geometry very carefully in the Top, Back, Right and Perspective views to ensure it's aligned well with the rail.

Here's some screen shots. Hope it helps!

mTp

jeric_synergy
05-14-2015, 08:09 AM
If possible, I usually position the head of the rail at (0,0,0), then position the geometry to be cloned / extruded relative to (0,0,0). If the head of the rail isn't at (0,0,0), then I position the geometry very carefully in the Top, Back, Right and Perspective views to ensure it's aligned well with the rail.
Note: there are several free plugins that will position and rotate the geometry to be extruded to be EXACTLY perpendicular to the extruding rail, no matter where the rail is. MonroePoteet is correct in stating that the orientation of the two parts are exacting. A slight discrepancy results in very visible errors.

Arch
05-14-2015, 08:56 AM
Thanks, guys.

The extrude + clone method works, but requires extreme precision. Ideally perfect precision. Does anyone know the names of any of the said plugins?

128251

JoePoe
05-14-2015, 09:09 AM
Well there are MG_Ultimate clone (https://www.lightwave3d.com/assets/plugins/entry/ultimate-clone/), Clone+ (https://www.lightwave3d.com/assets/plugins/entry/clone/), and Taz Pipe (https://www.lightwave3d.com/assets/plugins/entry/taz-pipe/).

I used a double rail clone. Helps with registration. (I did it in a rush here.... it's a tiny bit off). But perfectly doable.
That being said, it really is a pain in the butt in native LW. And yes I agree with you.... doesn't make the program look good.
LWCad really is the best solution (I know.... more \$, but it'll chew through something like this.)

128253 128252

edit: okay now it's perfect.... ;) 128255

Arch
05-14-2015, 09:42 AM
At least it's doable. I can FINALLY start working on my track, now. It's gonna be a game asset btw, so this rail needs to also be UV'd and textured. I think it's gonna be easier to figure out than this, though.

In the meanwhile I'm gonna take a look at those plugins to find the best, fastest way to do this, as the track will have railings and other cloneable objects everywhere.

JoePoe
05-14-2015, 10:06 AM
UV Creeper (https://www.lightwave3d.com/assets/plugins/entry/uv_creeper/) :thumbsup:... if you forget to create UVs when initially making the railing.

Looking forward to playing :)