
Tue, 06/11/2019 - 14:11
Hi,
I am facing problem to get surface level colors in OpenCascade.
Here is the scenario;
I am trying to read STEP file with STEPCAFControl_Reader.
I am able to get number or all the colors available in a STEP file. Suppose i have 1 cube(STEP file) with all 6 faces with 6 different colors.
I able to get correct information about colors or color count with XCAFDoc_ColorTool.
When i traverse the step file with XCAFDoc_ShapeTool i get 1 body as TopoDS_Shape and when i get color of that body with XCAFDoc_ColorTool.
if (colorTool.GetColor(refShape, XCAFDoc_ColorType.XCAFDoc_ColorGen, ref col))
{
colName = col.Name();
}
else if (colorTool.GetColor(refShape, XCAFDoc_ColorType.XCAFDoc_ColorSurf, ref col))
{
colName = col.Name();
}
I get color of only one face (Inside else if (colorTool.GetColor(refShape, XCAFDoc_ColorType.XCAFDoc_ColorSurf, ref col))).
Now, i have 3 questions;
1. How do we know the TopoDS_Shape has surface level colors? &
2. How can we get surface level colors in a TopoDS_Shape?
3. Also i want to know how can i create a TopoDS_Shape(Single body) with multiple or differrent face level colors?
Thank you in advance.
-Vishwas.
Wed, 06/12/2019 - 15:36
Hello All,
Can anyone please at least suggest me a way to know if TopoDS_Shape has surface level colors or not.
Your time would be appreciated greatly in advance.
Thanks
Tue, 10/15/2019 - 09:28
encounter the the same issue, cannot know how to get the color of the relative surface . seems the interface colorTool.GetColor(refShape, XCAFDoc_ColorSurf, ref col) failed. hoping someone help too
Mon, 08/31/2020 - 21:56
I confirm that the interface colorTool.GetColor() is broken since 7.4.0 (or since 7.x.x as i was using 6.9.1). The 7.4.0 broke all my pipeline with the colours.
The following code is broken since 7.4.0 :