Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Wait for clear
  • Loading branch information
adam-urbanczyk committed Mar 31, 2025
commit b45fa6928b6e26d8a55b5d421048af689ea36104
8 changes: 5 additions & 3 deletions cadquery/fig.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set_event_loop,
run_coroutine_threadsafe,
AbstractEventLoop,
Future,
)
from typing import Optional
from threading import Thread
Expand Down Expand Up @@ -152,9 +153,9 @@ def _run_loop():
# open webbrowser
open_new_tab(f"http://localhost:{port}")

def _run(self, coro):
def _run(self, coro) -> Future:

run_coroutine_threadsafe(coro, self.loop)
return run_coroutine_threadsafe(coro, self.loop)

def show(self, *showables: Showable | vtkProp3D | list[vtkProp3D], **kwargs):
"""
Expand Down Expand Up @@ -243,7 +244,8 @@ async def _clear():

# reset last, bc we don't want to keep track of what was removed
self.last = None
self._run(_clear())
future = self._run(_clear())
future.result()

return self

Expand Down