Tue, 03/12/2024 - 14:42
Hello,
Does Current version v7.8.0 (or previous one like v7.7.0) use the same methods to get label colors as it does the CAD Assistant tool?
In our case we are facing the same issue since v7.7.0, where on IGES files we are unable to get colors from labels.
Things that we know:
- CAD Assitant reads those colors as we can see them on its viewer.
- IGES contains colors as when we read the label COLORS, we get all of them. This is an example code of what we are doing to read them:
auto colorTool = XCAFDoc_DocumentTool::ColorTool(occtDocument->Main()); TDF_LabelSequence colorsSequence; colorTool->GetColors(colorsSequence); for (TDF_LabelSequence::Iterator it(colorsSequence); it.More(); it.Next()) { auto colorLabel = it.Value(); Quantity_Color color; colorTool->GetColor(colorLabel, color); }
Things that we tried and didn't worked:
- Reading the colors from shapes using revert iteration.
Didn't work with any of the IGES files that we are facing this issue.
- Reading colors from a certain label:
void OcctLabelTraversal::ReadLabelColor(const TDF_Label& label, OcctLabel* pLabel) { Quantity_Color color; color.SetValues(0.5, 0.5, 0.5, Quantity_TOC_sRGB); if (colorTool->GetColor(label, XCAFDoc_ColorType::XCAFDoc_ColorSurf, color)) { //do something with color } // repeated if for XCAFDoc_ColorGen and XCAFDoc_ColorCurv }
- We make sure that SetColorMode is set to true:
auto reader = IGESCAFControl_Reader(); reader.SetColorMode(true);
- Trying to see the IGES file through Inspector always crash when we try to open it.
Please find attached the IGES file compressed in order to check it if you consider it.
Is that an issue from the IGES reader? What are we doing wrong? I want to repeat that CAD Assistant displays those colors properly.
Kind regards,
Lorenzo Navarro
Tue, 03/12/2024 - 19:38
Duplicated theme by error, please visit:
https://dev.opencascade.org/content/issue-reading-colors-compared-cad-as...