How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers)

Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers)
#4
Paul Griffin Wrote:2. Huh; I did not think about that. I can definitely think of cases where there wouldn't be conditional lines but you'd want smoothing (e.g, the interior of a funnel). Speaking of conditional lines, do you just brute force them and draw them one at a time? There's got to be a faster way to handle them...

As it happens, LDView implements two different smoothing algorithms:
• The first is as described above, and is used by the interactive 3D part of LDView. It does indeed produce very good results for most parts, but doesn't for some parts (like the minifig heads). It also requires an angle threshold, because certain geometry (for example, a sharp cone), cannot be properly smoothed, no matter what you do.
• The second is similar, but instead of using conditional lines to detect smooth surfaces, it uses edge lines to detect creases (along with an angle threshold). LDView uses this algorithm for its POV export. This is closer to a typical "smooth all adjacent faces whose difference in angle is less than x degrees" algorithm, but the edge lines give it extra data that these types of algorithms typically don't have, so the angle threshold can be set relatively high while still producing good results.
Unfortunately, the two algorithms work on completely separate input data, so I can't directly compare them in the real-time 3D part of LDView, and they're both what I would call non-trivial. So, to be honest, I'm not sure which is best, but my gut feeling is that the algorithm I use for POV export is better. (Having said that, I don't think it does any better on minifig faces than the other algorithm, although I haven't thoroughly investigated this.)
« Next Oldest | Next Newest »

 Messages In This Thread How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Paul Griffin - 2012-12-17, 3:59 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Nicola - 2012-12-17, 16:06 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Paul Griffin - 2012-12-17, 20:37 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Travis Cobbs - 2012-12-18, 2:47 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Tim Gould - 2012-12-18, 21:12 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Tim Gould - 2012-12-18, 21:55 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Travis Cobbs - 2012-12-19, 17:31 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Ken Drew - 2012-12-19, 17:40 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Steffen - 2012-12-19, 18:01 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Ken Drew - 2012-12-19, 18:14 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Travis Cobbs - 2012-12-19, 18:33 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Steffen - 2012-12-19, 18:43 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Ken Drew - 2012-12-19, 19:21 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Ken Drew - 2012-12-19, 19:14 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Paul Griffin - 2012-12-19, 20:06 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Ken Drew - 2012-12-19, 20:30 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Allen Smith - 2012-12-19, 19:38 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Allen Smith - 2012-12-19, 20:46 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Paul Griffin - 2012-12-19, 19:50 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Allen Smith - 2012-12-19, 20:27 Off-topic rant: Re: How I learned to stop worrying... - by Tim Gould - 2012-12-19, 20:35 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Paul Griffin - 2012-12-19, 20:48 Re: How I learned to stop worrying and love Ldraw. (Subtitle: questions for programmers) - by Allen Smith - 2012-12-19, 21:08

Forum Jump:

Users browsing this thread: 1 Guest(s)