PDA

View Full Version : Splines, Curves, EasySpline, Rail Extrude, Pipes > Render and Still Remain Editable?



spherical
10-10-2014, 04:31 AM
OK, I've been working this all day. I have a rat's nest of discreet electrical wires in a tight space that I need to plan out. Inevitably, this will mean a lot of trial, error and adjustments until it all comes together in a, hopefully, logical mess. As such, there will be a lot of rework involved as things begin to gel.

I've tried all manner of variations on the four types to try to get from a Bezier curve that is easily editable to a poly that will render and back again for editing.


Figured to use the negative line width trick on the polyline or two-point poly chains, if possible. If not, geometry for the diameter is OK.
Some of these changes will require significant alterations in path direction; some over a relatively considerable length. Editing by moving sets of points at joints isn't a happy prospect. Been there, done that; on a far simpler project. Having the ability to grab a handle or three and shift the wire's path by a large amount in two or three axes and have it be a smooth transition is the goal.
Thought that EasySpline would do what I need, but I just can't grok how to get it all to work. Some of the tools just don't seem to be doing what one would expect, and I've gone through a number of the videos; some of which go so quickly, it's difficult to follow.
Rail Extrude, LWCAD Pipe Tool and Line Tool obviously generate the required geometry with volume but, once the tool drops, it's no longer editable as a curve. Can't figure how to get them back to curve mode, once committed.
In my testing I did go back and forth: Curve to Poly > Poly to Curve, once but I'll be darned if I can remember how I did it. Usually involves merging points and then merging 2-point polys prior to back-conversion; and that's OK if that's what it takes. I was mildly shocked when it came back to a curve with handles and that derailed my brain. Maybe it was a fluke or I waking dreamt it. This was early on and it's been downhill ever since.
I could, of course, create the spline curves in a separate object, copy each of them to the real object, convert them to polys, test render, go back to the separate object, edit the curves, repeat; but that's a hassle and seriously confusion prone—what with all of the crisscrossing.
Yes, I could revert to a CAD application but that is the same as using a separate curves model; only worse. I'd like to keep it in LightWave, as that is where all of the previous work and renders have taken place.

Is there an efficient method of doing this, preferably right in the real model itself, either by directly rendering curves or by reciprocal curve/poly conversion?

Thanks for looking at this.

johnliebler
10-10-2014, 08:19 AM
I'm not exactly sure what you're trying to do, but some more tools to try for this kind of work are: ef Toggle Lines/Curves, which does just what it says. There is also cWorm from pictrix, which lets you save a curve after editing a rail extrusion. There's a free version, but if you try to use too many points it will crash modeler. Taz pipes is my favorite rail extrusion plugin, but it doesnt allow for saving the curve. Also, in Layout, you can have a spline control nested under another spline control, to allow for macro or micro editing. Lastly, I've "rendered" curves in layout by spline instancing thousands of spheres to a spline curve. Good Luck!

Sensei
10-10-2014, 09:27 AM
Suppose so you have long curve with just a few points on it (f.e. 5-10),
use EasySpline's Spline Density on it, to generate intermediate points,
https://www.youtube.com/watch?v=wfgTdxWSCCk

Then you have curve which has f.e. 100-200 points.
Select all edges of the curve in Edge mode,
copy'n'paste to 2nd layer,
and you have 2 point poly chain.
Which can be rendered by Render Lines.
Set Line Thickness of line in Object Properties > Edges.

Curves are not renderable so you have to freeze them to 2 point poly chain (at least) to visualize them in render.

jeric_synergy
10-10-2014, 09:51 AM
Not to sell you Yet Another Plugin, but perhaps the Rope Editor might have application here?

raw-m
10-10-2014, 12:49 PM
Have you tried DP's Spilne Deformer?

Model your wires in a straight line with loads of segments.

Also in Modeller in a separate file, create the path you need and make it an Open Curve, making a note the number of points. Save it in a file on its own.

Take your wires model into Layout. Run DP's Spline Deformer on it. Create Items: use the same number of nodes for it as there are points in your spline path. You'll have you wires still in a straight line but now being deformed by the nulls in the Spline Deformer list.

Now, simply "Load Pose from Spline", select your file with the open curve/spline. Your wires should run along the path you drew out in Modeller. It's now possible to tweak the position of path by moving the nulls and/or animate your wires along it using the one of Spline Deformers input.

inkpen3d
10-10-2014, 12:52 PM
I'd use a 2-point poly chain with negative line thickness applied to it and use DP Spline Deformer with the required number of knots to obtain the level of control you need.

There might be a better way to create the 2-point poly chain, but the method I use is to create a rectangle with lots of segments along the positive Z-axis and then delete one side leaving a 2-point poly chain. Make sure the poly chain has it's base is on the origin and that it extends along the positive Z-axis and then apply a surface with your chosen colour and with the smoothing option checked (so you get nice smooth bends in the wires). Save and send to Layout and apply the DP Spline Deformer node and turn on negative line thickness. The great thing about using negative line thickness is that you have a very low poly count and adjusting the thickness of your wires is so easy.

EDIT: raw-m just got there before me! ;)

raw-m
10-10-2014, 12:59 PM
I'd use a 2-point poly chain with negative line thickness applied to it and use DP Spline Deformer with the required number of knots to obtain the level of control you need.

There might be a better way to create the 2-point poly chain, but the method I use is to create a rectangle with lots of segments along the positive Z-axis and then delete one side leaving a 2-point poly chain. Make sure the poly chain has it's base is on the origin and that it extends along the positive Z-axis and then apply a surface with your chosen colour and with the smoothing option checked (so you get nice smooth bends in the wires). Save and send to Layout and apply the DP Spline Deformer node and turn on negative line thickness. The great thing about using negative line thickness is that you have a very low poly count and adjusting the thickness of your wires is so easy.

EDIT: raw-m just got there before me! ;)

2-point poly chain is a great idea. Remember, you can have loads of chains in one layer, perhaps twist them around each other a bit for extra variation.

prometheus
10-10-2014, 02:48 PM
px_bezier can draw lines without having to convert them to polychains, since that is created automaticly,
and thus they are directly renderabale.

you can also save out each drawn line formation with the save path options in px_bezier setup tab, it saves out as cfg files, which then can be loaded back and edited again, but you need to save the created drawn line before you drop the tool, once dropped you canīt edit it.
px_bezier in line mode will as mentioned render, but it canīt do curved lines/curves, for that you have to switch to curve mode, but then you have to convert it to polychain with lightwaves native command convert to polychain, before you can render that.

Not sure if that will help you with anything, except you can draw out a lot of wireīs and save out and reload back again different sections.

spherical
10-11-2014, 08:27 PM
(Was compiling this at 03:00 PDT and the power went out. No substitute for a good UPS; gave me time to save what I had to a text file.)
OK. Thanks, guys. Lots of good approaches. Here's what I've arrived at:


Had forgotten about Rope Editor. Took a look. Something of a learning curve, adopting a new tool, unsure if it would do what I want so I'll leave that for later.
DP Spline Deformer seems a bit disconnected for what I'm doing. Perhaps I'm not fully grokking the workflow but it would take working with it to know what is and isn't good to not do.
px_Bezier storing and reloading configs seems a bit of an interruption to the iterative workflow.

So, I've adopted a hybrid that works pretty well:

Assign "x" key to fire ef_ToggleLinesCurves.
Assign "Alt-x" key to fire EasySpline Spline Density.
LWCAD Line Tool : Create the curve with the number of handles required to manipulate it. I can work in the Perspective viewport and steer the wire around all of the stuff in the way and through the holes that it needs to pass, then refine with the node position and bezier handles. When satisfied that it's close, Commit.
LWCAD Curve to LWcur : Convert to LightWave native curve.
- or -
LightWave Point Tool > Create point series > Make Open Curve : Works as well and in some ways better, as it creates a native LWCurve directly; no conversion necessary. To shape its path, just move the points around.
Alt-x [EasySpline Spline Density] : Increase point resolution to desired smoothness when converted to 2-point polys. Drop tool.
! Select curve you're working on. (This is important; if you don't reselect the curve you just ran EasySpline Spline Density on (because it looks deselected as it runs—when you drop the tool, it is deselected), you'll toggle all of the curves on the layer; not only the one you just edited.)
x [ef_ToggleLinesCurves] : Convert to 2-point poly chain and the path shows up in Layout.

Editing:

Select a 2-point poly in a chain.
] : Select Connected.
x [ef_ToggleLinesCurves] : Convert 2-point poly chain back to curve. Path disappears from Layout.
Alt-x [EasySpline Spline Density] : Lower resolution to a minimal workable number of points for the task.
Refine path by moving points.
Alt-x [EasySpline Spline Density] : Increase point resolution to where it was. Drop tool.
(Re)Select curve. Don't forget!
x [ef_ToggleLinesCurves] : Convert back to 2-point poly chain and the edited path shows up in Layout.

SWEET!

Sensei
10-11-2014, 09:36 PM
Make 2 point curve, then press Spline Point, and click on such curve. You will be able to make points on it, or drag existing points to new locations. But first make sure RMB tolerance is right..

spherical
10-12-2014, 05:31 AM
Rats! I knew I forgot something. Don't bother setting surfaces for the 2-point poly chains until you're all done working with their shape. Toggling back to curves nukes the surface attributes.


Make 2 point curve, then press Spline Point, and click on such curve. You will be able to make points on it, or drag existing points to new locations. But first make sure RMB tolerance is right..

That works, too. Just seems more intuitive to set 5 or 6 points roughly where they need to go and Make Open Curve from them already in place, then refine if needed.

raw-m
10-12-2014, 06:09 AM
Not sure if it helps you but if you're using LWCAD, lw curve to polyline has the option to convert to 2 point polys with the ability to add points.

Rendering Curves in Layout surely has to be pretty high on the features request list!?

spherical
10-12-2014, 06:19 AM
Thanks. By the time I convert to poly chain, the point count is pretty high. It's the ability to lower it to varying numbers for sane editing as a curve and then raise it again for conversion and render that makes this work and not go out of your mind. With Spline Density, I can go down to three points from a 48 or higher point poly chain and go back up again; no matter how many original points I set to create the initial curve.

Sensei
10-12-2014, 11:09 AM
How you tried already TrueArt's Bezier (http://www.trueart.pl) custom polygon?

Unlike native LW bezier tool, it's bezier/b-spline all the time. So you have LWO with them for later day of work..

v1.7 have freezing mode 2 point poly chain.