Files
HartOMat/backend/app/domains/media/schemas.py
T
Hartmut ca62319688 feat: sharp edge pipeline V02, tessellation presets, media cache-bust, GMSH plan
Sharp Edge Pipeline V02:
- export_step_to_gltf.py: replace BRep_Tool.Polygon3D_s (returns None in XCAF) with
  GCPnts_UniformAbscissa curve sampling at 0.3mm step — extracts 17,129 segment pairs
- Inject sharp_edge_pairs + sharp_threshold_deg into GLB extras (scenes[0].extras)
  via binary GLB JSON-chunk patching (no extra dependency)
- export_gltf.py: read schaeffler_sharp_edge_pairs from Blender scene custom props,
  apply via KD-tree to mark edges sharp=True + seam=True (OCC mm Z-up → Blender transform)
- tools/restore_sharp_marks.py: dual-pass (dihedral angle + OCC pairs), updated coordinate
  transform (X, -Z, Y) * 0.001

Tessellation:
- Admin UI: Draft / Standard / Fine preset buttons with active-state highlighting
- Default angular deflection: preview 0.5→0.1 rad, production 0.2→0.05 rad
- export_glb.py: read updated defaults from system_settings

Media / Cache:
- media/service.py: get_download_url appends ?v={file_size_bytes} cache-buster
- media/router.py: Cache-Control: no-cache for all download/thumbnail endpoints

Render pipeline:
- still_render.py / turntable_render.py: shared GPU activation + camera improvements
- render_order_line.py: global render position support
- render_thumbnail.py: updated defaults

Frontend:
- InlineCadViewer: file_size_bytes-aware URL update triggers re-fetch on regeneration
- ThreeDViewer: material panel, part selection, PBR mode improvements
- Admin.tsx: tessellation preset cards, GMSH setting dropdown
- MediaBrowser, ProductDetail, OrderDetail, Orders: various UI improvements
- New: MaterialPanel, GlobalRenderPositionsPanel, StepIndicator components
- New: renderPositions.ts API client

Plans / Docs:
- plan.md: GMSH Frontal-Delaunay tessellation plan (6 tasks)
- LEARNINGS.md: OCC Polygon3D_s None issue + GCPnts fix
- .gitignore: add backend/core (core dump from root process)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 14:40:36 +01:00

63 lines
1.7 KiB
Python

import uuid
from datetime import datetime
from pydantic import BaseModel
from app.domains.media.models import MediaAssetType
class MediaAssetOut(BaseModel):
id: uuid.UUID
tenant_id: uuid.UUID | None
product_id: uuid.UUID | None
cad_file_id: uuid.UUID | None
order_line_id: uuid.UUID | None
workflow_run_id: uuid.UUID | None
asset_type: MediaAssetType
storage_key: str
file_size_bytes: int | None
mime_type: str | None
width: int | None
height: int | None
duration_s: float | None
render_config: dict | None
is_archived: bool
created_at: datetime
download_url: str | None = None
thumbnail_url: str | None = None
model_config = {"from_attributes": True}
class MediaAssetBrowseItem(BaseModel):
"""Enriched asset item for the media browser endpoint."""
id: uuid.UUID
asset_type: MediaAssetType
file_path: str
file_size_bytes: int | None
mime_type: str | None
created_at: datetime
order_line_id: uuid.UUID | None
product_id: uuid.UUID | None
product_name: str | None
product_pim_id: str | None
category_key: str | None
render_status: str | None
# Extended product metadata fields
product_ebene1: str | None = None
product_ebene2: str | None = None
product_baureihe: str | None = None
product_produkt_baureihe: str | None = None
product_lagertyp: str | None = None
product_name_cad_modell: str | None = None
download_url: str | None = None
thumbnail_url: str | None = None
model_config = {"from_attributes": True}
class MediaAssetBrowseResponse(BaseModel):
items: list[MediaAssetBrowseItem]
total: int
page: int
page_size: int
pages: int