refactor: replace STL intermediary with OCC-native STEP→GLB pipeline

- export_step_to_gltf.py: STEP→GLB via RWGltf_CafWriter + BRepBuilderAPI_Transform
  (mm→m pre-scaling, XCAFDoc_ShapeTool.GetComponents_s static method)
- Blender scripts (blender_render.py, still_render.py, turntable_render.py,
  export_gltf.py, export_blend.py): import GLB instead of STL, remove _scale_mm_to_m
- step_tasks.py: add generate_gltf_production_task, remove generate_stl_cache,
  replace _bbox_from_stl with _bbox_from_glb (trimesh), auto-queue geometry GLB
  after thumbnail render
- render_blender.py: replace _stl_from_cache_or_convert with _glb_from_step,
  remove convert_step_to_stl and export_per_part_stls
- domains/rendering/tasks.py: update render_turntable_task, export_gltf/blend tasks
  to use GLB instead of STL
- cad.py: remove STL download/generate endpoints, add generate-gltf-production
- admin.py: generate-missing-stls → generate-missing-geometry-glbs
- Frontend: replace STL cache UI with GLB generate buttons, remove stl_cached field

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 16:49:18 +01:00
parent 3eba7b2d37
commit 95cfe0aa93
20 changed files with 809 additions and 1301 deletions
-11
View File
@@ -77,20 +77,9 @@ def _product_out(product: Product, priority: list[str] | None = None) -> Product
out.cad_parsed_objects = product.cad_parsed_objects
out.cad_mesh_attributes = product.cad_file.mesh_attributes if product.cad_file else None
out.render_image_url = _best_render_url(product, priority or ["latest_render", "cad_thumbnail"])
out.stl_cached = _stl_cached_qualities(product)
return out
def _stl_cached_qualities(product: Product) -> list[str]:
"""Return list of STL qualities that are cached on disk for this product."""
from pathlib import Path as _Path
cad = product.cad_file
if not cad or not cad.stored_path:
return []
step = _Path(cad.stored_path)
return [q for q in ("low", "high") if (step.parent / f"{step.stem}_{q}.stl").exists()]
async def _load_thumbnail_priority(db: AsyncSession) -> list[str]:
"""Read product_thumbnail_priority from system_settings.