Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ services:
- ./:/app
- /tmp/.X11-unix:/tmp/.X11-unix:ro
- ${XAUTHORITY:-$HOME/.Xauthority}:/tmp/.Xauthority:ro
- ~/maps:/app/data:rw

Copilot AI May 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~/maps in a Compose volume typically isn’t expanded by Docker Compose (it’s not a shell), so this mount may fail or create a literal ~ directory depending on environment. Prefer ${HOME}/maps:/app/data:rw (or a relative path) to make the mapping reliable across setups.

Suggested change
- ~/maps:/app/data:rw
- ${HOME}/maps:/app/data:rw

Copilot uses AI. Check for mistakes.
# Inherit CMD from Dockerfile: python3 -m pointcloud_tools.gui
52 changes: 43 additions & 9 deletions pointcloud_tools/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ def build_ifc(self):
self.ifc_path = tk.StringVar()
ctk.CTkLabel(f, textvariable=self.ifc_path).grid(row=2, column=1, sticky="w")

ctk.CTkLabel(f, text="Processes (blank=auto)").grid(row=3, column=0, sticky='w')
ctk.CTkLabel(f, text="IFC workers (blank=auto)").grid(row=3, column=0, sticky='w')
self.ifc_proc = tk.StringVar()
ctk.CTkEntry(f, textvariable=self.ifc_proc, width=120).grid(row=3, column=1, sticky='w')

Expand Down Expand Up @@ -512,7 +512,11 @@ def do_ifc_convert(self):
if not mesh_out:
return
self.cfg["local_initialdir"] = os.path.dirname(mesh_out)
proc = int(self.ifc_proc.get()) if self.ifc_proc.get().strip() else None
try:
proc = int(self.ifc_proc.get()) if self.ifc_proc.get().strip() else None
except ValueError:
messagebox.showerror("Error", "IFC workers must be a whole number")
return

types = list_element_types(infile)

Expand All @@ -521,28 +525,40 @@ def do_ifc_convert(self):
vars = {}
for i, t in enumerate(sorted(types.keys())):
var = tk.BooleanVar(value=True)
tk.Checkbutton(sel, text=t, variable=var).grid(row=i, column=0, sticky="w")
tk.Checkbutton(sel, text=f"{t} ({types[t]})", variable=var).grid(
row=i, column=0, sticky="w"
)
vars[t] = var
Comment on lines 525 to 531

Copilot AI May 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid naming this dict vars because it shadows Python’s built-in vars() function, which can make debugging harder in this scope. Rename to something like type_vars or checkbox_vars.

Copilot uses AI. Check for mistakes.
def on_ok():
sel.include = [t for t, v in vars.items() if v.get()]
sel.destroy()
tk.Button(sel, text="OK", command=on_ok).grid(row=len(vars), column=0)
sel.wait_window()
include = getattr(sel, 'include', None)
if not hasattr(sel, 'include'):
return
include = sel.include
if not include:
messagebox.showerror("Error", "No IFC element types selected")
return

if not confirm_overwrite_gui(mesh_out):
return

self.log_text.delete("1.0", tk.END)

def worker():
try:
with contextlib.redirect_stdout(self.stdout_redirector):
ifc_to_mesh(
mesh = ifc_to_mesh(
infile,
mesh_out,
show_result=self.ifc_show.get(),
num_processes=proc,
include_types=include,
confirm_func=confirm_overwrite_gui,
confirm_func=lambda _: True,
)
if mesh is None:
raise RuntimeError("IFC conversion did not produce a mesh")
def done():
self.add_recent_file(mesh_out)
messagebox.showinfo("Done", "Mesh generated")
Expand Down Expand Up @@ -832,17 +848,35 @@ def task(prev):
vars = {}
for i, t in enumerate(sorted(types.keys())):
var = tk.BooleanVar(value=True)
tk.Checkbutton(sel, text=t, variable=var).grid(row=i, column=0, sticky="w")
tk.Checkbutton(sel, text=f"{t} ({types[t]})", variable=var).grid(
row=i, column=0, sticky="w"
)
vars[t] = var
Comment on lines 848 to 854

Copilot AI May 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid naming this dict vars because it shadows Python’s built-in vars() function, which can make debugging harder in this scope. Rename to something like type_vars or checkbox_vars.

Copilot uses AI. Check for mistakes.
def on_ok():
sel.include = [t for t, v in vars.items() if v.get()]
sel.destroy()
tk.Button(sel, text="OK", command=on_ok).grid(row=len(vars), column=0)
sel.wait_window()
include = getattr(sel, 'include', None)
if not hasattr(sel, 'include'):
return
include = sel.include
if not include:
messagebox.showerror("Error", "No IFC element types selected")
return

if not confirm_overwrite_gui(out):
return

def task(prev):
ifc_to_mesh(ifc, out, show_result=False, include_types=include, confirm_func=confirm_overwrite_gui)
mesh = ifc_to_mesh(
ifc,
out,
show_result=False,
include_types=include,
confirm_func=lambda _: True,
)
if mesh is None:
raise RuntimeError("IFC conversion did not produce a mesh")
return out
desc = f"IFC->Mesh {os.path.basename(ifc)}"
elif op == "Downsample PCD":
Expand Down
Loading
Loading