Skip to content

Commit

Permalink
More robust initialization of the vtk window (#1394)
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-urbanczyk authored Oct 26, 2023
1 parent cce60ce commit 8b7189d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cadquery/vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,18 @@ def show(*objs: Union[Shape, Workplane, Assembly, Sketch]):
renderer = win.GetRenderers().GetFirstRenderer()
renderer.GradientBackgroundOn()

# set size and camera
win.SetSize(*win.GetScreenSize())
win.SetPosition(-10, 0)

# set camera
camera = renderer.GetActiveCamera()
camera.Roll(-35)
camera.Elevation(-45)
renderer.ResetCamera()

# show and return
# initialize and set size
inter.Initialize()
win.SetSize(*win.GetScreenSize())
win.SetPosition(-10, 0)

# show and return
win.Render()
inter.Start()

Expand Down

0 comments on commit 8b7189d

Please sign in to comment.