LDraw.org Discussion Forums

Full Version: Springs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi I'm working on a spring generator for LDCad, and was wondering how far I should take the details.

I've looked at the existing springs in the library, and noticed they don't have conditional lines in the way I would expect them. They also use static lines around the (very low res) wire edges.

Is this on purpose or pure some performance issue ?

Anyway this is what my current code generates (no lines at all).

[Image: springs.png]
Well, the springs are mostly done by the spring generator which is included in MLCad. And therefore there are no lines at all.
However, I don't like this behavior. I like complete part WITH all lines. See discussion at this (sub-)part s/70181s00.dat

The shape of your springs is incredible. I really like it.

My opinion is that simplest is best, for performance reasons. You can't see the small details at this scale. Anyway, your rendering looks excellent!
Thanks to you both,

I can see how file size might become a problem, these test renderings are already using 5000 triangles (or 2500 quads, but I'm not sure they are all flat).

OpenGL wise this isn't a problem, but when I add the wire endings and all conditional lines you are looking at ~15000 LDraw lines Smile Maybe I need to (optional) dial down the resolution for the LDraw output.
Yes, please do that. Just such parts can be extremely large if we go too much in detail. Maybe it would be a good idea to create a low res version of such a spring that will be written in ldraw file format and if showing the model you choose how much details needs to be drawn. I do not know how this can be achived, but it should be worth to think about.
Currently the user can input coil (def 24) and wire resolution (def 8), I'll add second boxes for the LDraw code version.

In LDCad itself it will always regenerate the spring for rendering, and thus use the hq values. But other software will only use the ldraw fallback code and thus render the lower quality version, unless they generate the spring too (based on the spring meta's, it's actually not that hard compared to flexible hoses etc).
Ok I've added conditional lines.

Attached are two samples. I would appreciate it very much, if someone would take a look at them from a part author's point of view.

Personally I think ~0.5 MB for a spring/shock part isn't that bad. This is using a resolution of 16 for the coil and 8 for the wire.
I know that we have some authors who will say: "What 0.5 MB for a Spring?" ;-)
I times, where we are speaking in TB in a normal consumer PC, this is quite OK with me. I did just a very quick visual check of these files and I really like the springs.

The only issue I can find is incorrect use of colour 80 on a metal part.
All metal parts, like axles, screws, electric contact plates, plugs and springs, must use colour 494.

And why don't you use standard edge colour 24?
Generally I am fine with the result. But the question for edgeline colour is a good question. I have changed the colour to value 24 and it still looks goods. I feared that it would be only all black, but that occur only if I go far far away.
Pages: 1 2