refactor: rebrand project to HartOMat

This commit is contained in:
2026-04-06 12:45:47 +02:00
parent fa7093307a
commit b795f0e6d6
95 changed files with 608 additions and 497 deletions
+5 -5
View File
@@ -1,6 +1,6 @@
"""Blender companion script: restore sharp + seam edge marks after importing a production GLB.
After importing a Schaeffler production GLB in Blender, run this script once via
After importing a HartOMat production GLB in Blender, run this script once via
the Scripting workspace (Text Editor → Run Script). It reads the sharp angle AND the
OCC B-rep sharp edge pairs baked into the GLB at export time, and re-applies
mark_sharp() + mark_seam() on every mesh object.
@@ -26,7 +26,7 @@ if not mesh_objects:
print("No mesh objects found in scene.")
else:
# --- Pass 1: dihedral-angle-based sharp/seam marks ---
angle_deg = bpy.context.scene.get("schaeffler_sharp_angle_deg", 30.0)
angle_deg = bpy.context.scene.get("hartomat_sharp_angle_deg", 30.0)
smooth_rad = math.radians(float(angle_deg))
total_sharp = 0
@@ -48,7 +48,7 @@ else:
print(f"Pass 1 (dihedral {angle_deg}°): {total_sharp} sharp/seam edges across {len(mesh_objects)} objects.")
# --- Pass 2: OCC B-rep sharp edges from GLB extras ---
# The production GLB embeds schaeffler_sharp_edge_pairs (OCC B-rep topology,
# The production GLB embeds hartomat_sharp_edge_pairs (OCC B-rep topology,
# dense curve samples at 0.3mm) in scenes[0].extras, which Blender maps to
# scene custom properties on import. These cover geometrically sharp edges
# that the dihedral-angle pass misses due to tessellation noise.
@@ -56,7 +56,7 @@ else:
# Coordinate convention (mirrors export_gltf.py _apply_sharp_edges_from_occ):
# OCC STEP space (Z-up, mm) → Blender (Z-up, m):
# Blender(X, Y, Z) = OCC(X*0.001, -Z*0.001, Y*0.001)
occ_pairs = bpy.context.scene.get("schaeffler_sharp_edge_pairs") or []
occ_pairs = bpy.context.scene.get("hartomat_sharp_edge_pairs") or []
if occ_pairs:
print(f"Pass 2 (OCC B-rep): applying {len(occ_pairs)} sharp edge segment pairs...")
@@ -99,4 +99,4 @@ else:
print(f"Pass 2 (OCC B-rep): {marked_total} additional edges marked across {len(mesh_objects)} objects.")
else:
print("Pass 2 (OCC B-rep): no schaeffler_sharp_edge_pairs in GLB extras — skipped.")
print("Pass 2 (OCC B-rep): no hartomat_sharp_edge_pairs in GLB extras — skipped.")