LDraw.org Discussion Forums
separating metal portions of 9V train track - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: Models and Parts (https://forums.ldraw.org/forum-18.html)
+--- Forum: Parts Authoring (https://forums.ldraw.org/forum-19.html)
+--- Thread: separating metal portions of 9V train track (/thread-6423.html)



separating metal portions of 9V train track - Steffen - 2012-10-13

I was wanting to separate the metal portions of
http://www.ldraw.org/cgi-bin/ptdetail.cgi?f=parts/2859c00.dat
into 1 or more separate files.

Reason for this was that in the current implementation,
when you use that part in a model,
and you assign some color to it,
all edges on metal appear in that color,
this makes that part look weird.

Reason for that is that all edges and optional edges in that file
are coded in color 24, regardless whether they bound plastic or metal parts.

My problem is now this:

I can easily identify quads and triangles of color 494 (metal) and move them to a separate file.
Second step should have been to also move their bounding edges and optional edges there.

Would I have finished that, then the color problem would be gone, because in that new file X.dat,
I would use color 16 for quads and triangles, and 24 for edges and optional edges,
and then reference that file from 2859c00.dat, using color 494. This way, both the surfaces and
the edges would appear in correct color.

However, identifying which edges to move to X.dat is terribly difficult.
There are tons of such edges, and manual selection will introduce lots and lots of errors.

To accomplish this task, I would need help of a tool which doesn't exist yet.

It would let me specify some color, by which I would like to identify affected quads and triangles
(here: 494).
The tool should then run through the file and identify all edges and optional edges which bound
these, i.e., which share coordinates with them.

Using such a tool, it would be easy to find all edges in 2859c00.dat which need to be moved to a separate file.

(Of course, from a logic point of view, each own metal portion should probably go into its own,
separate ~part file, but to me that's second priority. Solving the miscolored edges problem has first.)

Unfortunately, without this tool, I sadly have to give up on this task for now :-(


Re: separating metal portions of 9V train track - Magnus Forsberg - 2012-10-13

Don't give up too soon. All you need is Edger2.

Since both files should carry its own edge lines, all you need to find is the triangles and quads that make up the metal part, all in colour 494, and move them to a separate file, and apply Edger2 to it. It will create the missing edge lines you are trying to find.

But yes, you also need to find the unneccesary edge and condlines in the parent file, but that shouldn't be too difficult in MLCad.


Re: separating metal portions of 9V train track - Steffen - 2012-10-14

yes, I've already tried this.
it is easy to move the metal quads and triangles to a separate file and then apply edger 2.
the difficult part is,
getting rid of these (now superfluous) edges in the original file.
many of them are e.g. optional lines, and cannot properly be selected with the mouse.
others prolong and don't share coordinates with quads, but instead extend from metal to plastic parts,
so they need to be shortened, not removed.
this is where I gave up :-(


Re: separating metal portions of 9V train track - Philippe Hurbain - 2012-10-15

I agree it's far from obvious here... It should be possible to cobble something using Edger2 engine. What it would do is accept a key color from command line, then color any line or condline with the same key color if they border one (optionnaly two) key colored surfaces. I don't promise anything yet, I have to be in the right mood to write software...


Re: separating metal portions of 9V train track - Magnus Forsberg - 2012-10-15

Would it work to just ditch all line type 2 and 5, and create new lines with Edger2, or are there to many unmatched edges?


Re: separating metal portions of 9V train track - Philippe Hurbain - 2012-10-15

I made a quick test, doesn't look very good Sad