From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "behavior" |
|---|
| subject | "Format:STL" |
|---|
| claim | "If the 80-byte binary STL header contains the text "COLOR=", assimp reads the next four bytes as the default RGBA colour of facets (each /255) and takes the Materialise path. A facet's own colour is used only when bit 15 of its 2-byte attribute word is set (for every STL, with or without COLOR=); it is three 5-bit channels (/31, alpha 1.0), blue in the low 5 bits normally but red in the low 5 bits on the Materialise path." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "binary STL from Materialise-style writers, as handled by assimp" |
|---|
| observed_in | |
|---|
|
|---|
| data | | trigger | "COLOR= found in header bytes 0-79" |
|---|
| effect | "default colour set, bIsMaterialise reverses 5-bit channel order" |
|---|
| condition | "per facet: attribute word bit 15 set; channel order reversed only when COLOR= was found" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "header search and the reversed order branch" |
|---|
| repo | "https://github.com/assimp/assimp" |
|---|
| commit | "f20e46b3fc1fdf9bc2675fd549d180dda06861f1" |
|---|
| path | "code/AssetLib/STL/STLLoader.cpp" |
|---|
| lines | "428-452, 515-523" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "COLOR= in the 80-byte header" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-19T07:38:16.850Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T08:36:45.717Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read STLLoader.cpp at f20e46b lines 420-460 and 495-523: COLOR= search in first 80 bytes, 4 bytes /255, bit 15 gate, /31 channels, reversed order when bIsMaterialise. Not in the fact: default colour is 0.6 grey without COLOR= and LoadBinaryFile's return also sets the material diffuse." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T08:04:22.276Z" |
|---|
| summary | "Added what the code gates on: per-facet colour is used only when bit 15 of the 2-byte attribute is set, with 5-bit channels (/31) and alpha 1.0; the Materialise path only reverses channel order…" |
|---|
| changed | |
|---|
|
|
|---|