To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cadOpen lugnet.cad in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / 15834
15833  |  15835
Subject: 
Re: Colinear Vertices
Newsgroups: 
lugnet.cad
Date: 
Thu, 11 Dec 2008 19:23:17 GMT
Viewed: 
6055 times
  
In lugnet.cad, Philippe Hurbain wrote:
Thanks, Travis. BTW, are there guidelines for part authors that would improve
smooth shading?

Not that I know of.  I'll think about adding a page to the LDView web site.  (I
don't think it's really appropriate to add it to ldraw.org, since it's
LDView-specific.)


What about precision in coincidence between conditional lines and matching
polygon sides? I have seen _many_ instances where a quad should blend into a
primitive thanks to a well placed condline, but doesn't - I guess because of
precision issues during primitive scaling/rotation.

The precision is 0.0001.  I multiply the coordinate by 10000 and then convert
the resulting x,y,z values to integers.  I then use these integers for all
equality checks.  That does mean that LDraw models using coordinates that result
in a real-world size greater than around 85 meters could cause wrap-around in my
calculations, and coordinates that are quite a bit less than that would result
in sub-ldraw-unit precision problems, but I suspect that the rate of
false-positives in such situations would be low.  I haven't had anyone complain
about it.

I also have a 50 degree threshold: LDView won't smooth two surfaces that have an
angle between them that is greater than 50 degrees.  It probably wouldn't be
that high except for the fact that low-res studs have 45 degrees between the
faces, and I added in a little extra leeway.

There is one other restriction that is important.  I only notice conditional
lines if BOTH ends match BOTH ends of the polygon edge.  So if you use one
conditional line to span along an edge that has one or more vertices ALONG the
conditional line, no smoothing will be done.  The way that conditional lines are
used in parts ends up making this problem significantly less common than might
be expected.


Similarly, assembling mirrored subparts that should form a smooth surface work
well, but if they are rotated I generally see the seam since there is rounding
error, and condline smoothing doesn't happen.

I could easily decrease my precision.  Do you have a specific part that you
could point me to as an example?  Given that the official part restrictions
document gives a precision of three decimal places, perhaps I should drop mine
to .001, instead of .0001.  Or maybe .005.  I plan to have an LDView 4.0 Beta 2
release, so at least I'd have a chance to get feedback.  Thoughts?

On a related note, I have long considered an optional inverted smoothing
algorithm for LDView, where it smooths adjacent faces that DON'T have a type 2
line between them, instead of smoothing faces that DO have a type 5 line between
them.  The problem there is that I would probably have to detect when polygon
points lie along the line, instead of just checking the line end-points.

--Travis



Message has 1 Reply:
  Re: Colinear Vertices
 
(...) It makes sense! (...) An example, this button: (URL) I rounded condlines to 2 decimal places since I couldn't get smoothing anyway. I did more experiments, with full precision in condline it works: (URL) but after rounding to 3 dp there is no (...) (16 years ago, 12-Dec-08, to lugnet.cad)

Message is in Reply To:
  Re: Colinear Vertices
 
(...) Thanks, Travis. BTW, are there guidelines for part authors that would improve smooth shading? What about precision in coincidence between conditional lines and matching polygon sides? I have seen _many_ instances where a quad should blend into (...) (16 years ago, 11-Dec-08, to lugnet.cad)

39 Messages in This Thread:









Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR