T-Junctions re-visited


Re: T-Junctions re-visited
#49
Ben Supnik Wrote:3626bpn1.dat contains T junction errors at the bottom of the side markings of the face - the bottom trapezoid pattern is subdivided quite a bit more heavily than the Torus primitive used to make the minifig head bottom. To 'fix' this a program would have to analyze these parts together (3626bpn1.dat and the sub-part to4o6250.dat) and chop up the top the torus to match the face pattern.

I agree that in light of this, it's not possible to eliminate cross-file T-Junctions in the library. However, since I don't think it will ever be possible to efficiently auto-detect and remove T-Junctions at load time (on things like the 48x48 baseplate, for example), I wonder if perhaps something else can be added to the library to indicate their presence. I could see either having a meta-command indicating the presence of T-Junctions, or a separate computer-generated file for the whole library that does the same thing.

The meta-command would be an indicator that the following line introduces a T-Junction. Something like:

Code:
0 !TJUNC 1 3
3 16 0 0 0 1 0 0 1 1 0

The above example would be interpreted to mean, "The following triangle might introduce T-Junctions at vertices 1 and 3." Ideally this meta-command would be auto-generated (at library publishing time?), so that part authors wouldn't have to worry about it. Programs would then only do T-Junction detection on the vertices indicated by the meta-command. This would seriously decrease the load-time performance hit. Note that the presence of the meta-command doesn't guarantee a T-Junction, since the sub-file could be used in multiple parent files, and only introduce T-Junctions in some configurations. But programs completely ignore the possibility of T-Junctions for all geometry not having such a meta-command.

The problem with this meta-command approach is that it ideally needs to be automated, and the library isn't really set up for automated behavior like this. Hence, my alternative suggestion, which is a file that sits alongside the library and contains all the information for all T-Junctions in the library. It would definitely be computer-generated, and this would presumably happen as part of the process of publishing the library (although users would be allowed to regenerate the file themselves on their own library if desired). I really don't have a very good idea how long it would take to scan all files in the library and note all the T-Junctions, but I can't see it being more than an hour or two tops on a modern computer (and hopefully quite a bit less than that).

While ideally this separate file would be part of the official library, it doesn't have to be, as long as it can be made available to users of programs that depend upon it. We would definitely want to make sure the file was easy to make use of though, so some thought would have to go into its format. And I definitely think there should be one single format for this file (possibly extensible).

Another alternative is for programs that do T-Junction detection to have their own cache of detected T-Junctions. So the information would be similar to what I describe above, but the program would automatically do the T-Junction scan any time it loads a part that either doesn't have cached T-Junction data, or where the timestamp has changed. (This is complicated by the fact that the part file itself won't necessarily update; any one of its sub-files could update, so the timestamp information would have to be for each sub-file, not just for the whole part.) This kind of caching could be done by any program, but it's a fair bit of extra work that every program author would then have to undergo. I've actually seriously considered having LDView have an option to auto-cache loaded parts in order to speed loading of files, but never did so due to the complexity involved.
Reply
« Next Oldest | Next Newest »



Messages In This Thread
T-Junctions re-visited - by Travis Cobbs - 2013-03-12, 5:38
Re: T-Junctions re-visited - by Tim Gould - 2013-03-12, 6:31
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-12, 18:17
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-12, 18:32
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-12, 18:55
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-13, 18:27
Re: T-Junctions re-visited - by Allen Smith - 2013-03-12, 21:01
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-13, 17:37
Re: T-Junctions re-visited - by Tim Gould - 2013-03-13, 21:31
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-17, 15:43
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-17, 16:02
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-18, 5:09
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-18, 14:30
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-18, 17:57
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-18, 18:27
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-18, 19:23
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-18, 20:41
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-18, 21:59
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-19, 1:09
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-19, 18:43
Re: T-Junctions re-visited - by Tim Gould - 2013-03-20, 10:56
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-20, 17:13
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-20, 17:23
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-20, 17:29
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-20, 17:26
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-20, 18:18
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-20, 13:42
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-20, 13:58
Re: T-Junctions re-visited - by Allen Smith - 2013-03-20, 16:08
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-20, 18:50
Re: T-Junctions re-visited - by Tim Gould - 2013-03-13, 22:56
Re: T-Junctions re-visited - by Sergio Reano - 2013-03-13, 22:51
Re: T-Junctions re-visited - by Tim Gould - 2013-03-14, 0:10
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-15, 3:17
Re: T-Junctions re-visited - by Tim Gould - 2013-03-15, 3:41
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-15, 17:56
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-14, 1:58
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-14, 2:37
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-14, 3:18
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-14, 22:23
Re: T-Junctions re-visited - by Tim Gould - 2013-03-14, 22:41
Re: T-Junctions re-visited - by Tim Gould - 2013-03-14, 2:43
Re: T-Junctions re-visited - by Tim Gould - 2013-03-14, 3:18
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-15, 3:15
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-15, 19:27
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-16, 0:08
Re: T-Junctions re-visited - by Ben Supnik - 2013-03-17, 15:58
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-18, 19:28
Re: T-Junctions re-visited - by Travis Cobbs - 2013-03-18, 19:32
Re: T-Junctions re-visited - by Sergio Reano - 2013-03-26, 21:46
Re: T-Junctions re-visited - by Sergio Reano - 2013-03-27, 20:48

Forum Jump:


Users browsing this thread: 2 Guest(s)