To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.dat.partsOpen lugnet.cad.dat.parts in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / LDraw Files / Parts / 6086
6085  |  6087
Subject: 
Part Authors: opinions sought on T-Junctions
Newsgroups: 
lugnet.cad.dat.parts
Date: 
Sun, 4 Mar 2007 06:39:21 GMT
Viewed: 
6014 times
  
If you are a part author, I’d appreciate it if you read this post. I know it’s long, but it needs to be in order to correctly describe the issue.

When looking at one one of the parts in the inaugural Part of the Month contest in LDView (on my work machine that has an ATI video card), I noticed some dots floating along some of the seams along the underside. After looking at the file in wireframe, I came to the conclusion that these dots were caused by T-junctions in the mesh. T-junctions are something that show up a lot in part files, and it’s my opinion that an effort should be made to stop having them. However, getting rid of them usually requires the addition of one extra polygon (triangle or quad) per T-junction, and this is at odds with the general goal in part files to use as few polygons as possible.

Since most people probably have no idea what I mean when I say T-junction (to be honest, I’m not even sure that’s the correct technical term), I need to describe both what a T-junction is, and why I think it’s bad to have them.

Simply put, a T-junction is a spot where two polygons meet along the edge of another polygon, like so:



If these occur in a random location along a diagonal edge, it’s often the case that the precise coordinates of the junction cannot be put into the DAT file. Many people would agree that that would be bad. However, when they occur at precise coordinates, it’s tempting to say that there’s nothing wrong with them, since there shouldn’t be any round-off problems. Unfortunately, when you go to arbitrary 3D views, this turns out not to be the case.

It turns out that a 3D rendering engine can only guarantee that a closed polygon mesh is tight (no visible gaps) if the mesh does not contain any T-junctions. The reason for this is that once you start rotating things in 3D, the precise coordinates stop being precise. The following illustrates this problem:



Notice the white dots. If you view the file in wireframe, you’ll see that these dots occur along the seams between polygons. Please note that the actual coordinates of all the points in the file are fine (as far as I know; I haven’t checked, but I believe Mike). The dots are there because from that point of view, the edges are diagonal, and diagonal edges require rounding. Essentially, the rounding cannot be guaranteed to be the same on the polygons along the edge if those polygons don’t share common end-points on both ends.

This may be difficult to understand. Hopefully the following will illustrate the point:




The above images were done in Microsoft Paint (then blown up by 800%), with two sets of lines that are designed to be right next to each other. The image on the left represents the T-Junction case. The one on the right represents the case without a T-junction. As you can see, there are gaps in the image on the left. This isn’t quite the same as T-junctions in a part file, since the above sets of lines were drawn with 1 pixel difference. However, since 3D renderers are representing adjoining polygons with an infinitely thin edge between them, it actually works out to a very similar problem. (Note that the red line in the left image was actually drawn starting at the bottom-most green pixel, and the green line was then drawn with the same end-point.)

Now, having said all this, I’ll mention that the dots aren’t visible with this file on my nVidia video card at home. I have verified that the dots show up in other files with T-junctions. Note that I disabled primitive substitution and curve smoothing in LDView to make absolutely sure that LDView was only displaying the actual geometry from the file.

I don’t know if the problem shows up in POV-Ray renderings. I did some quick checks and didn’t see the problem, but that doesn’t prove that the problem won’t show there. It just proves that POV-Ray at the very least seems to be more resistant than LDView. However, I would like to stress that the dots are NOT due to a bug in LDView. They aren’t something I have any control over (short of splitting polygons when I load the part, and I’m not going to do that).

So, what do you as part authors think? Should T-junctions be avoided in order to avoid the rendering errors that they can introduce, or should part authors continue to strive to make parts with the fewest number of polygons possible?

--Travis



Message has 4 Replies:
  Re: Part Authors: opinions sought on T-Junctions
 
(...) I try to minimise file size whenever possible myself and have nothing against T juctions. While the gaps can be annoying I feel that they are a fault of the rendering program rather than the parts. (18 years ago, 4-Mar-07, to lugnet.cad.dat.parts, FTX)
  Re: Part Authors: opinions sought on T-Junctions
 
(...) It's possible that by setting up meshes POVray can largely avoid the problem as it rotates points and then joins them. My opinion is that Part Authors should stick to keeping the polygon count down rather than jumping through hoops to try to (...) (18 years ago, 4-Mar-07, to lugnet.cad.dat.parts, FTX)
  Re: Part Authors: opinions sought on T-Junctions
 
(...) in all the parts I've made so far there is just one with a t-junction: (URL) (if I remember correctly it's where the two red quads are surrounded by the white border) but it is forgiveable I think, as it was one of the first parts I've ever (...) (18 years ago, 4-Mar-07, to lugnet.cad.dat.parts, FTX)
  Re: Part Authors: opinions sought on T-Junctions
 
(...) This is a really old issue. I think the previous consensus was that (URL) T-Junctions are bad.> Look at the bottom of the message for the comments on T-Junctions. Actually this is such an old issue, I could swear there was an ASCII art (...) (18 years ago, 4-Mar-07, to lugnet.cad.dat.parts, FTX)

22 Messages in This Thread:







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

Custom Search

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