leocad icon indicating copy to clipboard operation
leocad copied to clipboard

Color of edge lines of mixed-color pieces incorrect

Open j6t opened this issue 3 years ago • 2 comments

Look at this screenshot:

image

These are two pieces 122c03.dat (Plate 2 x 2 with Red Wheels and Tyres...).

The version with opaque orange color has dark gray or black edge lines everywhere. This is correct.

The version with transparent orange color, however, has orange edge lines everywhere, even in the opaque sub-parts. This is incorrect. These sub-parts should also have dark gray or black edge lines.

j6t avatar Apr 02 '21 12:04 j6t

I think the way I draw is technically correct according to the spec:

Colour 24 is referred to as the "complement colour" or "edge colour". Colour 24 is most commonly used for line types 2 (line) and 5 (optional line). When a sub-file is referenced by another file all the colour 24 command lines are displayed using the complement colour of the line that referenced it. The complement colour of a given colour is defined in the Colour Definition for that colour.

Example: 1 4 0 0 0 1 0 0 0 1 0 0 0 1 part.dat

All the colour 24 command lines in part.dat will be displayed using the complement colour of colour 4

The other apps I checked don't follow it, and I think they look better, I'll take a look.

leozide avatar Apr 04 '21 18:04 leozide

Ah, I see. I thought that the transparency has something to do with it, but that is not the case: if you pick an opaque color with a light edge line color, such as Dark Brown, the same happens: image

I don't think that the spec is ambiguous, or that other renderers (mis-)interpret it is just to get an aesthetically better result. In the case of 122c03.dat, we have

1 16 0 0 0 1 0 0 0 1 0 0 0 1 122c01.dat
1 256 -31 6 0 0 0 -1 0 1 0 1 0 0 3641.dat
1 256 31 6 0 0 0 1 0 1 0 -1 0 0 3641.dat

Clearly, the two 3641.dat lines reference sub-files, and then the 24 lines within 3641.dat must use the complement color of the line that referenced the sub-file, which is 256 in this case.

j6t avatar Apr 05 '21 07:04 j6t