View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0032695 | Community | OCCT:Data Exchange | public | 2021-11-28 22:45 | 2023-01-16 19:15 |
Reporter | christopher.lackner_140546 | Assigned To | bugmaster | ||
Priority | normal | Severity | major | ||
Status | closed | Resolution | fixed | ||
Platform | Linux | OS | Arch | ||
Product Version | 5.2.4 | ||||
Target Version | 7.8.0 | ||||
Summary | 0032695: Data Exchange - Wrong cut sphere face in step export | ||||
Description | When exporting a sphere cut by a cylinder to step the result has the wrong face of the sphere leading to the cut-out cylinder as a result instead of the sphere minus the cylinder. This issue was raised by one of our open source users of Netgen here: https://ngsolve.org/forum/ngspy-forum/1506-saving-geometry-bug and can be reproduced with the attached code. Best, Christopher | ||||
Steps To Reproduce | pload XDE OCAF MODELING VISUALIZATION psphere s 0.5 plane p 0 0 0 1 0 0 pcylinder c p 0.1 1.0 bcut r s c vinit View1 #vdisplay -dispMode 1 r; vsetcolor r RED vfit testwritestep test.stp r testreadstep test.stp s vdisplay -dispMode 1 s; vsetcolor s GREEN vfit #include <BRepPrimAPI_MakeSphere.hxx> #include <BRepPrimAPI_MakeCylinder.hxx> #include <BRepAlgoAPI_Cut.hxx> #include <STEPCAFControl_Writer.hxx> #include <XCAFApp_Application.hxx> #include <XCAFDoc_ShapeTool.hxx> #include <XCAFDoc_DocumentTool.hxx> #include <XSControl_WorkSession.hxx> #include <iostream> using namespace std; int main() { auto sphere = BRepPrimAPI_MakeSphere({ 0., 0., 0. }, 0.5).Solid(); auto cyl = BRepPrimAPI_MakeCylinder(gp_Ax2({0., 0., 0.}, {1., 0., 0.}), 0.1, 1.); auto cut = BRepAlgoAPI_Cut(sphere, cyl).Shape(); Handle(XCAFApp_Application) app = XCAFApp_Application::GetApplication(); Handle(TDocStd_Document) doc; app->NewDocument("STEP-XCAF", doc); Handle(XCAFDoc_ShapeTool) shapetool = XCAFDoc_DocumentTool::ShapeTool(doc->Main()); auto label = shapetool->NewShape(); shapetool->SetShape(label, cut); Handle(XSControl_WorkSession) session = new XSControl_WorkSession; STEPCAFControl_Writer writer(session); writer.Transfer(doc, STEPControl_AsIs); writer.Write("geo.step"); return 0; } | ||||
Additional information and documentation updates | This is the CMakeLists.txt file to build the executable: cmake_minimum_required(VERSION 3.12) project(occ_bug) find_package(OpenCascade NAMES OpenCASCADE opencascade REQUIRED) set(OCC_LIBRARIES TKBO TKBRep TKBool TKCAF TKCDF TKFillet TKG2d TKG3d TKGeomAlgo TKGeomBase TKHLR TKIGES TKLCAF TKMath TKMesh TKOffset TKPrim TKSTEP TKSTEP209 TKSTEPAttr TKSTEPBase TKSTL TKService TKShHealing TKTopAlgo TKV3d TKVCAF TKXCAF TKXDEIGES TKXDESTEP TKXSBase TKernel ) include_directories(${OpenCASCADE_INCLUDE_DIR}) add_executable(occ_bug occ_bug.cpp) target_link_libraries(occ_bug ${OCC_LIBRARIES}) | ||||
Tags | No tags attached. | ||||
Test case number | |||||
|
occ_bug.cpp (1,097 bytes) |
|
Could you please clarify, how you determined result being wrong? I see exactly the same shape after STEP export/import. pload XDE OCAF MODELING VISUALIZATION psphere s 0.5 pcylinder c 0.1 1.0 bcut r s c vinit View1 #vdisplay -dispMode 1 r; vsetcolor r RED vfit testwritestep test.stp r testreadstep test.stp s vdisplay -dispMode 1 s; vsetcolor s GREEN vfit |
|
DeepinScreenshot_select-area_20211201104739.png (36,562 bytes) |
|
If I execute your script the stp file is correct, but if I load the step created from my script it is the attached file. |
|
It seems the difference is the axis of the cylinder. If I set the cylinder in Z direction it works, if in x direction not |
|
Thanks, I've updated steps to reproduce. |
|
sphere_cyl_654.png (11,440 bytes) |
|
Interesting, before OCCT 6.6.0 (e.g. OCCT 6.5.4) produced a different STEP, although broken. |
|
Branch CR32695 has been created by ona. SHA-1: ef2b0e5e8882d1927e44db41467070da55c89f4d Detailed log of new commits: Author: ona Date: Mon Nov 14 16:52:38 2022 +0300 0032695: Data Exchange - Wrong cut sphere face in step export - Test is added |
|
Branch CR32695 has been updated forcibly by ona. SHA-1: 343c1ac06a4a29b8ffa250ce07f7cdeaa39839df |
|
Bug is not reproduced on the current master. A test is added. |
|
bug32695.png (53,629 bytes) |
|
Dear Bugmaster. Bug is not reproduced in the current version. Could you please close it. |
Date Modified | Username | Field | Change |
---|---|---|---|
2021-11-28 22:45 | christopher.lackner_140546 | New Issue | |
2021-11-28 22:45 | christopher.lackner_140546 | Assigned To | => gka |
2021-11-28 22:45 | christopher.lackner_140546 | File Added: occ_bug.cpp | |
2021-11-28 22:48 | kgv | Summary | Wrong cut sphere face in step export => Data Exchange - Wrong cut sphere face in step export |
2021-11-28 22:48 | kgv | Steps to Reproduce Updated | |
2021-11-30 16:27 | kgv | File Added: sphere_minus_cylinder.png | |
2021-11-30 16:34 | kgv | Note Added: 0105544 | |
2021-12-01 12:18 | kgv | Assigned To | gka => christopher.lackner_140546 |
2021-12-01 12:18 | kgv | Status | new => feedback |
2021-12-01 12:48 | christopher.lackner_140546 | File Added: DeepinScreenshot_select-area_20211201104739.png | |
2021-12-01 12:50 | christopher.lackner_140546 | Note Added: 0105559 | |
2021-12-01 12:57 | christopher.lackner_140546 | Note Edited: 0105559 | |
2021-12-01 13:23 | christopher.lackner_140546 | Note Added: 0105560 | |
2021-12-01 15:35 | kgv | Note Added: 0105568 | |
2021-12-01 15:35 | kgv | Assigned To | christopher.lackner_140546 => gka |
2021-12-01 15:35 | kgv | Status | feedback => assigned |
2021-12-01 15:35 | kgv | Target Version | => 7.7.0 |
2021-12-01 15:35 | kgv | Steps to Reproduce Updated | |
2021-12-01 15:35 | kgv | File Deleted: sphere_minus_cylinder.png | |
2021-12-01 15:36 | kgv | Steps to Reproduce Updated | |
2021-12-01 15:41 | kgv | Product Version | 7.6.0 => 5.2.4 |
2021-12-01 15:42 | kgv | File Added: sphere_cyl_654.png | |
2021-12-01 15:43 | kgv | Note Added: 0105569 | |
2021-12-01 15:43 | kgv | Note Edited: 0105569 | |
2022-10-24 10:38 |
|
Target Version | 7.7.0 => 7.8.0 |
2022-11-14 13:50 |
|
Assigned To | gka => ona |
2022-11-14 16:56 | git | Note Added: 0112099 | |
2022-11-15 10:36 | git | Note Added: 0112105 | |
2022-11-15 15:09 |
|
Note Added: 0112116 | |
2022-11-15 15:10 |
|
Note Added: 0112117 | |
2022-11-15 15:10 |
|
File Added: bug32695.png | |
2022-11-15 15:12 |
|
Assigned To | ona => gka |
2022-11-15 15:12 |
|
Status | assigned => resolved |
2022-11-16 16:44 |
|
Assigned To | gka => bugmaster |
2022-11-16 16:44 |
|
Status | resolved => feedback |
2022-11-16 16:44 |
|
Note Added: 0112133 | |
2023-01-16 19:15 | ebelouso | Status | feedback => closed |
2023-01-16 19:15 | ebelouso | Resolution | open => fixed |