Tue, 10/03/2023 - 16:24
Dear OCCT community,
when I use CAD assistant to read a STEP file and I open material manager I see this:
When I read color by using XCAFDoc_ColorTool as colorReader->GetColor(label, XCAFDoc_ColorSurf, color) I will get color circled as blue #101603FF, which is too dark .
How should I read color in different way to get the correct one, circled as red #495421 .
Thank you for help.
Best Regards
Pavel Chmelar
Thu, 10/05/2023 - 00:16
Hello, which version of OCCT do you use? CAD Assistent use the same color system as native OCCT XCAF.
Best regards, Dmitrii.
Thu, 10/05/2023 - 10:53
Hello, I'm using the latest version 7.7.2.
I've found this lesson on Quaoar and it seems that I need to iterate also through faces, because this model (see the attachment) in CAD Assistant:
I reading as:
When I go through assembly I reading only the blue part of a wheel (oposit side of wheels is not visible because of normals, when I rotate the model all four wheels are visible). The red part is missing.
Best Regards
Pavel
Thu, 10/05/2023 - 11:01
The first color hex name is generated by
XCAFDoc_ColorTool::AddColor()
method and the second one - byQuantity_ColorRGBA::ColorToHex()
. The second method converts color from linear to non-linear sRGB color space, while the first one converts values to hex directly, which is wrong. I think it is a bug inXCAFDoc_ColorTool::AddColor()
.Wed, 10/25/2023 - 09:23
Thank you very much @gkv311 n. It's exactly this reason why the color was wrong.
To my post above. The model wasn't complete because I didn't expected that a top shape itself with some sub-shapes contains also space data.
Best Regards
Pavel
Mon, 11/13/2023 - 19:27
Hi
I am quite new here. I am using version 7.7.0 to read STEP files.
I can't get the color from a STEP file generated by SolidWorks with all COLOUR_RGB labels apparently in place.
I try the standard:
Handle(XCAFDoc_ColorTool) ColorTool = XCAFDoc_DocumentTool::ColorTool(mainLabel);
Quantity_Color color;
Standard_Boolean ok = ColorTool->GetColor(label, XCAFDoc_ColorSurf, color);
It always returns false.
Should I move to 7.7.2 ? Where can I download it ?
Or do I need colors saved by SW in a particular manner ?
Thanks in advance
Mon, 11/13/2023 - 23:06
label should contains a color? 7.7.2 have no updates about color extractions
Best regards, Dmitrii.
Wed, 11/15/2023 - 22:37
Dimitrii
Forgive my poor background on STEP format. I just dropped here a week ago.
I understand every shape is associated to a label, and there is entities that are descendents of either. I am trying to find what descendent entities they have so I can find the one containing color information.
I was trying to follow the tree structure so I can see what information is associated to every shape. I am trying to build a small STEP->to->STL converter and add relevant information to the STL header for every shape I find.
Any help on that direction will be appreciated.
Thanks in advance.
Josep