Question 1: how to tell the similarity of 2 colors. Lego uses only a limited color set. I’ve to choose a similar color during write a dat file. I’ve tried
|FaceColor.R-LegoColor.R|+|FaceColor.G-LegoColor.G|+|FaceColor.B-LegoColor.B|
and
|FaceColor.R-LegoColor.R|^2+|FaceColor.G-LegoColor.G|^2+|FaceColor.B-LegoColor.B|^2
to get the lego color, which results in a min in the above formulas. But they often pick up a incorrect color.
Question 2: add face without adding dupliacted vetrex? I know a veterx list and a face list will work, but if there are many faces, the lists grow heavily. Can python script do ‘remove dup’?
Current state - very elementary
write
mesh: done
color: wip
read
type 0, Comment or META Command: wip
type 1, Part file reference: wip, the most complex parts
type 2, Line: done
type 3, Triangle: done
type 4, Quadrilateral: done
type 5, Optional Line: wip