Skip to content

pythonocc visualization error #4

@hxngiee

Description

@hxngiee

Thank you for your amazing work. When visualizing sample results, the following error appears. Is it possible to identify the cause? Also, could you provide the version of pythonocc?

##### 3D rendering pipe initialisation #####
Display3d class initialization starting ...
  0%|                                                                             | 0/730 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/media/data/hnc-cad/gen/cad_img.py", line 72, in <module>
    main()
  File "/media/data/hnc-cad/gen/cad_img.py", line 68, in main
    render(shape, output_path.joinpath(fn.stem + ".png"), args.width, args.height)
  File "/media/data/hnc-cad/gen/cad_img.py", line 15, in render
    viewer = Viewer3d()
  File "/home/.conda/envs/pyoccenv/lib/python3.9/site-packages/OCC/Display/OCCViewer.py", line 145, in __init__
    Display3d.__init__(self)
  File "/home/.conda/envs/pyoccenv/lib/python3.9/site-packages/OCC/Core/Visualization.py", line 180, in __init__
    _Visualization.Display3d_swiginit(self, _Visualization.new_Display3d())
RuntimeError: Aspect_DisplayConnectionDefinitionErrorCan not connect to the server "" raised from method Display3d of class Display3d
  File "/Users/Desktop/Code/gpus/hnc-cad/gen/cad_img.py", line 72, in <module>
    main()
  File "/Users/Desktop/Code/gpus/hnc-cad/gen/cad_img.py", line 68, in main
    render(shape, output_path.joinpath(fn.stem + ".png"), args.width, args.height)
  File "/Users/Desktop/Code/gpus/hnc-cad/gen/cad_img.py", line 16, in render
    viewer.Create(phong_shading=True, create_default_lights=True)
  File "/Users/miniconda3/envs/pyoccenv/lib/python3.9/site-packages/OCC/Display/OCCViewer.py", line 216, in Create
    self.InitOffscreen(640, 480)
  File "/Users/miniconda3/envs/pyoccenv/lib/python3.9/site-packages/OCC/Core/Visualization.py", line 215, in InitOffscreen
    return _Visualization.Display3d_InitOffscreen(self, size_x, size_y)
RuntimeError: Aspect_WindowDefinitionErrorCocoa application should be instantiated before window raised from method InitOffscreen of class Display3d

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions