from pathlib import Path from typing import Optional from config import EPT_DIR def generate_viewer_html(pc_id: str, ept_dir: Optional[str], embed: bool = False) -> str: # Fallback : cherche ept.json si le manifest est absent if not ept_dir: out_dir = EPT_DIR / pc_id ept_json = out_dir / "ept.json" if ept_json.exists(): ept_dir = pc_id else: return "

Erreur : ept.json introuvable pour cet ID

" height_style = "100vh" if embed else "800px" base_url = "/static/potree" # L'URL vers ept.json servi via le montage statique /ept_data ept_json_url = f"/ept_data/{ept_dir}/ept.json" return f""" EPT Viewer - {pc_id}
"""