From 1f6245a7f11b64d95e2dc6c2c7c9df33ce7b61a7 Mon Sep 17 00:00:00 2001 From: snoyer Date: Fri, 2 Feb 2024 10:11:37 +0400 Subject: [PATCH 1/4] add last edge segment --- plugins/occt/module/vtkF3DOCCTReader.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/occt/module/vtkF3DOCCTReader.cxx b/plugins/occt/module/vtkF3DOCCTReader.cxx index 1088ceba0d..3a8e8a4fa4 100644 --- a/plugins/occt/module/vtkF3DOCCTReader.cxx +++ b/plugins/occt/module/vtkF3DOCCTReader.cxx @@ -134,7 +134,7 @@ class vtkF3DOCCTReader::vtkInternals uvs->InsertNextTypedTuple(fn); } - std::vector polyline(nbV - 1); + std::vector polyline(nbV); std::iota(polyline.begin(), polyline.end(), shift); linesCells->InsertNextCell(polyline.size(), polyline.data()); From 0ace9418efae0c7e44df243c1ef29cb34e4f852d Mon Sep 17 00:00:00 2001 From: snoyer Date: Fri, 2 Feb 2024 10:14:06 +0400 Subject: [PATCH 2/4] read parent shape color if needed --- plugins/occt/module/vtkF3DOCCTReader.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/occt/module/vtkF3DOCCTReader.cxx b/plugins/occt/module/vtkF3DOCCTReader.cxx index 3a8e8a4fa4..e9cb29f8b5 100644 --- a/plugins/occt/module/vtkF3DOCCTReader.cxx +++ b/plugins/occt/module/vtkF3DOCCTReader.cxx @@ -143,7 +143,8 @@ class vtkF3DOCCTReader::vtkInternals { std::array rgb = { 0, 0, 0 }; Quantity_Color aColor; - if (this->ColorTool->GetColor(edge, XCAFDoc_ColorCurv, aColor)) + if (this->ColorTool->GetColor(edge, XCAFDoc_ColorCurv, aColor) || + this->ColorTool->GetColor(shape, XCAFDoc_ColorCurv, aColor)) { rgb[0] = static_cast(255.0 * aColor.Red()); rgb[1] = static_cast(255.0 * aColor.Green()); @@ -249,7 +250,8 @@ class vtkF3DOCCTReader::vtkInternals { std::array rgb = { 255, 255, 255 }; Quantity_Color aColor; - if (this->ColorTool->GetColor(face, XCAFDoc_ColorSurf, aColor)) + if (this->ColorTool->GetColor(face, XCAFDoc_ColorSurf, aColor) || + this->ColorTool->GetColor(shape, XCAFDoc_ColorSurf, aColor)) { rgb[0] = static_cast(255.0 * aColor.Red()); rgb[1] = static_cast(255.0 * aColor.Green()); From c1fe9f5ed2e77b4fb581afdf21af86944108405c Mon Sep 17 00:00:00 2001 From: snoyer Date: Fri, 2 Feb 2024 10:14:24 +0400 Subject: [PATCH 3/4] add colors test --- application/testing/CMakeLists.txt | 2 ++ testing/baselines/TestXCAFColors.png | 3 +++ testing/data/xcaf-colors.stp | 3 +++ 3 files changed, 8 insertions(+) create mode 100644 testing/baselines/TestXCAFColors.png create mode 100644 testing/data/xcaf-colors.stp diff --git a/application/testing/CMakeLists.txt b/application/testing/CMakeLists.txt index 85084c05a5..a46cd88cde 100644 --- a/application/testing/CMakeLists.txt +++ b/application/testing/CMakeLists.txt @@ -571,6 +571,8 @@ if(F3D_PLUGIN_BUILD_OCCT) f3d_test(NAME TestInvalidBREP DATA invalid.brep ARGS --verbose --load-plugins=occt NO_BASELINE) if(F3D_PLUGIN_OCCT_COLORING_SUPPORT AND NOT F3D_MACOS_BUNDLE) + f3d_test(NAME TestXCAFColors DATA xcaf-colors.stp DEFAULT_LIGHTS ARGS --load-plugins=occt -csy --up=+Z --camera-direction=-1,-1,-1) + file(COPY "${F3D_SOURCE_DIR}/plugins/occt/configs/config.d/" DESTINATION "${CMAKE_BINARY_DIR}/share/f3d/configs/config_build.d") f3d_test(NAME TestDefaultConfigFileOCCT DATA f3d.stp CONFIG config_build LONG_TIMEOUT DEFAULT_LIGHTS) diff --git a/testing/baselines/TestXCAFColors.png b/testing/baselines/TestXCAFColors.png new file mode 100644 index 0000000000..0e5d4a25c1 --- /dev/null +++ b/testing/baselines/TestXCAFColors.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67fcc6a0e1ae0e2c80c38f981199a235c8250373f498872b6cdcfe889cdaa04d +size 6940 diff --git a/testing/data/xcaf-colors.stp b/testing/data/xcaf-colors.stp new file mode 100644 index 0000000000..75ebdb2977 --- /dev/null +++ b/testing/data/xcaf-colors.stp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e5babb12db25c99df13679b087b9ef29286a6972aefc147293c85402c263d00c +size 154613 From efe67a6965e311759f5424b60b19fbe37961b367 Mon Sep 17 00:00:00 2001 From: snoyer Date: Fri, 2 Feb 2024 12:37:59 +0400 Subject: [PATCH 4/4] update baseline --- testing/baselines/TestSTEP.png | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/baselines/TestSTEP.png b/testing/baselines/TestSTEP.png index df2643deda..a8bf99fccf 100644 --- a/testing/baselines/TestSTEP.png +++ b/testing/baselines/TestSTEP.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1241ecbcf7e68a93bdb1d48d061113867bcb16123c4b5d105910cd3eb29d6f0d -size 6224 +oid sha256:b13197ebdd899107995aa2244baa0c5c1f7ccbfbad0943a81bd48de7b75bf674 +size 7146