Analyse STL/3MF on upload: bounding box + volume, cached in stl_cache
- StlCache model: filename, cube_x/y/z (mm), volume_ccm
- Migration 0007: stl_cache table
- app/stl_analysis.py: trimesh-based analyse() + get_cache_map()
- Runs immediately after upload in both /jobs and /brackets/{id}/jobs
- Skips .gcode (no geometry), caches per filename, idempotent
- Library selector in both modals now shows dimensions and volume
- requirements: trimesh==4.5.3
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -114,7 +114,10 @@
|
||||
{% if stl_files %}
|
||||
<select name="stl_select" class="form-select bg-dark border-secondary text-white">
|
||||
<option value="">— select file —</option>
|
||||
{% for f in stl_files %}<option value="{{ f }}">{{ f }}</option>{% endfor %}
|
||||
{% for f in stl_files %}
|
||||
{% set c = stl_cache.get(f) %}
|
||||
<option value="{{ f }}">{{ f }}{% if c %} — {{ c.cube_x|round(1) }}×{{ c.cube_y|round(1) }}×{{ c.cube_z|round(1) }} mm · {{ c.volume_ccm }} cm³{% endif %}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% else %}
|
||||
<p class="text-secondary small mb-0">No files in library yet.</p>
|
||||
|
||||
@@ -129,7 +129,8 @@
|
||||
<select name="stl_select" class="form-select bg-dark border-secondary text-white">
|
||||
<option value="">— select file —</option>
|
||||
{% for f in stl_files %}
|
||||
<option value="{{ f }}">{{ f }}</option>
|
||||
{% set c = stl_cache.get(f) %}
|
||||
<option value="{{ f }}">{{ f }}{% if c %} — {{ c.cube_x|round(1) }}×{{ c.cube_y|round(1) }}×{{ c.cube_z|round(1) }} mm · {{ c.volume_ccm }} cm³{% endif %}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% else %}
|
||||
|
||||
Reference in New Issue
Block a user