View Issue Details

IDProjectCategoryView StatusLast Update
0033562CommunityOCCT:Foundation Classespublic2023-12-26 22:49
Reporterpikachu Assigned Toakaftasev  
PrioritynormalSeverityminor 
Status newResolutionopen 
PlatformLinuxOSUbuntu 20.04 
Product Version7.7.1 
Summary0033562: BRepTools::Write makes the kernel of jupyter died
DescriptionThe kernel of jupyter is crashed when a Python method binding to "BRepTools::Write" is called.
The phenomenon only happens on Linux OS.
Steps To ReproduceYou can use any Python package binding to OpenCascade to test, For example: pyocct.
For me, I'm using the topologicpy package which is a python package bindings to the Topologic (github repo: https://github.com/wassimj/Topologic)
The steps to reproduce are shown below
1. Create the conda environment. Below is content of "conda_env_topologic_py310.yml" file
~~~~
name: topologic_py310
channels:
  - conda-forge
dependencies:
  - python=3.10
  - pip
  # opencascade
  - occt=7.7.1
  # build tools
  - cxx-compiler
  - cmake
  - ninja
  - pip:
    - auditwheel ; platform_system == "Linux"
    - patchelf ; platform_system == "Linux"
    - delocate
    - numpy
    - ipykernel
    - topologicpy
    - machomachomangler ; platform_system == "Windows"
    - pefile ; platform_system == "Windows"
~~~~

-> Then build the conda environment with command "conda env create -f conda_env_topologic_py310.yml"

2. Activate the Conda environment with command "conda activate topologic_py310"

3. Build and install the Topologic into the conda environment
~~~~{.bash}
$ git clone git@github.com:wassimj/Topologic.git
$ cd Topologic/TopologicPythonBinding
$ python build_linux.py
$ pip install wheelhouse/topologic-5.0.0-cp310-cp310-linux_x86_64.whl
~~~~

4. Create a kernel for the conda environment with command "python -m ipykernel install --user --name=topologic_py310"

5. Run the below code on jupyter notebook or using an extension on vscode

~~~~{.python}
from topologicpy.Vertex import Vertex
from topologicpy.Topology import Topology
v = Vertex.ByCoordinates(0,0,0)
s = Topology.BREPString(v)
print(s)
~~~~

And then you choose the above kernel, say "topologic_py310", for jupyter.
Click "Run" button, you will see the message "The Kernel crashed while executing code in the current cell ..." on vscode or somethings like that on the web interface of the jupyter noebook.

I have already troubleshooted and saw that jupyter was crashed when "Topology.BREPString(v)" method is called. This method is binding to the method C++
https://github.com/wassimj/Topologic/blob/main/TopologicCore/src/Topology.cpp#L1277-L1298

~~~~{.C++}
std::string Topology::String(const int kVersion = 3) const
{
    std::ostringstream oss(std::ios_base::out);
    if (kVersion == 1)
    {
        BRepTools::Write(GetOcctShape(), oss, false, true, TopTools_FormatVersion_VERSION_1);
    }
    else if (kVersion == 2)
    {
        BRepTools::Write(GetOcctShape(), oss, false, true, TopTools_FormatVersion_VERSION_2);
    }
    else if (kVersion == 3)
    {
        BRepTools::Write(GetOcctShape(), oss, false, true, TopTools_FormatVersion_VERSION_3);
    }
    else
    {
        BRepTools::Write(GetOcctShape(), oss, false, true, TopTools_FormatVersion_CURRENT);
    }
    
    return oss.str();
}
~~~~

Please get the attached file for more details
TagsNo tags attached.
Test case number

Attached Files

  • Screenshot from 2023-12-27 02-15-34.png (68,652 bytes)

Activities

pikachu

2023-12-26 22:49

reporter  

Screenshot from 2023-12-27 02-15-34.png (68,652 bytes)

Issue History

Date Modified Username Field Change
2023-12-26 22:49 pikachu New Issue
2023-12-26 22:49 pikachu Assigned To => akaftasev
2023-12-26 22:49 pikachu File Added: Screenshot from 2023-12-27 02-15-34.png