feat: track remaining production assets, playtest scenes and references

Close the gaps left open after the LFS migration: 177 files that were
sitting untracked now enter version control, with every binary going
through Git LFS.

- labels: milk and orange-juice wrap artwork (SVG/PNG), Seedream sources,
  prompts and Dreamina job records
- orange juice 2L: bottle, cap, empty state and three label variants
  (blend + glb each)
- cup contents: desktop and mobile-optimised variants plus 3 textures
- milk 2L: empty and packaged variants with their glb exports
- milk frother: low-poly assembly and split base/jug parts
- tamper: model, glb and fit test
- juicer: seven assembly-part review scenes and their export scripts
- playtests: extraction animation scene and grinding/tamping whitebox
- reference: Minex page candidates, user review screenshots, sequence
  analysis frames and tamper STLs
- docs: item design draft, bean research notes, region reference and the
  model-asset audit report

Re-renderable preview/check frames stay untracked on purpose.
This commit is contained in:
Yanchen
2026-11-22 10:26:53 +08:00
parent e8f6f34e15
commit 0f9e127162
177 changed files with 10053 additions and 0 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,216 @@
{
"source_blend": "PerfectCoffee_Minex_Mechanism.blend",
"source_blend_sha256": "1aa35413ea2d01adcf8c413cfa0a2c688cf67852c58abf3a259727ecb5c54c4c",
"reference_video": "model_assets/reference/juicer/ZMUEX_working_video.mp4",
"assembly_segment_seconds": [
233,
283
],
"parts": {
"fixed_chassis": {
"file": "PerfectCoffee_Fixed_Chassis.blend",
"preview": "preview_fixed_chassis_part.png",
"source_blend": "PerfectCoffee_Minex_Mechanism.blend",
"source_blend_sha256": "1aa35413ea2d01adcf8c413cfa0a2c688cf67852c58abf3a259727ecb5c54c4c",
"assembly_root": "Fixed_Chassis_Assembly",
"source_object_count": 36,
"appended_object_count": 36,
"root_parent_none": true,
"other_assemblies_excluded": true,
"control_pod_excluded_from_deck": true,
"visible_lcd_states": [
"Ready"
],
"single_ready_state_for_fixed_chassis": true,
"studio_placement_offset_m": [
-0.00299999862909317,
-0.02499999850988388,
0.03849999979138374
],
"non_manifold_edges": {
"Cabinet_Base_Plinth": 0,
"Chamber_Backplate_Rib": 0,
"Chamber_Backplate_Rib.001": 0,
"Chamber_Left_Rear_Return": 0,
"Chamber_Lower_Backplate": 0,
"Chamber_Rear_Wall": 0,
"Chamber_Right_Rear_Return": 0,
"Collector_Shared_Bay_Sill": 0,
"Control_Pod_Base_Standard": 0,
"Control_Pod_Rear_Support": 0,
"Fixed_Control_Pod_Housing": 0,
"LCD_Bezel": 0,
"LCD_Screen": 0,
"Start_Button": 0,
"Start_Button_Rim": 0,
"Rear_Vent": 0,
"Rear_Vent.001": 0,
"Rear_Vent.002": 0,
"Rear_Vent.003": 0,
"Rear_Vent.004": 0,
"Rear_Vent.005": 0,
"Rear_Vent.006": 0,
"Rear_Vent.007": 0,
"Rubber_Foot": 0,
"Rubber_Foot.001": 0,
"Rubber_Foot.002": 0,
"Rubber_Foot.003": 0
},
"positive_part_volumes_m3": {
"Cabinet_Base_Plinth": 0.0026267218681439927,
"Chamber_Backplate_Rib": 1.929762107684962e-05,
"Chamber_Backplate_Rib.001": 1.929762107684962e-05,
"Chamber_Left_Rear_Return": 0.0001793937763793454,
"Chamber_Lower_Backplate": 0.002147026444770346,
"Chamber_Rear_Wall": 0.0024111397957069947,
"Chamber_Right_Rear_Return": 0.00020592286258015806,
"Collector_Shared_Bay_Sill": 0.0002557203534650054,
"Control_Pod_Base_Standard": 5.307669902303164e-05,
"Control_Pod_Rear_Support": 2.499470330921098e-05,
"Fixed_Control_Pod_Housing": 0.0005326483468544586,
"LCD_Bezel": 9.271448458507361e-06,
"LCD_Screen": 1.1142129184479175e-06,
"Start_Button": 1.1709904393703893e-06,
"Start_Button_Rim": 2.3704550877934783e-06,
"Rear_Vent": 4.117127822014996e-07,
"Rear_Vent.001": 4.117127822014996e-07,
"Rear_Vent.002": 4.117127822014996e-07,
"Rear_Vent.003": 4.117127822014996e-07,
"Rear_Vent.004": 4.117127822014996e-07,
"Rear_Vent.005": 4.117127822014996e-07,
"Rear_Vent.006": 4.117127822014996e-07,
"Rear_Vent.007": 4.117127822014996e-07,
"Rubber_Foot": 1.1860214542753698e-05,
"Rubber_Foot.001": 1.1860214542753698e-05,
"Rubber_Foot.002": 1.1860214542753698e-05,
"Rubber_Foot.003": 1.1860214542753698e-05
},
"linked_library_count": 0,
"missing_external_assets": [],
"visual_review_passed": true,
"geometry_checks_passed": true,
"technical_checks_passed": true,
"passed": true
},
"collection_deck": {
"file": "PerfectCoffee_Collection_Deck.blend",
"preview": "preview_collection_deck_part.png",
"source_blend": "PerfectCoffee_Minex_Mechanism.blend",
"source_blend_sha256": "1aa35413ea2d01adcf8c413cfa0a2c688cf67852c58abf3a259727ecb5c54c4c",
"assembly_root": "Collection_Deck_Assembly",
"source_object_count": 15,
"appended_object_count": 15,
"root_parent_none": true,
"other_assemblies_excluded": true,
"control_pod_excluded_from_deck": true,
"visible_lcd_states": [],
"single_ready_state_for_fixed_chassis": true,
"studio_placement_offset_m": [
-0.0,
-0.02550000324845314,
-0.16433162987232208
],
"non_manifold_edges": {
"Collection_Deck_Rear_Lip": 0,
"Collection_Deck_Rear_Mount": 0,
"Collection_Deck_Rear_Mount.001": 0,
"Collection_Deck_Shallow_Rear_Tray": 0,
"Collection_Deck_Side_Rail_-1": 0,
"Collection_Deck_Side_Rail_1": 0,
"Juice_Guide_Deck_Cleat": 0,
"Juice_Guide_Deck_Cleat.001": 0,
"Juice_Guide_Outlet_Cantilever": 0,
"Juice_Guide_Solid_Tray_No_Mesh": 0,
"Sloping_Black_Plastic_Apron": 0
},
"positive_part_volumes_m3": {
"Collection_Deck_Rear_Lip": 3.758110674252284e-06,
"Collection_Deck_Rear_Mount": 1.138687826622772e-06,
"Collection_Deck_Rear_Mount.001": 1.138687826622772e-06,
"Collection_Deck_Shallow_Rear_Tray": 0.00020371851459343249,
"Collection_Deck_Side_Rail_-1": 1.4637013795095009e-05,
"Collection_Deck_Side_Rail_1": 1.4601814580332345e-05,
"Juice_Guide_Deck_Cleat": 2.5141872919205e-08,
"Juice_Guide_Deck_Cleat.001": 9.168200394383904e-07,
"Juice_Guide_Outlet_Cantilever": 1.7119408198222023e-05,
"Juice_Guide_Solid_Tray_No_Mesh": 2.7470561494559974e-05,
"Sloping_Black_Plastic_Apron": 5.727167290823832e-05
},
"linked_library_count": 0,
"missing_external_assets": [],
"visual_review_passed": true,
"geometry_checks_passed": true,
"technical_checks_passed": true,
"passed": true
},
"lower_service_covers": {
"file": "PerfectCoffee_Lower_Service_Covers.blend",
"preview": "preview_lower_service_covers_part.png",
"source_blend": "PerfectCoffee_Minex_Mechanism.blend",
"source_blend_sha256": "1aa35413ea2d01adcf8c413cfa0a2c688cf67852c58abf3a259727ecb5c54c4c",
"assembly_root": "Lower_Service_Cover_Assembly",
"source_object_count": 3,
"appended_object_count": 3,
"root_parent_none": true,
"other_assemblies_excluded": true,
"control_pod_excluded_from_deck": true,
"visible_lcd_states": [],
"single_ready_state_for_fixed_chassis": true,
"studio_placement_offset_m": [
-0.0,
0.05350000038743019,
0.003999999724328518
],
"non_manifold_edges": {
"Lower_Left_Service_Cover": 0,
"Lower_Right_Service_Cover": 0
},
"positive_part_volumes_m3": {
"Lower_Left_Service_Cover": 0.0001766217172683023,
"Lower_Right_Service_Cover": 0.00014745020867942138
},
"linked_library_count": 0,
"missing_external_assets": [],
"visual_review_passed": true,
"geometry_checks_passed": true,
"technical_checks_passed": true,
"passed": true
},
"transparent_hood": {
"file": "PerfectCoffee_Transparent_Hood.blend",
"preview": "preview_transparent_hood.png",
"source_blend": "PerfectCoffee_Minex_Mechanism.blend",
"source_blend_sha256": "1aa35413ea2d01adcf8c413cfa0a2c688cf67852c58abf3a259727ecb5c54c4c",
"assembly_root": "Removable_Transparent_Hood_Assembly",
"source_object_count": 3,
"appended_object_count": 3,
"root_parent_none": true,
"other_assemblies_excluded": true,
"control_pod_excluded_from_deck": true,
"visible_lcd_states": [],
"single_ready_state_for_fixed_chassis": true,
"studio_placement_offset_m": [
-0.0,
0.0040000006556510925,
-0.25979408621788025
],
"non_manifold_edges": {
"Transparent_Hood_Rear_Closure": 0,
"Transparent_Hood_With_Curved_Sides": 0
},
"positive_part_volumes_m3": {
"Transparent_Hood_Rear_Closure": 0.00017984367866208557,
"Transparent_Hood_With_Curved_Sides": 0.000621221439658863
},
"linked_library_count": 0,
"missing_external_assets": [],
"visual_review_passed": true,
"geometry_checks_passed": true,
"technical_checks_passed": true,
"passed": true
}
},
"technical_checks_passed": true,
"visual_review_passed": true,
"passed": true
}
@@ -0,0 +1,31 @@
{
"file": "PerfectCoffee_Collector_Pair.blend",
"preview": "preview_collector_pair.png",
"source_blend": "PerfectCoffee_Minex_Mechanism.blend",
"source_blend_sha256": "1aa35413ea2d01adcf8c413cfa0a2c688cf67852c58abf3a259727ecb5c54c4c",
"acceptance_view": "pair",
"source_objects": [
"Residue_Collection_Box",
"Residue_Box_Open_Rim",
"Juice_Collection_Box_Contoured",
"Juice_Bin_Contoured_Rim"
],
"object_count": 4,
"center_error_m": 4.8437728076971485e-08,
"rim_height_range_m": 0.01303508771929826,
"non_manifold_edges": 0,
"volume_m3": 0.00027286890833844407,
"linked_library_count": 0,
"missing_external_assets": [],
"machine_parts_excluded": true,
"depth_m": 0.1340000033378601,
"source_depth_matches": true,
"front_shallow_collector": true,
"visual_review_passed": true,
"collector_wall_gap_m": 0.007013451308012009,
"close_pair_without_divider": true,
"handle_through_cut_passed": true,
"integrated_front_pull_passed": true,
"technical_checks_passed": true,
"passed": true
}
@@ -0,0 +1,158 @@
import bpy
import hashlib
import json
import sys
from pathlib import Path
from mathutils import Vector
OUT = Path(__file__).resolve().parent
sys.path.insert(0, str(OUT))
from export_collector_parts import studio, evaluated_bin
MAIN = OUT/'PerfectCoffee_Minex_Mechanism.blend'
SPECS = {
'fixed_chassis': {
'root': 'Fixed_Chassis_Assembly',
'file': 'PerfectCoffee_Fixed_Chassis.blend',
'preview': 'preview_fixed_chassis_part.png',
'camera': ((0.76, 1.30, 0.85), (0, 0, 0.36), 0.980),
},
'collection_deck': {
'root': 'Collection_Deck_Assembly',
'file': 'PerfectCoffee_Collection_Deck.blend',
'preview': 'preview_collection_deck_part.png',
'camera': ((0.46, 0.72, 0.48), (0, 0, 0.12), 0.510),
},
'lower_service_covers': {
'root': 'Lower_Service_Cover_Assembly',
'file': 'PerfectCoffee_Lower_Service_Covers.blend',
'preview': 'preview_lower_service_covers_part.png',
'camera': ((0.50, 0.72, 0.40), (0, 0, 0.17), 0.540),
},
'transparent_hood': {
'root': 'Removable_Transparent_Hood_Assembly',
'file': 'PerfectCoffee_Transparent_Hood.blend',
'preview': 'preview_transparent_hood.png',
'camera': ((0.55, 0.85, 0.60), (0, 0, 0.23), 0.520),
},
}
def export_part(kind, spec):
bpy.ops.wm.open_mainfile(filepath=str(MAIN))
source_root = bpy.data.objects[spec['root']]
names = [source_root.name, *[obj.name for obj in source_root.children_recursive]]
bpy.ops.wm.read_factory_settings(use_empty=True)
bpy.context.preferences.filepaths.save_version = 0
with bpy.data.libraries.load(str(MAIN), link=False) as (source, target):
target.objects = names
appended = [obj for obj in target.objects if obj is not None]
assert len(appended) == len(names), f'{kind}: missing source objects'
for obj in appended:
bpy.context.scene.collection.objects.link(obj)
obj.animation_data_clear()
obj.hide_render = kind == 'fixed_chassis' and obj.name in {'LCD_Status_Processing', 'LCD_Status_Stopped'}
obj.hide_viewport = obj.hide_render
assembly = bpy.data.objects[spec['root']]
assembly.parent = None
assembly.matrix_parent_inverse.identity()
assembly.location = (0, 0, 0)
assembly.rotation_euler = (0, 0, 0)
bpy.context.view_layer.update()
points = []
for obj in assembly.children_recursive:
if obj.type != 'MESH':
continue
evaluated = obj.evaluated_get(bpy.context.evaluated_depsgraph_get())
data = evaluated.to_mesh()
points.extend(evaluated.matrix_world @ vertex.co for vertex in data.vertices)
evaluated.to_mesh_clear()
assert points, f'{kind}: assembly has no mesh geometry'
low = Vector(tuple(min(point[i] for point in points) for i in range(3)))
high = Vector(tuple(max(point[i] for point in points) for i in range(3)))
offset = Vector((-(low.x+high.x)/2, -(low.y+high.y)/2, 0.039-low.z))
assembly.location += offset
studio(kind, spec)
scene = bpy.context.scene
scene.frame_set(1)
bpy.context.view_layer.update()
scene['acceptance_view'] = kind
scene['source_model'] = MAIN.name
scene['source_sha256'] = hashlib.sha256(MAIN.read_bytes()).hexdigest()
scene['geometry_note'] = 'The complete assembly root and descendants are appended from the main juicer; no replacement geometry is drawn'
about = bpy.data.texts.new('ABOUT_Assembly_Acceptance')
about.write(f'Independent {kind} assembly from {MAIN.name}. Source segment: ZMUEX_working_video.mp4 03:53 onward. Animated visibility and transforms are cleared for static acceptance. Studio placement offset: {list(offset)}.\n')
bpy.ops.object.select_all(action='DESELECT')
assembly.select_set(True)
bpy.context.view_layer.objects.active = assembly
path = OUT/spec['file']
bpy.ops.wm.save_as_mainfile(filepath=str(path), compress=True)
bpy.ops.wm.open_mainfile(filepath=str(path))
scene = bpy.context.scene
scene.frame_set(1)
bpy.context.view_layer.update()
assembly = bpy.data.objects[spec['root']]
non_manifold = {}
volumes = {}
for obj in assembly.children_recursive:
if obj.type != 'MESH':
continue
edges, volume, _ = evaluated_bin(obj)
non_manifold[obj.name] = edges
volumes[obj.name] = volume
other_roots = [item['root'] for item in SPECS.values() if item['root'] != spec['root']]
visible_lcd_states = [status for status in ['Ready', 'Processing', 'Stopped'] if 'LCD_Status_'+status in bpy.data.objects and not bpy.data.objects['LCD_Status_'+status].hide_render]
report = {
'file': spec['file'],
'preview': spec['preview'],
'source_blend': MAIN.name,
'source_blend_sha256': scene['source_sha256'],
'assembly_root': spec['root'],
'source_object_count': len(names),
'appended_object_count': len(appended),
'root_parent_none': assembly.parent is None,
'other_assemblies_excluded': all(name not in bpy.data.objects for name in other_roots),
'control_pod_excluded_from_deck': kind != 'collection_deck' or 'Fixed_Control_Pod_Assembly' not in bpy.data.objects,
'visible_lcd_states': visible_lcd_states,
'single_ready_state_for_fixed_chassis': kind != 'fixed_chassis' or visible_lcd_states == ['Ready'],
'studio_placement_offset_m': list(offset),
'non_manifold_edges': non_manifold,
'positive_part_volumes_m3': volumes,
'linked_library_count': len(bpy.data.libraries),
'missing_external_assets': [image.filepath for image in bpy.data.images if image.source == 'FILE' and not image.packed_file and not Path(bpy.path.abspath(image.filepath)).exists()],
'visual_review_passed': False,
}
report['geometry_checks_passed'] = bool(volumes) and all(value == 0 for value in non_manifold.values()) and all(value > 0 for value in volumes.values())
report['technical_checks_passed'] = all([
report['source_object_count'] == report['appended_object_count'],
report['root_parent_none'], report['other_assemblies_excluded'],
report['control_pod_excluded_from_deck'], report['geometry_checks_passed'],
report['single_ready_state_for_fixed_chassis'],
report['linked_library_count'] == 0, not report['missing_external_assets'],
])
report['passed'] = report['technical_checks_passed']
assert report['passed'], f'{kind} assembly export failed: {report}'
scene.render.filepath = str(OUT/spec['preview'])
bpy.ops.render.render(write_still=True)
print('ASSEMBLY_EXPORT_COMPLETE '+json.dumps(report), flush=True)
return report
def main():
reports = {kind: export_part(kind, spec) for kind, spec in SPECS.items()}
result = {
'source_blend': MAIN.name,
'source_blend_sha256': hashlib.sha256(MAIN.read_bytes()).hexdigest(),
'reference_video': 'model_assets/reference/juicer/ZMUEX_working_video.mp4',
'assembly_segment_seconds': [233, 283],
'parts': reports,
'technical_checks_passed': all(report['technical_checks_passed'] for report in reports.values()),
'visual_review_passed': False,
}
result['passed'] = result['technical_checks_passed']
(OUT/'assembly_parts_validation.json').write_text(json.dumps(result, ensure_ascii=False, indent=2)+'\n', encoding='utf-8')
print('ALL_ASSEMBLY_PARTS_EXPORTED', flush=True)
if __name__ == '__main__':
main()
@@ -0,0 +1,229 @@
import bpy
import bmesh
import hashlib
import json
from pathlib import Path
from mathutils import Vector
from mathutils.bvhtree import BVHTree
OUT = Path(__file__).resolve().parent
MAIN = OUT/'PerfectCoffee_Minex_Mechanism.blend'
SOURCE_HASH = hashlib.sha256(MAIN.read_bytes()).hexdigest()
SPECS = {
'residue': {
'file': 'PerfectCoffee_Residue_Bin.blend',
'preview': 'preview_residue_bin.png',
'report': 'residue_bin_validation.json',
'objects': ['Residue_Collection_Box', 'Residue_Box_Open_Rim'],
'offset': (-0.0625, -0.068, 0),
'camera': ((-0.42, 0.54, 0.42), (0, 0, 0.17), 0.510),
},
'juice': {
'file': 'PerfectCoffee_Juice_Bin.blend',
'preview': 'preview_juice_bin.png',
'report': 'juice_bin_validation.json',
'objects': ['Juice_Collection_Box_Contoured', 'Juice_Bin_Contoured_Rim'],
'offset': (0.101, -0.087, 0),
'camera': ((-0.38, 0.50, 0.32), (0, 0, 0.14), 0.430),
},
'pair': {
'file': 'PerfectCoffee_Collector_Pair.blend',
'preview': 'preview_collector_pair.png',
'report': 'collector_pair_validation.json',
'objects': ['Residue_Collection_Box', 'Residue_Box_Open_Rim', 'Juice_Collection_Box_Contoured', 'Juice_Bin_Contoured_Rim'],
'offset': (0.01925, -0.0775, 0),
'camera': ((-0.46, 0.62, 0.43), (0, 0.015, 0.16), 0.560),
},
}
def aim(obj, target):
obj.rotation_euler = (Vector(target)-obj.location).to_track_quat('-Z', 'Y').to_euler()
def center(obj):
points = [obj.matrix_world @ Vector(corner) for corner in obj.bound_box]
return sum(points, Vector((0, 0, 0))) / len(points)
def area(name, location, energy, size, target):
data = bpy.data.lights.new(name, 'AREA')
data.energy = energy
data.size = size
obj = bpy.data.objects.new(name, data)
bpy.context.scene.collection.objects.link(obj)
obj.location = location
aim(obj, target)
def studio(kind, spec):
scene = bpy.context.scene
scene.unit_settings.system = 'METRIC'
scene.unit_settings.length_unit = 'METERS'
scene.render.engine = 'CYCLES'
scene.cycles.samples = 48
scene.cycles.use_denoising = True
scene.render.resolution_x = 1200
scene.render.resolution_y = 1000
scene.render.resolution_percentage = 100
scene.render.image_settings.file_format = 'PNG'
scene.render.image_settings.color_mode = 'RGB'
scene.view_settings.view_transform = 'AgX'
scene.view_settings.look = 'AgX - Medium High Contrast'
world = bpy.data.worlds.new('Collector_Studio_World')
world.use_nodes = True
world.node_tree.nodes['Background'].inputs['Color'].default_value = (0.26, 0.30, 0.33, 1)
world.node_tree.nodes['Background'].inputs['Strength'].default_value = 0.40
scene.world = world
bpy.ops.mesh.primitive_cube_add(size=1, location=(0, 0, 0.0365))
ground = bpy.context.object
ground.name = 'Studio_Ground_Not_Part_Of_Product'
ground.dimensions = (200, 200, 0.005)
bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
material = bpy.data.materials.new('Studio_Neutral')
material.diffuse_color = (0.12, 0.15, 0.17, 1)
material.use_nodes = True
material.node_tree.nodes['Principled BSDF'].inputs['Base Color'].default_value = (0.12, 0.15, 0.17, 1)
material.node_tree.nodes['Principled BSDF'].inputs['Roughness'].default_value = 0.75
ground.data.materials.append(material)
area('Studio_Key', (-0.30, 0.40, 0.65), 12, 0.30, (0, 0, 0.16))
area('Studio_Fill', (0.40, 0.10, 0.45), 9, 0.26, (0, 0, 0.14))
area('Studio_Rim', (-0.20, -0.40, 0.50), 10, 0.24, (0, 0, 0.16))
location, target, scale = spec['camera']
data = bpy.data.cameras.new('VALIDATION_Camera')
camera = bpy.data.objects.new('VALIDATION_Camera', data)
scene.collection.objects.link(camera)
camera.location = location
aim(camera, target)
data.type = 'ORTHO'
data.ortho_scale = scale
data.clip_start = 0.001
data.clip_end = 100
scene.camera = camera
for screen in bpy.data.screens:
for area_ in screen.areas:
if area_.type == 'VIEW_3D':
space = area_.spaces.active
space.region_3d.view_perspective = 'CAMERA'
space.shading.type = 'MATERIAL'
space.overlay.show_extras = False
space.clip_start = 0.001
space.clip_end = 100
def evaluated_bin(obj):
ev = obj.evaluated_get(bpy.context.evaluated_depsgraph_get())
mesh = ev.to_mesh()
points = [ev.matrix_world @ vertex.co for vertex in mesh.vertices]
faces = [list(poly.vertices) for poly in mesh.polygons]
bm = bmesh.new()
bm.from_mesh(mesh)
non_manifold = sum(not edge.is_manifold for edge in bm.edges)
volume = bm.calc_volume(signed=True)
bm.free()
ev.to_mesh_clear()
tree = BVHTree.FromPolygons(points, faces)
return non_manifold, volume, tree
def export_part(kind):
spec = SPECS[kind]
source_object_names = list(spec['objects'])
bpy.ops.wm.read_factory_settings(use_empty=True)
bpy.context.preferences.filepaths.save_version = 0
with bpy.data.libraries.load(str(MAIN), link=False) as (source, target):
target.objects = spec['objects']
appended = [obj for obj in target.objects if obj is not None]
assert len(appended) == len(spec['objects'])
for obj in appended:
bpy.context.scene.collection.objects.link(obj)
obj.parent = None
obj.matrix_parent_inverse.identity()
obj.animation_data_clear()
obj.location = spec['offset']
obj.rotation_euler = (0, 0, 0)
obj.hide_render = False
obj.hide_viewport = False
studio(kind, spec)
scene = bpy.context.scene
scene['acceptance_view'] = kind
scene['source_model'] = MAIN.name
scene['source_sha256'] = SOURCE_HASH
scene['geometry_note'] = 'Collector geometry is appended from the assembled juicer, not independently redrawn'
about = bpy.data.texts.new('ABOUT_Collector_Acceptance')
about.write(f'Independent {kind} collector acceptance. Source: {MAIN.name}. Only collector meshes, rims and studio objects are included.\n')
bpy.ops.object.select_all(action='DESELECT')
appended[0].select_set(True)
bpy.context.view_layer.objects.active = appended[0]
scene.frame_set(1)
bpy.context.view_layer.update()
path = OUT/spec['file']
bpy.ops.wm.save_as_mainfile(filepath=str(path), compress=True)
bpy.ops.wm.open_mainfile(filepath=str(path))
scene = bpy.context.scene
scene.frame_set(1)
bpy.context.view_layer.update()
juice = bpy.data.objects.get('Juice_Collection_Box_Contoured')
residue = bpy.data.objects.get('Residue_Collection_Box')
primary = residue if kind == 'residue' else juice
non_manifold, volume, primary_tree = evaluated_bin(primary)
center_error = Vector((center(primary).x,center(primary).y,0)).length if kind != 'pair' else Vector(((center(juice)+center(residue)).x/2,(center(juice)+center(residue)).y/2,0)).length
report = {
'file': spec['file'],
'preview': spec['preview'],
'source_blend': MAIN.name,
'source_blend_sha256': SOURCE_HASH,
'acceptance_view': kind,
'source_objects': source_object_names,
'object_count': len(appended),
'center_error_m': center_error,
'rim_height_range_m': primary['rim_max_z_m']-primary['rim_min_z_m'],
'non_manifold_edges': non_manifold,
'volume_m3': volume,
'linked_library_count': len(bpy.data.libraries),
'missing_external_assets': [image.filepath for image in bpy.data.images if image.source == 'FILE' and not image.packed_file and not Path(bpy.path.abspath(image.filepath)).exists()],
'machine_parts_excluded': all(name not in bpy.data.objects for name in ['Cabinet_Main_Body', 'Chamber_Rear_Wall', 'Chamber_Lower_Backplate', 'Residue_Service_Door', 'Collection_Deck_Assembly', 'Fixed_Control_Pod_Assembly', 'Lower_Service_Cover_Assembly']),
'depth_m': primary.dimensions.y,
'source_depth_matches': abs(primary.dimensions.y-primary['depth_m']) < 0.0001,
'front_shallow_collector': primary.dimensions.y < 0.180,
'visual_review_passed': False,
}
if kind == 'pair':
residue_left = min((residue.matrix_world @ Vector(corner)).x for corner in residue.bound_box)
juice_right = max((juice.matrix_world @ Vector(corner)).x for corner in juice.bound_box)
report['collector_wall_gap_m'] = residue_left-juice_right
report['close_pair_without_divider'] = abs(report['collector_wall_gap_m']-0.007) < 0.0001
if kind in ['juice', 'pair']:
handle_x = center(juice).x-0.060
handle_y = 0.060+spec['offset'][1]
handle_hit = primary_tree.ray_cast(Vector((handle_x, handle_y, 0.128)), Vector((1, 0, 0)), 0.060)[0]
upper_hit = primary_tree.ray_cast(Vector((handle_x, handle_y, 0.175)), Vector((1, 0, 0)), 0.060)[0]
report['handle_through_cut_passed'] = handle_hit is None and upper_hit is not None
if kind in ['residue','pair']:
residue_tree = primary_tree if kind == 'residue' else evaluated_bin(residue)[2]
pull_x = 0.0625+spec['offset'][0]
pull_y = 0.169+spec['offset'][1]
pull_hit = residue_tree.ray_cast(Vector((pull_x,pull_y,0.165)),Vector((0,-1,0)),0.030)[0]
wall_hit = residue_tree.ray_cast(Vector((pull_x,pull_y,0.180)),Vector((0,-1,0)),0.030)[0]
report['integrated_front_pull_passed'] = pull_hit is None and wall_hit is not None
report['technical_checks_passed'] = (
report['object_count'] == len(spec['objects']) and report['center_error_m'] < 0.0001
and report['rim_height_range_m'] > 0.012 and report['non_manifold_edges'] == 0
and report['volume_m3'] > 0 and report['linked_library_count'] == 0
and not report['missing_external_assets'] and report['machine_parts_excluded']
and report['source_depth_matches'] and report['front_shallow_collector']
and report.get('handle_through_cut_passed', True)
and report.get('integrated_front_pull_passed', True)
and report.get('close_pair_without_divider', True)
)
report['passed'] = report['technical_checks_passed']
assert report['passed'], f'{kind} collector export validation failed: {report}'
scene.render.filepath = str(OUT/spec['preview'])
bpy.ops.render.render(write_still=True)
(OUT/spec['report']).write_text(json.dumps(report, ensure_ascii=False, indent=2)+'\n', encoding='utf-8')
print('COLLECTOR_EXPORT_COMPLETE '+json.dumps(report), flush=True)
if __name__ == '__main__':
for part in ['residue', 'juice', 'pair']:
export_part(part)
@@ -0,0 +1,26 @@
{
"file": "PerfectCoffee_Juice_Bin.blend",
"preview": "preview_juice_bin.png",
"source_blend": "PerfectCoffee_Minex_Mechanism.blend",
"source_blend_sha256": "1aa35413ea2d01adcf8c413cfa0a2c688cf67852c58abf3a259727ecb5c54c4c",
"acceptance_view": "juice",
"source_objects": [
"Juice_Collection_Box_Contoured",
"Juice_Bin_Contoured_Rim"
],
"object_count": 2,
"center_error_m": 2.514570951461792e-08,
"rim_height_range_m": 0.01303508771929826,
"non_manifold_edges": 0,
"volume_m3": 0.00027286890833844407,
"linked_library_count": 0,
"missing_external_assets": [],
"machine_parts_excluded": true,
"depth_m": 0.1340000033378601,
"source_depth_matches": true,
"front_shallow_collector": true,
"visual_review_passed": true,
"handle_through_cut_passed": true,
"technical_checks_passed": true,
"passed": true
}
@@ -0,0 +1,26 @@
{
"file": "PerfectCoffee_Residue_Bin.blend",
"preview": "preview_residue_bin.png",
"source_blend": "PerfectCoffee_Minex_Mechanism.blend",
"source_blend_sha256": "1aa35413ea2d01adcf8c413cfa0a2c688cf67852c58abf3a259727ecb5c54c4c",
"acceptance_view": "residue",
"source_objects": [
"Residue_Collection_Box",
"Residue_Box_Open_Rim"
],
"object_count": 2,
"center_error_m": 1.2485281396559545e-07,
"rim_height_range_m": 0.0890375463968901,
"non_manifold_edges": 0,
"volume_m3": 0.0005133609813965412,
"linked_library_count": 0,
"missing_external_assets": [],
"machine_parts_excluded": true,
"depth_m": 0.171999990940094,
"source_depth_matches": true,
"front_shallow_collector": true,
"visual_review_passed": true,
"integrated_front_pull_passed": true,
"technical_checks_passed": true,
"passed": true
}