Skip to content

Prevent the display being closed when a function returns #855

Open
@CsatiZoltan

Description

@CsatiZoltan

I separated my visualization functionality to a separate function, like this:

from OCC.Display.SimpleGui import init_display

def core:
    # Set up a `TopoDS_Shape` object, called `shape`
    # ...
    # Call the plotting function
    plot_shape(shape)

def plot_shape(shape):
    display, start_display, add_menu, add_function_to_menu = init_display()
    display.DisplayShape(shape, update=True)
    input("Press Enter to continue...")

The last line is there to prevent the figure from being closed. However, this is not a good solution because

  • the program termination is paused
  • I cannot focus on the figure, so I cannot rotate, zoom, pan, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions