feat: establish coffee game and grinder baseline
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
*.blend filter=lfs diff=lfs merge=lfs -text
|
||||
*.blend1 filter=lfs diff=lfs merge=lfs -text
|
||||
*.glb filter=lfs diff=lfs merge=lfs -text
|
||||
*.gltf filter=lfs diff=lfs merge=lfs -text
|
||||
*.fbx filter=lfs diff=lfs merge=lfs -text
|
||||
*.obj filter=lfs diff=lfs merge=lfs -text
|
||||
*.stl filter=lfs diff=lfs merge=lfs -text
|
||||
*.usdz filter=lfs diff=lfs merge=lfs -text
|
||||
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
||||
*.mov filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.jpg filter=lfs diff=lfs merge=lfs -text
|
||||
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
||||
*.webp filter=lfs diff=lfs merge=lfs -text
|
||||
*.tif filter=lfs diff=lfs merge=lfs -text
|
||||
*.tiff filter=lfs diff=lfs merge=lfs -text
|
||||
*.exr filter=lfs diff=lfs merge=lfs -text
|
||||
*.hdr filter=lfs diff=lfs merge=lfs -text
|
||||
*.heic filter=lfs diff=lfs merge=lfs -text
|
||||
*.heif filter=lfs diff=lfs merge=lfs -text
|
||||
*.dng filter=lfs diff=lfs merge=lfs -text
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
# Python-generated files
|
||||
__pycache__/
|
||||
*.py[oc]
|
||||
build/
|
||||
dist/
|
||||
wheels/
|
||||
*.egg-info
|
||||
|
||||
# Virtual environments
|
||||
.venv
|
||||
|
||||
# macOS
|
||||
.DS_Store
|
||||
|
||||
# Blender backups and local modeling work
|
||||
*.blend1
|
||||
**/_work/
|
||||
@@ -0,0 +1 @@
|
||||
3.15
|
||||
@@ -0,0 +1,11 @@
|
||||
# 完美咖啡项目指导文档
|
||||
## Python 环境
|
||||
当前项目使用 uv 进行包管理,且建议使用"uv"系列的命令去管理依赖。建议任何命令先使用当前项目的 Python 虚拟环境去执行。
|
||||
当前可执行 Python 程序的位置,从项目的根目录出发,为:"./.venv/bin/python3"
|
||||
## 游戏引擎
|
||||
本项目预计使用尚未就位的 Godot4.6.1 去进行运行,在引擎程序尚未就位的时候,暂时使用 HTML 去进行模拟。
|
||||
### 测试页面
|
||||
任何细分的操作手感,或者是单独的机制都被建议先写一个测试文档,以HTML5网页形态去运行,然后经过测试确定运行良好之后,就可以写进策划案。
|
||||
测试页面因为其方便被 Agent 操作和人类友好特性,也被建议在设计测试场景之前去进行早期的白盒测试,以及样板间搭建。
|
||||
### 测试场景
|
||||
当前 Godot4.6.1 尚未就位,但是原则上一个场景一个文件
|
||||
@@ -0,0 +1,208 @@
|
||||
# La Marzocco GS3 MP 咖啡冲泡流程
|
||||
|
||||
> **文档用途**:为《完美咖啡》的专业咖啡机交互与流程设计提供现实参照。
|
||||
>
|
||||
> **参考机型**:La Marzocco GS3 MP(Mechanical Paddle,机械拨杆版),不是 GS3 AV 自动定量版。
|
||||
>
|
||||
> **范围**:从开机准备到浓缩咖啡进入杯中;不包含打奶泡、清洗和后续饮品加料。
|
||||
|
||||
---
|
||||
|
||||
## 第0章:文档索引
|
||||
|
||||
### 0.1 流程索引
|
||||
|
||||
1. [第1章:开机并检查供水与机器状态](#第1章开机并检查供水与机器状态)
|
||||
2. [第2章:设定萃取温度并完成预热](#第2章设定萃取温度并完成预热)
|
||||
3. [第3章:选择咖啡豆并设定研磨](#第3章选择咖啡豆并设定研磨)
|
||||
4. [第4章:研磨、接粉与确认粉量](#第4章研磨接粉与确认粉量)
|
||||
5. [第5章:布粉与压粉](#第5章布粉与压粉)
|
||||
6. [第6章:安装手柄并放置咖啡杯](#第6章安装手柄并放置咖啡杯)
|
||||
7. [第7章:拨动拨杆,开始进水](#第7章拨动拨杆开始进水)
|
||||
8. [第8章:低压预浸泡](#第8章低压预浸泡)
|
||||
9. [第9章:渐进升压](#第9章渐进升压)
|
||||
10. [第10章:主萃取与过程观察](#第10章主萃取与过程观察)
|
||||
11. [第11章:尾段降压与萃取终点判断](#第11章尾段降压与萃取终点判断)
|
||||
12. [第12章:咖啡液流入杯中](#第12章咖啡液流入杯中)
|
||||
|
||||
### 0.2 阅读约定
|
||||
|
||||
- GS3 MP 不内置磨豆机,第3~5章需要独立磨豆机和手工粉碗操作。
|
||||
- 两个压力表不是调节器。蒸汽压力表显示蒸汽锅炉状态;冲煮头压力表显示萃取时的实际压力。浓缩咖啡制作主要观察后者。
|
||||
- 咖啡锅炉温度在萃取前设置;萃取中的连续输入主要是拨杆开度随时间的变化。
|
||||
- 水流量与冲煮头压力相关但不相同。拨杆改变阀门开度,实际压力与流量还受到粉饼阻力影响。
|
||||
- 为便于拆分流程,本文将“咖啡液流入杯中”单列为最后一章。**真实操作中,出液会在主萃取阶段开始,并与尾段降压和终点判断同时进行,而不是停止机器后才突然流入杯中。**
|
||||
- 文中的压力与操作示例用于解释流程,不是所有咖啡豆通用的固定配方。
|
||||
|
||||
---
|
||||
|
||||
## 第1章:开机并检查供水与机器状态
|
||||
|
||||
**目的**:让咖啡机具备安全、稳定工作的基本条件。
|
||||
|
||||
**操作**:接通电源并开机,根据使用方式确认水箱水量或外部供水是否正常,同时检查排水、滴水盘和冲煮头是否处于可用状态。
|
||||
|
||||
**机器状态**:咖啡锅炉开始加热;如果后续需要制作奶咖,蒸汽锅炉也独立加热。只制作浓缩咖啡时,核心关注对象是咖啡锅炉与冲煮头。
|
||||
|
||||
**需要确认的反馈**:供水正常,机器没有缺水或异常提示,手柄、粉碗和冲煮头清洁,上一杯留下的残粉和积水不会影响本杯。
|
||||
|
||||
**进入下一步的条件**:机器正常启动,供水与基础清洁状态满足制作要求。
|
||||
|
||||
---
|
||||
|
||||
## 第2章:设定萃取温度并完成预热
|
||||
|
||||
**目的**:确定本杯咖啡的热萃取条件,并让整个冲煮路径达到稳定温度。
|
||||
|
||||
**操作**:通过数字控制界面设置咖啡锅炉温度。需要打奶泡时,另行设置蒸汽锅炉温度;两套温度不互相代替。
|
||||
|
||||
**机器状态**:咖啡锅炉提供萃取用水并影响饱和式冲煮头温度。显示屏达到设定值,不代表手柄、粉碗和整个冲煮路径都必然已经充分热透,因此需要预留完整预热时间。
|
||||
|
||||
**对咖啡的影响**:较高水温通常加快萃取,也更容易带出错配时的苦感与粗糙感;较低水温通常减慢萃取,错配时可能出现尖酸、单薄和萃取不足。温度需要与烘焙度、研磨和出液目标共同决定。
|
||||
|
||||
**进入下一步的条件**:咖啡锅炉与冲煮系统已经充分预热,萃取温度设定完成且读数稳定。
|
||||
|
||||
---
|
||||
|
||||
## 第3章:选择咖啡豆并设定研磨
|
||||
|
||||
**目的**:根据咖啡豆与目标饮品建立本杯的粉饼阻力基础。
|
||||
|
||||
**操作**:确认咖啡豆、目标粉量和目标出液量,在独立磨豆机上设定研磨精细度。
|
||||
|
||||
**实际作用**:研磨越细,通常意味着粉饼阻力越大,在相同供水和拨杆操作下更容易表现为流量减小、压力升高;研磨越粗则通常相反。但烘焙、养豆状态、粉量和粉碗也会改变结果,不能只看刻度推断杯中品质。
|
||||
|
||||
**需要避免的误解**:不存在脱离豆子和配方的“最细最好”或“某个固定刻度永远正确”。调整研磨是为了获得合适的流动与萃取,而不是单纯追求高压力。
|
||||
|
||||
**进入下一步的条件**:本批咖啡豆、粉量目标和研磨设定已经确认。
|
||||
|
||||
---
|
||||
|
||||
## 第4章:研磨、接粉与确认粉量
|
||||
|
||||
**目的**:得到粉量明确、可用于制作均匀粉饼的一份咖啡粉。
|
||||
|
||||
**操作**:启动磨豆机,将本份咖啡粉接入粉碗,并核对实际粉量是否符合本次配方。
|
||||
|
||||
**机器与材料状态**:从这一章开始,研磨设定已经转化为实际粉末。之后再转动磨豆机刻度,不会改变粉碗中已经磨好的咖啡粉。
|
||||
|
||||
**对后续流程的影响**:粉量过多或过少都会改变粉饼厚度、阻力和粉液比;即使后续拨杆操作完全相同,也可能得到不同压力、流量和萃取结果。
|
||||
|
||||
**进入下一步的条件**:粉碗中的粉量符合目标,粉末没有明显结块或异常撒落。
|
||||
|
||||
---
|
||||
|
||||
## 第5章:布粉与压粉
|
||||
|
||||
**目的**:让咖啡粉在粉碗中形成密度尽量均匀、表面平整的粉饼。
|
||||
|
||||
**操作**:先通过布粉使粉末分布均匀,再垂直、平稳地压粉,使粉饼表面保持水平。
|
||||
|
||||
**实际作用**:这一步不是为了“压得越用力越好”,而是减少粉饼内部的密度差与薄弱区域。分布不均或压歪会使水更容易从局部通过,形成通道效应。
|
||||
|
||||
**异常反馈**:粉饼一侧高一侧低、明显裂缝、大量干粉附着在外缘,都意味着后续可能出现压力和出液不均。
|
||||
|
||||
**进入下一步的条件**:粉饼完整、平整,粉碗与手柄外部没有妨碍密封的残粉。
|
||||
|
||||
---
|
||||
|
||||
## 第6章:安装手柄并放置咖啡杯
|
||||
|
||||
**目的**:建立密封的冲煮路径,并准备好承接咖啡液的容器。
|
||||
|
||||
**操作**:将手柄装入冲煮头并锁紧,随后把咖啡杯放到手柄出液嘴下方。
|
||||
|
||||
**需要确认的反馈**:手柄锁定到位,杯子的位置能够承接全部出液,杯量与本次目标饮品相称。
|
||||
|
||||
**流程边界**:此时冲煮头尚未开始正常萃取,冲煮头压力表不应被当作已经形成的萃取压力。真正的读数变化从下一步进水开始。
|
||||
|
||||
**进入下一步的条件**:手柄、粉饼和杯子就位,可以立即开始萃取。
|
||||
|
||||
---
|
||||
|
||||
## 第7章:拨动拨杆,开始进水
|
||||
|
||||
**目的**:让水进入冲煮头并开始润湿咖啡粉饼。
|
||||
|
||||
**操作**:将机械拨杆从关闭位置移动到初始开启位置,同时开始记录本次萃取过程。
|
||||
|
||||
**机器状态**:拨杆驱动内部锥形阀改变开度。此时记录的是一次连续手动操作的开始,不是调用一个自动压力程序。
|
||||
|
||||
**杯中与压力反馈**:干粉饼会先吸收一部分水,因此开始进水不等于杯中立即出液。冲煮头压力开始形成,但其数值取决于阀门开度和粉饼阻力,不能直接把拨杆角度换算成固定压力。
|
||||
|
||||
**进入下一步的条件**:水已经开始进入冲煮头,保持适合预浸泡的较低流量或压力状态。
|
||||
|
||||
---
|
||||
|
||||
## 第8章:低压预浸泡
|
||||
|
||||
**目的**:在主萃取之前,让粉饼均匀吸水、排气并建立稳定的流动路径。
|
||||
|
||||
**操作**:保持拨杆在部分开启的位置,使粉饼经历一段低压或低流量润湿。持续时间由操作者控制,而不是机器自动倒数。
|
||||
|
||||
**机器与粉饼状态**:水逐渐穿过粉层,粉饼吸水、膨胀,冲煮头压力表提供实时反馈。杯中可能尚未出液,也可能在后期开始出现少量液滴。
|
||||
|
||||
**对咖啡的影响**:充分的预浸泡通常有助于减少局部干区和通道效应,使后续萃取更均匀。过短可能润湿不足;过长则会提前开始实际萃取并改变总接触时间,并非越久越好。
|
||||
|
||||
**进入下一步的条件**:粉饼已经得到所需程度的润湿,可以进入主萃取,而不是机械地等到某个固定秒数。
|
||||
|
||||
---
|
||||
|
||||
## 第9章:渐进升压
|
||||
|
||||
**目的**:从预浸泡平稳过渡到主萃取,减少对粉饼的突然冲击。
|
||||
|
||||
**操作**:继续移动拨杆,逐渐增大阀门开度,同时观察冲煮头压力表和出液状态。
|
||||
|
||||
**机器状态**:压力随供水、阀门开度和粉饼阻力共同上升。操作者控制的是升压过程,而不是在屏幕上直接输入一个瞬间生效的压力值。
|
||||
|
||||
**对咖啡的影响**:渐进升压通常更温和,有助于降低粉饼被突然压实、细粉迁移或局部开裂的风险。升压过快可能扰动粉饼;升压过慢则会延长低流量阶段,改变整体萃取节奏。
|
||||
|
||||
**进入下一步的条件**:冲煮头达到本次配方所需的主萃取状态,且没有异常压力波动或明显偏流出液。
|
||||
|
||||
---
|
||||
|
||||
## 第10章:主萃取与过程观察
|
||||
|
||||
**目的**:在主要萃取阶段溶解咖啡中的可溶物,并持续判断粉饼与出液是否正常。
|
||||
|
||||
**操作**:保持适合的拨杆开度,观察冲煮头压力、杯中出液速度、液流形态、颜色变化和累计时间。
|
||||
|
||||
**机器与咖啡状态**:水通过粉饼并将可溶物带入杯中。压力表显示冲煮头处的实时压力,不是单独决定品质的分数;流量和压力必须结合研磨、粉饼状态与出液量理解。
|
||||
|
||||
**异常反馈**:
|
||||
|
||||
- 压力很高但几乎不出液,可能与粉饼阻力过大或堵塞有关。
|
||||
- 压力偏低且出液过快,可能与研磨过粗、粉量不足或粉饼阻力过低有关。
|
||||
- 压力突然下降并伴随局部喷射,可能意味着通道效应。
|
||||
- 液流忽快忽慢或明显偏向一侧,可能意味着粉饼密度或密封状态不均。
|
||||
|
||||
**进入下一步的条件**:主萃取已经完成大部分目标出液,准备进入尾段控制或结束萃取。
|
||||
|
||||
---
|
||||
|
||||
## 第11章:尾段降压与萃取终点判断
|
||||
|
||||
**目的**:根据配方和实际出液状态控制最后一段萃取,避免只按固定时间机械停止。
|
||||
|
||||
**操作**:如采用下降压力曲线,可在尾段逐渐收小拨杆,降低冲煮头压力与流量;同时依据目标出液量、时间和风味方案判断停止时机。
|
||||
|
||||
**实际作用**:随着萃取进行,粉饼中的可溶物减少,结构也可能逐渐松散。尾段降压可用于控制后段出液并减少对粉饼的持续冲击,但并非每杯都必须使用。
|
||||
|
||||
**终点判断**:过早停止可能造成出液不足和萃取不足;过晚停止会增加出液量、降低浓度,并可能带入更多不期望的后段风味。停止条件应以本次配方为准,而不是把某个压力、秒数或颜色当成所有咖啡豆的共同标准。
|
||||
|
||||
**进入下一步的条件**:已达到本次出液终点,操作者准备关闭拨杆并结束本杯萃取。
|
||||
|
||||
---
|
||||
|
||||
## 第12章:咖啡液流入杯中
|
||||
|
||||
**目的**:将由粉饼萃取出的咖啡液承接为最终浓缩咖啡,并完成出杯。
|
||||
|
||||
**实际过程**:咖啡液从手柄出液嘴流入杯中。它在主萃取阶段已经开始流出,并随着主萃取和尾段控制逐渐累积;本章将其单独列出,是为了明确最终物料流向与游戏流程终点。
|
||||
|
||||
**操作与结束动作**:达到目标出液后关闭拨杆,停止向冲煮头供水。等待残余液滴自然滴落,再将完成的咖啡杯从出液位置移走。
|
||||
|
||||
**最终状态**:杯中得到本次实际出液量对应的浓缩咖啡。其风味由豆子、研磨、粉量、布粉与压粉、萃取温度、拨杆操作、粉饼阻力、压力、流量和萃取终点共同形成,不能由某一个仪表读数单独决定。
|
||||
|
||||
**流程终点**:咖啡液已进入杯中,本次 GS3 MP 浓缩咖啡冲泡流程完成。
|
||||
@@ -0,0 +1,134 @@
|
||||
# 《完美咖啡》咖啡机建模文档
|
||||
|
||||
> **版本**:v0.2
|
||||
> **主要参考**:[02 号咖啡机](model_assets/reference/coffee_machine/02_scopia_mechanika_profi_due_cc-by/coffee_machine.blend)
|
||||
> **用途**:指导首版咖啡机的 Blender 灰盒、部件拆分与低多边形细化。
|
||||
|
||||
## 1. 目标与范围
|
||||
|
||||
以 02 号模型的金属机身、冲煮头、手柄和滴水盘为主要外形参考,制作一台**单冲煮头、低多边形、第一人称近距离可读**的咖啡机。
|
||||
|
||||
首版只拆分为以下部件:
|
||||
|
||||
1. 沸水阀
|
||||
2. 温度计
|
||||
3. 水流计
|
||||
4. 水流拨杆
|
||||
5. 咖啡机本体与冲煮头
|
||||
6. 可拆卸手柄
|
||||
7. 滴水盘
|
||||
|
||||
**不建水路、电路、锅炉和内部机械结构,也不建“流量 / 预浸泡 / 萃取状态”综合显示面板。**相关状态以后由界面表现,不增加实体模型。
|
||||
|
||||
02 号模型是双冲煮头商用机,首版不照搬其双头布局、整体尺寸或蒸汽/热水附加结构。若后续直接复用其网格,需遵守随模型保存的 CC BY 3.0 授权及署名要求。
|
||||
|
||||
## 2. 统一建模约定
|
||||
|
||||
- 使用 Blender,以米为单位;先在工位中确定整机灰盒尺度,再进行细化,不沿用参考文件的坐标数值。
|
||||
- Blender 内采用 **Z 轴向上、正面朝 -Y**;整机原点位于机器底部与台面的接触中心。
|
||||
- 本体、冲煮头和所有可动件分别命名,不合并成一个不可拆网格。
|
||||
- 建议命名:`CM_Body`、`CM_GroupHead`、`CM_HotWaterValve`、`CM_HotWaterDial`、`CM_TempGauge`、`CM_FlowGauge`、`CM_FlowLever`、`CM_FlowDial`、`CM_Portafilter`、`CM_DripTray`。
|
||||
- 先保证轮廓与操作可读性,再使用少量倒角、加权法线和材质区分提升质感;不为近距离不可见的细节增加面数。
|
||||
- 阀门、联动刻度盘、计量表指针、拨杆和手柄的动画均由交互逻辑驱动,**不烘焙固定动画**。
|
||||
- 默认零位为 `hot_water_open=0`、`brew_flow=0`、`temperature_c=0`:温度计与水流计指针指向各自左端的 `0` 刻度,两侧圆台和拨杆的旋转偏移均为 `0°`,`0° / 0%` 刻度朝向正面箭头,手柄保持统一的初始持握姿态。
|
||||
|
||||
## 3. 部件建模要求
|
||||
|
||||
### 3.1 沸水阀 `CM_HotWaterValve` / `CM_HotWaterDial`
|
||||
|
||||
- **安装位置**:温度调节组件位于咖啡机左侧,圆台中心位于 y=-0.095 m,大圆底面与左侧 YOZ 侧板贴合,窄顶和手柄朝外;温度计与红色箭头保留在正面。
|
||||
- **几何构成**:侧向圆台、外端连接盖、倾斜金属杆和深色握柄。圆台沿 X 轴外伸约 30 mm、底部直径约 69.6 mm、顶部直径约 51.6 mm;连接盖直径约 46.8 mm,略小于圆台顶面。
|
||||
- **连接关系**:连接盖位于圆台外端窄面中心,金属杆从连接盖向外上方伸出并连接握柄,圆台底面不得悬离侧板。
|
||||
- **开度指示**:全部角度刻度环绕圆台锥面布置。刻度贴图从靠机身的大圆底边开始,向靠手柄的小圆顶面延伸;主刻度宽约 10 像素、长约 13 mm,次刻度宽约 5 像素、长约 8 mm,数字位于刻度线靠小圆端的一侧并保持正向。当前开度对应的刻度朝向前方 -Y。正面红色箭头采用透明贴花形式的等腰三角形,中心位于 x=-0.214 m,尖端距圆台大圆底面约 10 mm;贴花仅高出面板约 0.3 mm,不使用悬浮几何。底边与 XOZ 正视图中的机身侧边平行,尖端向左指向圆台,中心高度 z=0.337 m,与圆台几何中心等高。最大开度角由后续交互确定。
|
||||
- **外观识别**:金属杆与圆台顶面使用金属材质,连接盖和握柄使用深色材质,保留少量红色沸水标记。刻度线继续使用原锥面 UV 贴图;角度数字改用 Blender Bfont 矢量字体生成透明图集,通过独立 UV 曲面贴片贴合锥面,不使用像素字体或实体文字。字高约 5 mm,文字基线沿 X 轴,图集单元格与文字贴片的轴向尺寸比均为 2:1,避免异常拉伸。
|
||||
- **枢轴要求**:连接盖、手柄和圆台绕同一 X 轴,由同一个归一化阀门开度驱动;红色箭头固定在正面,不单独转动。
|
||||
- **注意事项**:阀门开度由锥面刻度读取,实际水温仍只看正面温度计;不得与水流拨杆共用控制器或外观。
|
||||
|
||||
### 3.2 温度计 `CM_TempGauge`
|
||||
|
||||
- **安装位置**:保留在咖啡机正面,不随沸水阀移至侧面。中心位于 x=-0.112 m、y=-0.169 m、z=0.337 m,偏离整机 XOZ 中轴线以扩大双表间距,并避让升高后的冲煮头。
|
||||
- **参考与比例**:参考 02 号模型正面的圆形计量表,保留金属表圈、表盘和指针的层次。表壳半径为 48 mm、直径为 96 mm,优先保证玩家读数清楚。
|
||||
- **几何构成**:圆形金属表圈、表盘和独立指针。表圈使用低分段圆柱与倒角即可,表盘数字和刻度使用贴图。
|
||||
- **表盘规范**:`0–100°C` 对应半圆 `180°`;`0°C` 在左端、`50°C` 在顶部、`100°C` 在右端,表盘明确标注 `°C`。
|
||||
- **枢轴要求**:指针原点位于表盘圆心,旋转轴垂直于表盘;指针与表圈、表盘分件。
|
||||
- **注意事项**:只表现出水口温度反馈,不增加温度设定旋钮,也不建内部电子探头。
|
||||
|
||||
### 3.3 水流计 `CM_FlowGauge`
|
||||
|
||||
- **安装位置**:与温度计一起保留在咖啡机正面,不随水流拨杆移至右侧。中心位于 x=0.112 m、y=-0.169 m、z=0.337 m,与温度计中心距为 224 mm,两表壳之间保留约 128 mm 净间距。
|
||||
- **参考与比例**:与温度计共同参考 02 号模型的双圆表结构,表壳半径同为 48 mm、直径为 96 mm。复用基础表圈比例,通过刻度和指针颜色与温度计区分。
|
||||
- **表盘规范**:标注 `FLOW`,以 `0–100%` 表示相对萃取水流量;首版不虚构 `L/min` 等物理单位。
|
||||
- **枢轴要求**:指针独立,原点与旋转轴设置方式同温度计,并与水流拨杆使用同一个实际流量数据驱动。
|
||||
- **注意事项**:水流计必须保留,作为拨杆根部小表盘之外的主读数仪表;玩家看不清小表盘时仍能直接读取水流大小。
|
||||
|
||||
### 3.4 水流拨杆 `CM_FlowLever` / `CM_FlowDial`
|
||||
|
||||
- **安装位置**:水流控制组件位于咖啡机右侧,圆台中心位于 y=-0.095 m,大圆底面与右侧 YOZ 侧板贴合,窄顶和拨杆朝外;独立水流计与红色指针保留在正面。
|
||||
- **几何构成**:侧向圆台、外端连接盖、倾斜金属拨杆和深色握柄。圆台沿 X 轴外伸约 30 mm、底部直径约 69.6 mm、顶部直径约 51.6 mm;连接盖直径约 46.8 mm,略小于圆台顶面。
|
||||
- **连接关系**:连接盖位于圆台外端窄面中心,金属拨杆从连接盖向外上方伸出并连接握柄,圆台底面不得悬离侧板。
|
||||
- **水流指示**:全部刻度环绕圆台锥面布置,采用与沸水阀一致的加粗、底边延伸刻度和朝前的当前值。正面红色指针采用透明贴花形式的等腰三角形,中心位于 x=0.214 m,尖端距圆台大圆底面约 10 mm;贴花仅高出面板约 0.3 mm,不使用悬浮几何。底边与 XOZ 正视图中的机身侧边平行,尖端向右指向圆台,中心高度 z=0.337 m,与圆台几何中心等高,用于指示 `0–100%` 的当前水流大小。
|
||||
- **外观识别**:握柄轮廓明显长于计量表指针,便于第一人称视角识别与点击。刻度线使用原锥面 UV 贴图,`0% / 50% / 100%` 三个关键数字使用与沸水阀相同的 Bfont 矢量文字图集和独立 UV 曲面贴片,字高约 5 mm、基线沿 X 轴,避免像素字体和异常拉伸,并与独立水流计保持一致的百分比含义。
|
||||
- **枢轴要求**:连接盖、拨杆和圆台绕同一 X 轴,由同一个归一化流量开度驱动;红色指针固定在正面,不单独转动。
|
||||
- **注意事项**:这是连续水流控制件,不制作成按钮、蒸汽阀或温度调节杆,也不因已有水流计而省略圆台读数盘。
|
||||
|
||||
### 3.5 咖啡机本体与冲煮头 `CM_Body` / `CM_GroupHead`
|
||||
|
||||
- **本体构成**:以倒角箱体制作外壳,前面板、侧板和底部基座可分件;前面板宽约 0.45 m,为靠近侧边的读数贴花提供完整贴合面。顶部杯架参考 02 号模型,用少量圆杆构成。
|
||||
- **整体比例**:采用紧凑的单头商用机比例,保留足够大的杯位和操作面板,不复制 02 号模型的双头宽度或其合并网格连接方式。
|
||||
- **冲煮头构成**:机身安装座、竖直冲煮头上壳、完整密封座和两段金属承托弧。功能接口沿 Z 轴朝向下方,中心为 x=0、y=-0.237 m,不使用朝向 -Y 的实心圆盘作为手柄接口。方案 A 将冲煮组件相对旧版向前移动 15 mm、向上移动 70 mm。
|
||||
- **安装座**:沿 Y 轴的安装座长度为 73 mm,中心为 x=0、y=-0.1935 m、z=0.320 m;后端保持在 y=-0.157 m 并连接前面板,前端随冲煮轴前移。
|
||||
- **承接尺寸**:固定承接座外半径 50 mm、下段内半径 39 mm;承托弧底面 z=0.278 m、顶面 z=0.2835 m。粉碗上沿外半径 38.5 mm,与承接座保留约 0.5 mm 径向间隙。
|
||||
- **旋转卡口**:两个插入缺口分别朝向 90° / 270°,各宽 42°;两段承托弧范围为 111°–249° 和 291°–429°。锁定时手柄连接耳位于承托弧下方,解锁时反向旋转 45°,使连接耳对准缺口。只表现插接、旋转和承托关系,不建螺纹、弹簧或复杂锁止机构。
|
||||
- **密封与分水**:固定密封圈外半径 37.3 mm,平底顶面为 z=0.2865 m、下部斜面延伸至 z=0.2835 m,与粉碗上沿的密封接触面一致。分水网位于 z=0.2875 m,孔洞使用贴图。密封圈和分水网均属于固定冲煮头,不随手柄旋转或拆卸。
|
||||
- **材质重点**:机身以金属材质为主,握持区域使用深色材质;倒角用于产生可读的高光,不依赖高密度细分。
|
||||
- **注意事项**:首版不加入第二冲煮头、内部水路、锅炉或无交互用途的附加控制件;双流嘴不属于固定冲煮头。
|
||||
|
||||
### 3.6 可拆卸手柄 `CM_Portafilter`
|
||||
|
||||
- **几何构成**:使用旋转截面制作有内腔的金属粉碗,外半径 37.5 mm、上沿半径 38.5 mm,顶部 z=0.2835 m。内腔具有独立底部和滤网,滤网位于 z=0.262 m,孔洞使用贴图,不逐孔建模。
|
||||
- **连接耳**:两只相对的弧形连接耳位于 -45° / 135°,径向范围为 35.5–47.5 mm,角宽均为 16°,厚度约 2.9 mm。连接耳顶面 z=0.2779 m,比固定承托弧底面低 0.1 mm,不与承托弧实体穿插。
|
||||
- **装配关系**:粉碗上沿与固定密封圈在 z=0.2835 m 接触,卡口负责承托,密封圈负责密封。手柄原点位于粉碗中心的密封接触平面,旋转轴为 Z;插入方向为 +Z,反向旋转 45° 解锁后再向下取下。
|
||||
- **出液结构**:粉碗下方使用短环形连接座和两根中空出液管,出液口外半径 5 mm、内半径 3.2 mm,左右出口分别位于 x=-14 / +14 mm、z=0.227 m。倒角后的最低实体高度约为 z=0.224034 m。连接座和双流嘴全部属于 `CM_Portafilter`,拆卸时随手柄一起移动。
|
||||
- **持握结构**:金属柄颈连接粉碗侧壁与深色握柄,保留独立端盖,握柄朝玩家斜向下伸出,不与滴水盘穿插。
|
||||
- **注意事项**:手柄、连接耳、滤网和双流嘴必须与固定冲煮头分件;不得将手柄合并进机身,也不得在拆卸后把出液嘴留在固定冲煮头上。
|
||||
|
||||
### 3.7 滴水盘 `CM_DripTray`
|
||||
|
||||
- **几何构成**:浅盒底座、外框和承杯平面,保留可拆轮廓即可;承杯面高度保持为 z=0.098 m。
|
||||
- **孔洞表现**:参考 02 号模型的做法,格栅与孔洞使用贴图表现,**不逐孔布尔、不建密集格栅**。
|
||||
- **材质重点**:优先使用不透明颜色、法线和粗糙度贴图表现凹槽与金属质感,避免透明材质带来的排序问题。
|
||||
- **注意事项**:承杯面保持平整,杯子和手柄的装配位置优先于贴图细节。
|
||||
|
||||
### 3.8 接杯空间
|
||||
|
||||
- 验收只使用 `coffee_cup/PerfectCoffee_CoffeeCup.blend` 中的 `CC_Cup_Body`,不导入杯盖;杯高 110 mm、杯口直径 85 mm、杯底直径 60 mm。
|
||||
- 杯底中心位于 `(0, -0.237, 0.098) m`,与冲煮轴重合,底面贴合滴水盘承杯面。
|
||||
- 出液嘴到承杯面的最低净高为约 126.034 mm,出液嘴最低点高于杯口约 16.034 mm。
|
||||
- 以 `test_cup_placement.py` 检查实际网格,杯体与整机无实体穿插,除杯底与托盘的支承接触外无表面相交;正下方机位的冲煮头投影覆盖杯口投影的 100%。
|
||||
|
||||
## 4. 推荐建模顺序
|
||||
|
||||
1. 用灰盒确定整机、杯位、手柄和第一人称操作距离。
|
||||
2. 在正面布置温度计、水流计和两个红色读数标记,在两侧安装底面与侧板齐平的侧向圆台及其外端手柄。
|
||||
3. 完成本体、单冲煮头、可拆卸手柄和滴水盘的分件,手柄连接只保留简单卡位轮廓。
|
||||
4. 两侧连接盖、手柄和圆台分别绕同一 X 轴,由对应控制件的归一化开度驱动,并验证读数一致性。
|
||||
5. 最后统一倒角、法线、材质及锥面/滴水盘贴图,不再追加内部结构或综合状态面板。
|
||||
|
||||
## 5. 首版验收标准
|
||||
|
||||
- 整机只有一个冲煮头,固定接口沿 Z 轴朝下,承接座外半径 50 mm、下段内半径 39 mm;两个 42° 插入缺口与两段承托弧均为实际几何,不以实心圆盘穿插代替卡口。
|
||||
- 手柄粉碗具有内腔、贴图滤网、两只连接耳和独立枢轴;上沿半径 38.5 mm,与承接座有 0.5 mm 径向间隙。连接耳顶面 z=0.2779 m,与承托弧底面保持 0.1 mm 间隙;粉碗上沿与固定密封圈在 z=0.2835 m 接触。
|
||||
- 手柄反向旋转 45° 后,两只连接耳分别对准 90° / 270° 插入缺口,能够沿 -Z 方向取下。固定密封圈与分水网留在冲煮头上,粉碗滤网和双中空出液管随手柄移动,杯位与滴水盘无穿插。
|
||||
- 使用 `preview_brew_interface.png`、`preview_portafilter_detached.png` 和 `preview_portafilter_bowl.png` 检查装配、解锁拆卸和粉碗内部结构;卡口尺寸服务于本游戏比例,不作为原厂加工尺寸。
|
||||
- 使用 `cup_fit_test/validation.json` 和其中的正视、侧视验收图检查标准无盖杯:杯底贴合托盘、杯子位于冲煮轴正下方、投影重叠 100%,无实体穿插或非支承面的表面接触。
|
||||
- 沸水阀与水流拨杆在外观、位置和枢轴上均相互独立。
|
||||
- 两个读数盘均为侧向圆台,中心位于 y=-0.095 m,大圆底面与对应 YOZ 侧板贴合,沿 X 轴外伸约 30 mm,全部刻度位于锥面,前后边缘均不得突出侧板轮廓。
|
||||
- 圆台底部直径约 69.6 mm、顶部直径约 51.6 mm,连接盖直径约 46.8 mm,保持略小于顶面的关系;金属杆和握柄从外端连接盖伸出,连接处无分离或明显穿插。
|
||||
- 两侧连接盖、手柄与圆台绕同一 X 轴联动,不得将圆台竖直摆放在侧板旁。
|
||||
- 两个红色读数标记均为透明贴花等腰三角形,中心分别位于 x=-0.214 / +0.214 m,尖端距圆台大圆底面约 10 mm;贴花距面板约 0.3 mm,不使用悬浮几何。底边与 XOZ 正视图中的机身侧边平行,左侧尖端向左、右侧尖端向右;三角形中心高度均为 z=0.337 m,与对应圆台几何中心等高,且正面无遮挡。
|
||||
- 圆台刻度线继续使用 UV 贴图,从靠机身的大圆底边向靠手柄的小圆顶面延伸;主刻度宽 10 像素、次刻度宽 5 像素,当前刻度朝向前方 -Y。
|
||||
- 圆台数字使用 Bfont 矢量字体透明图集与独立 UV 曲面贴片,不使用像素字体或实体文字;字高约 5 mm、基线沿 X 轴,左右均无镜像或异常拉长。水流表仅保留 `0% / 50% / 100%` 三个关键数字,不得出现数字重叠。以 `preview_controls_front.png` 的 -Y 方向 XOZ 正面特写验证可读性,侧视只允许自然透视压缩,不人为拉伸补偿。
|
||||
- 温度计与独立水流计保留在正面,均参考 02 号模型;表壳半径均为 48 mm、直径均为 96 mm,中心分别位于 x=-0.112 / +0.112 m、z=0.337 m,中心距为 224 mm,两表壳净间距约 128 mm,不与冲煮头或两侧箭头重叠。指针绕正确轴心转动,默认指向左端零刻度。
|
||||
- 滴水盘孔洞由贴图完成,没有无意义的逐孔几何。
|
||||
- 模型中不包含水路、电路、锅炉、内部探头、复杂手柄锁止机构或综合状态面板。
|
||||
- 在正面、左侧和右侧的第一人称实际使用距离下,对应部件均能辨认和操作。
|
||||
@@ -0,0 +1,6 @@
|
||||
def main():
|
||||
print("Hello from perfetcoffee!")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,452 @@
|
||||
import bpy
|
||||
import bmesh
|
||||
import json
|
||||
import math
|
||||
from pathlib import Path
|
||||
from mathutils import Vector
|
||||
from mathutils.bvhtree import BVHTree
|
||||
|
||||
OUT = Path('/Users/yanchenyu/Documents/WebApps/PerfetCoffee/model_assets/coffee_cup')
|
||||
OUT.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
CM = 0.01
|
||||
SEGMENTS = 24
|
||||
CUP_HEIGHT = 11.0
|
||||
CUP_BOTTOM_RADIUS = 3.0
|
||||
CUP_TOP_RADIUS = 4.25
|
||||
CUP_THICKNESS = 0.2
|
||||
LID_BOTTOM = 10.7
|
||||
LID_TOP = 13.0
|
||||
LID_BOTTOM_RADIUS = 4.65
|
||||
LID_TOP_RADIUS = 3.9
|
||||
LID_THICKNESS = 0.1
|
||||
DECK_TOP = 12.55
|
||||
DECK_BOTTOM = DECK_TOP - LID_THICKNESS
|
||||
OPENING_CENTER_Y = 3.55
|
||||
OPENING_LENGTH = 1.0
|
||||
OPENING_WIDTH = 0.5
|
||||
VENT_CENTER_Y = -2.65
|
||||
VENT_RADIUS = 0.05
|
||||
|
||||
bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
bpy.context.preferences.filepaths.save_version = 0
|
||||
scene = bpy.context.scene
|
||||
scene.unit_settings.system = 'METRIC'
|
||||
scene.unit_settings.length_unit = 'CENTIMETERS'
|
||||
scene.unit_settings.scale_length = 1.0
|
||||
|
||||
model_collection = bpy.data.collections.new('CC_CoffeeCup_Model')
|
||||
studio_collection = bpy.data.collections.new('Studio_Exclude_From_Export')
|
||||
scene.collection.children.link(model_collection)
|
||||
scene.collection.children.link(studio_collection)
|
||||
|
||||
root = bpy.data.objects.new('CC_CoffeeCup_Assembly', None)
|
||||
model_collection.objects.link(root)
|
||||
root.empty_display_type = 'PLAIN_AXES'
|
||||
root.empty_display_size = 0.02
|
||||
root['units'] = 'meters; dimensions documented in centimeters'
|
||||
root['cup_height_cm'] = CUP_HEIGHT
|
||||
root['assembled_height_cm'] = LID_TOP
|
||||
root['lid_height_cm'] = LID_TOP - LID_BOTTOM
|
||||
root['assembly_overlap_cm'] = CUP_HEIGHT - LID_BOTTOM
|
||||
root['forward_axis'] = '+Y; XOY is the top view'
|
||||
root['radial_segments'] = SEGMENTS
|
||||
|
||||
|
||||
def move_to(obj, collection):
|
||||
for old_collection in list(obj.users_collection):
|
||||
old_collection.objects.unlink(obj)
|
||||
collection.objects.link(obj)
|
||||
return obj
|
||||
|
||||
|
||||
def make_material(name, color, roughness):
|
||||
mat = bpy.data.materials.new(name)
|
||||
mat.use_nodes = True
|
||||
mat.diffuse_color = (*color, 1.0)
|
||||
bsdf = mat.node_tree.nodes.get('Principled BSDF')
|
||||
bsdf.inputs['Base Color'].default_value = (*color, 1.0)
|
||||
bsdf.inputs['Roughness'].default_value = roughness
|
||||
return mat
|
||||
|
||||
|
||||
paper = make_material('CC_Cup_Paper', (0.82, 0.82, 0.79), 0.68)
|
||||
accent = make_material('CC_Cup_Accent', (0.82, 0.82, 0.79), 0.68)
|
||||
lid_white = make_material('CC_Lid_White', (0.70, 0.72, 0.70), 0.42)
|
||||
|
||||
|
||||
def recalculate_normals(mesh):
|
||||
bm = bmesh.new()
|
||||
bm.from_mesh(mesh)
|
||||
bmesh.ops.recalc_face_normals(bm, faces=list(bm.faces))
|
||||
bm.to_mesh(mesh)
|
||||
bm.free()
|
||||
mesh.update()
|
||||
|
||||
|
||||
def shade_mesh(obj):
|
||||
for polygon in obj.data.polygons:
|
||||
polygon.use_smooth = abs(polygon.normal.z) < 0.92
|
||||
|
||||
|
||||
def lathe(name, profile_cm, segments=SEGMENTS):
|
||||
vertices = []
|
||||
rings = []
|
||||
for radius, height in profile_cm:
|
||||
if radius == 0:
|
||||
rings.append([len(vertices)])
|
||||
vertices.append((0.0, 0.0, height * CM))
|
||||
else:
|
||||
ring = []
|
||||
for index in range(segments):
|
||||
angle = 2.0 * math.pi * index / segments
|
||||
ring.append(len(vertices))
|
||||
vertices.append((radius * CM * math.cos(angle), radius * CM * math.sin(angle), height * CM))
|
||||
rings.append(ring)
|
||||
faces = []
|
||||
for ring_index, first in enumerate(rings):
|
||||
second = rings[(ring_index + 1) % len(rings)]
|
||||
if len(first) == 1 and len(second) == 1:
|
||||
continue
|
||||
for index in range(segments):
|
||||
next_index = (index + 1) % segments
|
||||
if len(first) == 1:
|
||||
faces.append((first[0], second[next_index], second[index]))
|
||||
elif len(second) == 1:
|
||||
faces.append((first[index], first[next_index], second[0]))
|
||||
else:
|
||||
faces.append((first[index], first[next_index], second[next_index], second[index]))
|
||||
mesh = bpy.data.meshes.new(name + '_Mesh')
|
||||
mesh.from_pydata(vertices, [], faces)
|
||||
recalculate_normals(mesh)
|
||||
obj = bpy.data.objects.new(name, mesh)
|
||||
model_collection.objects.link(obj)
|
||||
obj.parent = root
|
||||
obj.data.materials.append(paper)
|
||||
shade_mesh(obj)
|
||||
return obj
|
||||
|
||||
|
||||
BAND_BOTTOM = CUP_HEIGHT * 1.0 / 5.0
|
||||
BAND_TOP = CUP_HEIGHT * 4.0 / 5.0
|
||||
|
||||
|
||||
def cup_radius_at(height):
|
||||
return CUP_BOTTOM_RADIUS + (CUP_TOP_RADIUS - CUP_BOTTOM_RADIUS) * height / CUP_HEIGHT
|
||||
|
||||
|
||||
cup_profile = [
|
||||
(0.0, 0.0),
|
||||
(CUP_BOTTOM_RADIUS, 0.0),
|
||||
(cup_radius_at(BAND_BOTTOM), BAND_BOTTOM),
|
||||
(cup_radius_at(BAND_TOP), BAND_TOP),
|
||||
(CUP_TOP_RADIUS, CUP_HEIGHT),
|
||||
(CUP_TOP_RADIUS - CUP_THICKNESS, CUP_HEIGHT),
|
||||
(cup_radius_at(BAND_TOP) - CUP_THICKNESS, BAND_TOP),
|
||||
(cup_radius_at(BAND_BOTTOM) - CUP_THICKNESS, BAND_BOTTOM),
|
||||
(CUP_BOTTOM_RADIUS - CUP_THICKNESS, CUP_THICKNESS),
|
||||
(0.0, CUP_THICKNESS),
|
||||
]
|
||||
cup = lathe('CC_Cup_Body', cup_profile)
|
||||
cup.data.materials.append(accent)
|
||||
for polygon in cup.data.polygons:
|
||||
center_height = polygon.center.z / CM
|
||||
radial_normal = polygon.center.x * polygon.normal.x + polygon.center.y * polygon.normal.y
|
||||
if BAND_BOTTOM <= center_height <= BAND_TOP and radial_normal > 0.0:
|
||||
polygon.material_index = 1
|
||||
cup['bottom_diameter_cm'] = CUP_BOTTOM_RADIUS * 2.0
|
||||
cup['top_diameter_cm'] = CUP_TOP_RADIUS * 2.0
|
||||
cup['wall_thickness_cm'] = CUP_THICKNESS
|
||||
cup['height_cm'] = CUP_HEIGHT
|
||||
cup['accent_band_start_cm'] = BAND_BOTTOM
|
||||
cup['accent_band_end_cm'] = BAND_TOP
|
||||
|
||||
lid_profile = [
|
||||
(LID_BOTTOM_RADIUS, LID_BOTTOM),
|
||||
(LID_BOTTOM_RADIUS, 10.95),
|
||||
(4.50, 11.40),
|
||||
(4.10, 11.40),
|
||||
(LID_TOP_RADIUS, LID_TOP),
|
||||
(LID_TOP_RADIUS - LID_THICKNESS, LID_TOP),
|
||||
(3.82, DECK_TOP),
|
||||
(0.0, DECK_TOP),
|
||||
(0.0, DECK_BOTTOM),
|
||||
(3.82, DECK_BOTTOM),
|
||||
(4.00, 11.30),
|
||||
(4.40, 11.30),
|
||||
(LID_BOTTOM_RADIUS - LID_THICKNESS, LID_BOTTOM),
|
||||
]
|
||||
lid = lathe('CC_Lid', lid_profile)
|
||||
lid.data.materials[0] = lid_white
|
||||
lid['bottom_diameter_cm'] = LID_BOTTOM_RADIUS * 2.0
|
||||
lid['top_diameter_cm'] = LID_TOP_RADIUS * 2.0
|
||||
lid['wall_thickness_cm'] = LID_THICKNESS
|
||||
lid['height_cm'] = LID_TOP - LID_BOTTOM
|
||||
lid['sip_opening_cm'] = '1.0 x 0.5; capsule/rounded rectangle; long axis X'
|
||||
lid['vent_diameter_cm'] = VENT_RADIUS * 2.0
|
||||
lid['opening_positions_cm'] = f'sip=(0,+{OPENING_CENTER_Y:.2f}), vent=(0,{VENT_CENTER_Y:.2f})'
|
||||
|
||||
|
||||
def capsule_points(length, width, center_y, arc_steps=7):
|
||||
radius = width / 2.0
|
||||
straight = (length - width) / 2.0
|
||||
points = []
|
||||
for step in range(arc_steps + 1):
|
||||
angle = -math.pi / 2.0 + math.pi * step / arc_steps
|
||||
points.append(((straight + radius * math.cos(angle)) * CM, (center_y + radius * math.sin(angle)) * CM))
|
||||
for step in range(arc_steps + 1):
|
||||
angle = math.pi / 2.0 + math.pi * step / arc_steps
|
||||
points.append(((-straight + radius * math.cos(angle)) * CM, (center_y + radius * math.sin(angle)) * CM))
|
||||
return points
|
||||
|
||||
|
||||
def capsule_solid(name, length, width, center_y, bottom_z, top_z, inner_width=None):
|
||||
outer = capsule_points(length, width, center_y)
|
||||
count = len(outer)
|
||||
if inner_width is None:
|
||||
vertices = [(x, y, bottom_z * CM) for x, y in outer] + [(x, y, top_z * CM) for x, y in outer]
|
||||
faces = [tuple(reversed(range(count))), tuple(range(count, count * 2))]
|
||||
for index in range(count):
|
||||
next_index = (index + 1) % count
|
||||
faces.append((index, next_index, count + next_index, count + index))
|
||||
else:
|
||||
inner = capsule_points(length - (width - inner_width), inner_width, center_y)
|
||||
vertices = (
|
||||
[(x, y, bottom_z * CM) for x, y in outer]
|
||||
+ [(x, y, bottom_z * CM) for x, y in inner]
|
||||
+ [(x, y, top_z * CM) for x, y in outer]
|
||||
+ [(x, y, top_z * CM) for x, y in inner]
|
||||
)
|
||||
faces = []
|
||||
for index in range(count):
|
||||
next_index = (index + 1) % count
|
||||
faces.extend([
|
||||
(index, next_index, 2 * count + next_index, 2 * count + index),
|
||||
(count + index, 3 * count + index, 3 * count + next_index, count + next_index),
|
||||
(2 * count + index, 2 * count + next_index, 3 * count + next_index, 3 * count + index),
|
||||
(index, count + index, count + next_index, next_index),
|
||||
])
|
||||
mesh = bpy.data.meshes.new(name + '_Mesh')
|
||||
mesh.from_pydata(vertices, [], faces)
|
||||
recalculate_normals(mesh)
|
||||
obj = bpy.data.objects.new(name, mesh)
|
||||
model_collection.objects.link(obj)
|
||||
return obj
|
||||
|
||||
|
||||
def boolean_apply(target, tool, operation):
|
||||
bpy.context.view_layer.objects.active = target
|
||||
modifier = target.modifiers.new('CC_' + operation.title(), 'BOOLEAN')
|
||||
modifier.operation = operation
|
||||
modifier.solver = 'EXACT'
|
||||
modifier.object = tool
|
||||
bpy.ops.object.modifier_apply(modifier=modifier.name)
|
||||
bpy.data.objects.remove(tool, do_unlink=True)
|
||||
|
||||
|
||||
spout = capsule_solid(
|
||||
'CC_Sip_Spout_Builder',
|
||||
OPENING_LENGTH + 2.0 * LID_THICKNESS,
|
||||
OPENING_WIDTH + 2.0 * LID_THICKNESS,
|
||||
OPENING_CENTER_Y,
|
||||
DECK_BOTTOM,
|
||||
12.90,
|
||||
inner_width=OPENING_WIDTH,
|
||||
)
|
||||
boolean_apply(lid, spout, 'UNION')
|
||||
|
||||
sip_cutter = capsule_solid(
|
||||
'CC_Sip_Opening_Cutter',
|
||||
OPENING_LENGTH,
|
||||
OPENING_WIDTH,
|
||||
OPENING_CENTER_Y,
|
||||
DECK_BOTTOM - 0.2,
|
||||
LID_TOP + 0.2,
|
||||
)
|
||||
boolean_apply(lid, sip_cutter, 'DIFFERENCE')
|
||||
|
||||
bpy.ops.mesh.primitive_cylinder_add(
|
||||
vertices=16,
|
||||
radius=VENT_RADIUS * CM,
|
||||
depth=1.0 * CM,
|
||||
location=(0.0, VENT_CENTER_Y * CM, DECK_TOP * CM),
|
||||
)
|
||||
vent_cutter = bpy.context.object
|
||||
vent_cutter.name = 'CC_Vent_Cutter'
|
||||
boolean_apply(lid, vent_cutter, 'DIFFERENCE')
|
||||
recalculate_normals(lid.data)
|
||||
shade_mesh(lid)
|
||||
|
||||
|
||||
def point_at(obj, target):
|
||||
direction = Vector(target) - obj.location
|
||||
obj.rotation_euler = direction.to_track_quat('-Z', 'Y').to_euler()
|
||||
|
||||
|
||||
def camera(name, location, target, ortho_scale):
|
||||
data = bpy.data.cameras.new(name)
|
||||
data.type = 'ORTHO'
|
||||
data.ortho_scale = ortho_scale
|
||||
data.clip_start = 0.001
|
||||
data.clip_end = 100.0
|
||||
obj = bpy.data.objects.new(name, data)
|
||||
studio_collection.objects.link(obj)
|
||||
obj.location = location
|
||||
point_at(obj, target)
|
||||
return obj
|
||||
|
||||
|
||||
def area_light(name, location, energy, size, target=(0.0, 0.0, 0.06)):
|
||||
data = bpy.data.lights.new(name, 'AREA')
|
||||
data.energy = energy
|
||||
data.shape = 'DISK'
|
||||
data.size = size
|
||||
obj = bpy.data.objects.new(name, data)
|
||||
studio_collection.objects.link(obj)
|
||||
obj.location = location
|
||||
point_at(obj, target)
|
||||
return obj
|
||||
|
||||
|
||||
world = bpy.data.worlds.new('Studio_World')
|
||||
world.use_nodes = True
|
||||
world.node_tree.nodes['Background'].inputs['Color'].default_value = (0.12, 0.14, 0.17, 1.0)
|
||||
world.node_tree.nodes['Background'].inputs['Strength'].default_value = 0.20
|
||||
scene.world = world
|
||||
area_light('Studio_Key', (0.10, 0.12, 0.24), 2.0, 0.16)
|
||||
area_light('Studio_Fill', (-0.14, 0.04, 0.13), 0.8, 0.14)
|
||||
area_light('Studio_Rim', (0.02, -0.14, 0.19), 2.5, 0.12)
|
||||
|
||||
assembled_camera = camera('Acceptance_Assembled', (0.18, 0.24, 0.18), (0.0, 0.0, 0.064), 0.185)
|
||||
top_camera = camera('Acceptance_Top_XOY_Positive_Y_Forward', (0.0, 0.0, 0.32), (0.0, 0.0, 0.0), 0.112)
|
||||
exploded_camera = camera('Acceptance_Exploded', (0.21, 0.28, 0.27), (0.0, 0.0, 0.082), 0.255)
|
||||
|
||||
scene.render.engine = 'CYCLES'
|
||||
scene.cycles.samples = 48
|
||||
scene.cycles.use_denoising = True
|
||||
scene.render.resolution_x = 1000
|
||||
scene.render.resolution_y = 1000
|
||||
scene.render.resolution_percentage = 100
|
||||
scene.render.image_settings.file_format = 'PNG'
|
||||
scene.render.image_settings.color_mode = 'RGBA'
|
||||
scene.render.film_transparent = True
|
||||
scene.view_settings.view_transform = 'AgX'
|
||||
scene.view_settings.exposure = -0.5
|
||||
|
||||
|
||||
def dimensions_cm(obj):
|
||||
return [round(value / CM, 5) for value in obj.dimensions]
|
||||
|
||||
|
||||
def manifold_count(obj):
|
||||
bm = bmesh.new()
|
||||
bm.from_mesh(obj.data)
|
||||
count = sum(1 for edge in bm.edges if not edge.is_manifold)
|
||||
bm.free()
|
||||
return count
|
||||
|
||||
|
||||
def ray_hits_lid(x_cm, y_cm):
|
||||
evaluated = lid.evaluated_get(bpy.context.evaluated_depsgraph_get())
|
||||
origin = Vector((x_cm * CM, y_cm * CM, (LID_TOP + 1.0) * CM))
|
||||
return evaluated.ray_cast(origin, Vector((0.0, 0.0, -1.0)))[0]
|
||||
|
||||
|
||||
bpy.context.view_layer.update()
|
||||
cup_bvh = BVHTree.FromObject(cup, bpy.context.evaluated_depsgraph_get())
|
||||
lid_bvh = BVHTree.FromObject(lid, bpy.context.evaluated_depsgraph_get())
|
||||
intersections = cup_bvh.overlap(lid_bvh)
|
||||
inner_lid_radius_at_cup_top = 4.55 + (4.40 - 4.55) * ((CUP_HEIGHT - LID_BOTTOM) / (11.30 - LID_BOTTOM))
|
||||
fit_clearance = inner_lid_radius_at_cup_top - CUP_TOP_RADIUS
|
||||
sip_is_open = not ray_hits_lid(0.0, OPENING_CENTER_Y)
|
||||
vent_is_open = not ray_hits_lid(0.0, VENT_CENTER_Y)
|
||||
deck_is_solid = ray_hits_lid(0.0, 0.0)
|
||||
cup_non_manifold = manifold_count(cup)
|
||||
lid_non_manifold = manifold_count(lid)
|
||||
assembly_top = max((obj.matrix_world @ Vector(corner)).z for obj in (cup, lid) for corner in obj.bound_box)
|
||||
assembly_bottom = min((obj.matrix_world @ Vector(corner)).z for obj in (cup, lid) for corner in obj.bound_box)
|
||||
assembly_height = (assembly_top - assembly_bottom) / CM
|
||||
|
||||
report = {
|
||||
'radial_segments': SEGMENTS,
|
||||
'components': {
|
||||
'CC_Cup_Body': {'dimensions_cm': dimensions_cm(cup), 'non_manifold_edges': cup_non_manifold},
|
||||
'CC_Lid': {'dimensions_cm': dimensions_cm(lid), 'non_manifold_edges': lid_non_manifold},
|
||||
},
|
||||
'assembly': {
|
||||
'height_cm': round(assembly_height, 5),
|
||||
'lid_bottom_cm': LID_BOTTOM,
|
||||
'overlap_cm': CUP_HEIGHT - LID_BOTTOM,
|
||||
'minimum_radial_fit_clearance_cm': round(fit_clearance, 5),
|
||||
'mesh_intersections': len(intersections),
|
||||
},
|
||||
'features': {
|
||||
'sip_opening_through_hole': sip_is_open,
|
||||
'vent_through_hole': vent_is_open,
|
||||
'deck_solid_at_center': deck_is_solid,
|
||||
'sip_opening_length_cm': OPENING_LENGTH,
|
||||
'sip_opening_width_cm': OPENING_WIDTH,
|
||||
'sip_edge_clearance_cm': round(3.82 - (OPENING_CENTER_Y + OPENING_WIDTH / 2.0), 5),
|
||||
'vent_diameter_cm': VENT_RADIUS * 2.0,
|
||||
'vent_center_y_cm': VENT_CENTER_Y,
|
||||
'forward_axis': '+Y',
|
||||
'studio_ground_present': bpy.data.objects.get('Studio_Ground') is not None,
|
||||
},
|
||||
}
|
||||
report['passed'] = (
|
||||
cup_non_manifold == 0
|
||||
and lid_non_manifold == 0
|
||||
and abs(assembly_height - 13.0) < 0.0001
|
||||
and len(intersections) == 0
|
||||
and fit_clearance > 0.0
|
||||
and sip_is_open
|
||||
and vent_is_open
|
||||
and deck_is_solid
|
||||
and 0.0 <= 3.82 - (OPENING_CENTER_Y + OPENING_WIDTH / 2.0) <= 0.05
|
||||
and bpy.data.objects.get('Studio_Ground') is None
|
||||
)
|
||||
(OUT / 'validation.json').write_text(json.dumps(report, indent=2), encoding='utf-8')
|
||||
print('MODEL_VALIDATION=' + json.dumps(report), flush=True)
|
||||
assert report['passed'], 'Coffee cup validation failed; inspect validation.json'
|
||||
|
||||
bpy.ops.object.select_all(action='DESELECT')
|
||||
root.select_set(True)
|
||||
cup.select_set(True)
|
||||
lid.select_set(True)
|
||||
bpy.context.view_layer.objects.active = root
|
||||
bpy.ops.export_scene.gltf(
|
||||
filepath=str(OUT / 'PerfectCoffee_CoffeeCup.glb'),
|
||||
export_format='GLB',
|
||||
use_selection=True,
|
||||
export_apply=True,
|
||||
export_animations=False,
|
||||
export_extras=True,
|
||||
)
|
||||
|
||||
for render_camera, filename in [
|
||||
(assembled_camera, 'preview_assembled.png'),
|
||||
(top_camera, 'preview_top.png'),
|
||||
]:
|
||||
scene.camera = render_camera
|
||||
scene.render.filepath = str(OUT / filename)
|
||||
bpy.ops.render.render(write_still=True)
|
||||
|
||||
lid.location.z = 0.05
|
||||
bpy.context.view_layer.update()
|
||||
scene.camera = exploded_camera
|
||||
scene.render.filepath = str(OUT / 'preview_exploded.png')
|
||||
bpy.ops.render.render(write_still=True)
|
||||
lid.location.z = 0.0
|
||||
bpy.context.view_layer.update()
|
||||
|
||||
scene.camera = assembled_camera
|
||||
bpy.ops.object.select_all(action='DESELECT')
|
||||
root.select_set(True)
|
||||
bpy.context.view_layer.objects.active = root
|
||||
for screen in bpy.data.screens:
|
||||
for area in screen.areas:
|
||||
if area.type == 'VIEW_3D':
|
||||
area.spaces.active.region_3d.view_perspective = 'CAMERA'
|
||||
area.spaces.active.shading.type = 'MATERIAL'
|
||||
bpy.ops.wm.save_as_mainfile(filepath=str(OUT / 'PerfectCoffee_CoffeeCup.blend'))
|
||||
print('MODEL_BUILD_COMPLETE', flush=True)
|
||||
@@ -0,0 +1,179 @@
|
||||
import bpy
|
||||
import json
|
||||
from pathlib import Path
|
||||
from mathutils import Vector
|
||||
from bpy_extras.object_utils import world_to_camera_view
|
||||
|
||||
OUT = Path('/Users/yanchenyu/Documents/WebApps/PerfetCoffee/model_assets/coffee_cup')
|
||||
BASE = OUT / 'PerfectCoffee_CoffeeCup.blend'
|
||||
bpy.ops.wm.open_mainfile(filepath=str(BASE))
|
||||
bpy.context.preferences.filepaths.save_version = 0
|
||||
scene = bpy.context.scene
|
||||
|
||||
source_cup = bpy.data.objects['CC_Cup_Body']
|
||||
source_lid = bpy.data.objects['CC_Lid']
|
||||
source_root = bpy.data.objects['CC_CoffeeCup_Assembly']
|
||||
studio = bpy.data.collections['Studio_Exclude_From_Export']
|
||||
paper = bpy.data.materials['CC_Cup_Paper']
|
||||
lid_white = bpy.data.materials['CC_Lid_White']
|
||||
|
||||
source_collection = bpy.data.collections.new('CC_Source_Hidden')
|
||||
scene.collection.children.link(source_collection)
|
||||
for obj in (source_root, source_cup, source_lid):
|
||||
for collection in list(obj.users_collection):
|
||||
collection.objects.unlink(obj)
|
||||
source_collection.objects.link(obj)
|
||||
source_collection.hide_render = True
|
||||
source_collection.hide_viewport = True
|
||||
|
||||
variant_collection = bpy.data.collections.new('CC_Colorways')
|
||||
scene.collection.children.link(variant_collection)
|
||||
|
||||
|
||||
def linear_channel(value):
|
||||
return value / 12.92 if value <= 0.04045 else ((value + 0.055) / 1.055) ** 2.4
|
||||
|
||||
|
||||
def srgb_channel(value):
|
||||
return value * 12.92 if value <= 0.0031308 else 1.055 * (value ** (1.0 / 2.4)) - 0.055
|
||||
|
||||
|
||||
def rgba_from_hex(value):
|
||||
return tuple(linear_channel(int(value[index:index + 2], 16) / 255.0) for index in (1, 3, 5)) + (1.0,)
|
||||
|
||||
|
||||
def hex_from_material(material):
|
||||
return '#' + ''.join(f'{round(srgb_channel(value) * 255):02X}' for value in material.diffuse_color[:3])
|
||||
|
||||
|
||||
def make_accent(name, hex_color):
|
||||
material = bpy.data.materials.new('CC_Accent_' + name)
|
||||
material.use_nodes = True
|
||||
color = rgba_from_hex(hex_color)
|
||||
material.diffuse_color = color
|
||||
bsdf = material.node_tree.nodes.get('Principled BSDF')
|
||||
bsdf.inputs['Base Color'].default_value = color
|
||||
bsdf.inputs['Roughness'].default_value = 0.68
|
||||
return material
|
||||
|
||||
|
||||
palettes = {
|
||||
'deep_black': {'label': '深黑', 'color': '#191B1E', 'x': 0.12},
|
||||
'coffee': {'label': '咖啡色', 'color': '#6B4632', 'x': 0.0},
|
||||
'pure_blue': {'label': '纯蓝色', 'color': '#155FCC', 'x': -0.12},
|
||||
}
|
||||
|
||||
variants = {}
|
||||
for key, palette in palettes.items():
|
||||
accent = make_accent(key, palette['color'])
|
||||
root = bpy.data.objects.new('CC_Colorway_' + key, None)
|
||||
variant_collection.objects.link(root)
|
||||
root.empty_display_type = 'PLAIN_AXES'
|
||||
root.empty_display_size = 0.02
|
||||
root.location.x = palette['x']
|
||||
root['colorway'] = key
|
||||
root['accent_hex'] = palette['color']
|
||||
root['accent_band_start_cm'] = 2.2
|
||||
root['accent_band_end_cm'] = 8.8
|
||||
cup = source_cup.copy()
|
||||
cup.data = source_cup.data
|
||||
cup.name = 'CC_Cup_Body_' + key
|
||||
lid = source_lid.copy()
|
||||
lid.data = source_lid.data
|
||||
lid.name = 'CC_Lid_' + key
|
||||
for obj in (cup, lid):
|
||||
variant_collection.objects.link(obj)
|
||||
obj.parent = root
|
||||
cup.material_slots[0].link = 'OBJECT'
|
||||
cup.material_slots[0].material = paper
|
||||
cup.material_slots[1].link = 'OBJECT'
|
||||
cup.material_slots[1].material = accent
|
||||
lid.material_slots[0].link = 'OBJECT'
|
||||
lid.material_slots[0].material = lid_white
|
||||
variants[key] = {'root': root, 'cup': cup, 'lid': lid}
|
||||
|
||||
config = {
|
||||
'version': 1,
|
||||
'geometry': 'PerfectCoffee_CoffeeCup.glb',
|
||||
'band': {
|
||||
'start_fraction': 0.2,
|
||||
'end_fraction': 0.8,
|
||||
'start_cm': 2.2,
|
||||
'end_cm': 8.8,
|
||||
'surface': 'outer cup wall only',
|
||||
},
|
||||
'fixed_materials': {
|
||||
'CC_Cup_Paper': hex_from_material(paper),
|
||||
'CC_Lid_White': hex_from_material(lid_white),
|
||||
},
|
||||
'variants': {
|
||||
key: {
|
||||
'label': palette['label'],
|
||||
'material_slot': 'CC_Cup_Accent',
|
||||
'base_color': palette['color'],
|
||||
}
|
||||
for key, palette in palettes.items()
|
||||
},
|
||||
}
|
||||
(OUT / 'coffee_cup_palettes.json').write_text(json.dumps(config, ensure_ascii=False, indent=2), encoding='utf-8')
|
||||
|
||||
camera_data = bpy.data.cameras.new('Acceptance_Colorways')
|
||||
camera_data.type = 'ORTHO'
|
||||
camera_data.ortho_scale = 0.405
|
||||
camera_data.clip_start = 0.001
|
||||
camera_data.clip_end = 100.0
|
||||
camera = bpy.data.objects.new('Acceptance_Colorways', camera_data)
|
||||
studio.objects.link(camera)
|
||||
camera.location = (0.10, 0.46, 0.22)
|
||||
target = Vector((0.0, 0.0, 0.065))
|
||||
camera.rotation_euler = (target - camera.location).to_track_quat('-Z', 'Y').to_euler()
|
||||
scene.camera = camera
|
||||
scene.render.resolution_x = 1500
|
||||
scene.render.resolution_y = 1000
|
||||
scene.render.resolution_percentage = 100
|
||||
scene.render.film_transparent = True
|
||||
scene.render.filepath = str(OUT / 'preview_colorways.png')
|
||||
|
||||
bpy.context.view_layer.update()
|
||||
assert len({variants[key]['cup'].data.as_pointer() for key in variants}) == 1
|
||||
assert len({variants[key]['lid'].data.as_pointer() for key in variants}) == 1
|
||||
assert all(variants[key]['lid'].material_slots[0].material == lid_white for key in variants)
|
||||
assert set(config['variants']) == {'deep_black', 'coffee', 'pure_blue'}
|
||||
|
||||
band_faces = [polygon for polygon in source_cup.data.polygons if polygon.material_index == 1]
|
||||
assert len(band_faces) == 24
|
||||
for polygon in band_faces:
|
||||
heights = [source_cup.data.vertices[index].co.z * 100.0 for index in polygon.vertices]
|
||||
assert abs(min(heights) - 2.2) < 0.0001
|
||||
assert abs(max(heights) - 8.8) < 0.0001
|
||||
|
||||
for key, objects in variants.items():
|
||||
projected = []
|
||||
for obj in (objects['cup'], objects['lid']):
|
||||
for corner in obj.bound_box:
|
||||
projected.append(world_to_camera_view(scene, camera, obj.matrix_world @ Vector(corner)))
|
||||
assert all(0.02 <= point.x <= 0.98 and 0.02 <= point.y <= 0.98 and point.z > 0 for point in projected), key
|
||||
|
||||
print('COLORWAY_VALIDATION=' + json.dumps({
|
||||
'variants': list(variants),
|
||||
'shared_cup_mesh': True,
|
||||
'shared_lid_mesh': True,
|
||||
'band_faces': len(band_faces),
|
||||
'band_start_cm': 2.2,
|
||||
'band_end_cm': 8.8,
|
||||
'lid_material_shared': True,
|
||||
'camera_bounds_passed': True,
|
||||
}), flush=True)
|
||||
|
||||
bpy.ops.render.render(write_still=True)
|
||||
bpy.ops.object.select_all(action='DESELECT')
|
||||
for key in variants:
|
||||
variants[key]['root'].select_set(True)
|
||||
bpy.context.view_layer.objects.active = variants['deep_black']['root']
|
||||
for screen in bpy.data.screens:
|
||||
for area in screen.areas:
|
||||
if area.type == 'VIEW_3D':
|
||||
area.spaces.active.region_3d.view_perspective = 'CAMERA'
|
||||
area.spaces.active.shading.type = 'MATERIAL'
|
||||
bpy.ops.wm.save_as_mainfile(filepath=str(OUT / 'PerfectCoffee_CoffeeCup_Colorways.blend'))
|
||||
print('COLORWAYS_BUILD_COMPLETE', flush=True)
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"version": 1,
|
||||
"geometry": "PerfectCoffee_CoffeeCup.glb",
|
||||
"band": {
|
||||
"start_fraction": 0.2,
|
||||
"end_fraction": 0.8,
|
||||
"start_cm": 2.2,
|
||||
"end_cm": 8.8,
|
||||
"surface": "outer cup wall only"
|
||||
},
|
||||
"fixed_materials": {
|
||||
"CC_Cup_Paper": "#EAEAE6",
|
||||
"CC_Lid_White": "#DADDDA"
|
||||
},
|
||||
"variants": {
|
||||
"deep_black": {
|
||||
"label": "深黑",
|
||||
"material_slot": "CC_Cup_Accent",
|
||||
"base_color": "#191B1E"
|
||||
},
|
||||
"coffee": {
|
||||
"label": "咖啡色",
|
||||
"material_slot": "CC_Cup_Accent",
|
||||
"base_color": "#6B4632"
|
||||
},
|
||||
"pure_blue": {
|
||||
"label": "纯蓝色",
|
||||
"material_slot": "CC_Cup_Accent",
|
||||
"base_color": "#155FCC"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"radial_segments": 24,
|
||||
"components": {
|
||||
"CC_Cup_Body": {
|
||||
"dimensions_cm": [
|
||||
8.5,
|
||||
8.5,
|
||||
11.0
|
||||
],
|
||||
"non_manifold_edges": 0
|
||||
},
|
||||
"CC_Lid": {
|
||||
"dimensions_cm": [
|
||||
9.3,
|
||||
9.3,
|
||||
2.3
|
||||
],
|
||||
"non_manifold_edges": 0
|
||||
}
|
||||
},
|
||||
"assembly": {
|
||||
"height_cm": 13.0,
|
||||
"lid_bottom_cm": 10.7,
|
||||
"overlap_cm": 0.3000000000000007,
|
||||
"minimum_radial_fit_clearance_cm": 0.225,
|
||||
"mesh_intersections": 0
|
||||
},
|
||||
"features": {
|
||||
"sip_opening_through_hole": true,
|
||||
"vent_through_hole": true,
|
||||
"deck_solid_at_center": true,
|
||||
"sip_opening_length_cm": 1.0,
|
||||
"sip_opening_width_cm": 0.5,
|
||||
"sip_edge_clearance_cm": 0.02,
|
||||
"vent_diameter_cm": 0.1,
|
||||
"vent_center_y_cm": -2.65,
|
||||
"forward_axis": "+Y",
|
||||
"studio_ground_present": false
|
||||
},
|
||||
"passed": true
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,965 @@
|
||||
import bpy
|
||||
import math
|
||||
import json
|
||||
from pathlib import Path
|
||||
from mathutils import Vector
|
||||
from bpy_extras.object_utils import world_to_camera_view
|
||||
|
||||
OUT = Path('/Users/yanchenyu/Documents/WebApps/PerfetCoffee/model_assets/coffee_machine')
|
||||
TEX = OUT / 'textures'
|
||||
OUT.mkdir(parents=True, exist_ok=True)
|
||||
TEX.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
bpy.context.preferences.filepaths.save_version = 0
|
||||
scene = bpy.context.scene
|
||||
scene.unit_settings.system = 'METRIC'
|
||||
scene.unit_settings.length_unit = 'METERS'
|
||||
|
||||
cm = bpy.data.collections.new('CM_CoffeeMachine_Model')
|
||||
studio = bpy.data.collections.new('Studio_Exclude_From_Export')
|
||||
scene.collection.children.link(cm)
|
||||
scene.collection.children.link(studio)
|
||||
|
||||
|
||||
def move_to(obj, collection=cm):
|
||||
for collection_old in list(obj.users_collection):
|
||||
collection_old.objects.unlink(obj)
|
||||
collection.objects.link(obj)
|
||||
return obj
|
||||
|
||||
|
||||
def material(name, color, metallic=0.0, roughness=0.45):
|
||||
mat = bpy.data.materials.new(name)
|
||||
mat.use_nodes = True
|
||||
mat.diffuse_color = (*color, 1)
|
||||
bsdf = mat.node_tree.nodes.get('Principled BSDF')
|
||||
bsdf.inputs['Base Color'].default_value = (*color, 1)
|
||||
bsdf.inputs['Metallic'].default_value = metallic
|
||||
bsdf.inputs['Roughness'].default_value = roughness
|
||||
return mat
|
||||
|
||||
|
||||
steel = material('CM_Brushed_Steel', (0.48, 0.54, 0.58), 0.82, 0.28)
|
||||
steel_light = material('CM_Satin_Steel', (0.68, 0.73, 0.76), 0.78, 0.25)
|
||||
steel_dark = material('CM_Dark_Steel', (0.16, 0.20, 0.22), 0.72, 0.32)
|
||||
charcoal = material('CM_Charcoal_Panels', (0.035, 0.047, 0.052), 0.32, 0.34)
|
||||
rubber = material('CM_Black_Grip', (0.018, 0.023, 0.025), 0.05, 0.48)
|
||||
ivory = material('CM_Ivory_Dial', (0.88, 0.87, 0.80), 0.05, 0.62)
|
||||
ink = material('CM_Dial_Ink', (0.018, 0.025, 0.028), 0.0, 0.6)
|
||||
red = material('CM_Signal_Red', (0.72, 0.025, 0.018), 0.15, 0.32)
|
||||
orange = material('CM_Temperature_Needle', (0.92, 0.15, 0.025), 0.12, 0.32)
|
||||
teal = material('CM_Flow_Needle', (0.02, 0.32, 0.42), 0.18, 0.3)
|
||||
white = material('CM_Label_White', (0.84, 0.88, 0.88), 0.1, 0.5)
|
||||
|
||||
|
||||
def assign(obj, mat):
|
||||
if mat:
|
||||
obj.data.materials.append(mat)
|
||||
|
||||
|
||||
def bevel(obj, width=0.002, segments=2):
|
||||
if width > 0:
|
||||
mod = obj.modifiers.new('CM_Soft_Edges', 'BEVEL')
|
||||
mod.width = width
|
||||
mod.segments = segments
|
||||
if obj.type == 'MESH':
|
||||
normal = obj.modifiers.new('CM_Weighted_Normals', 'WEIGHTED_NORMAL')
|
||||
normal.keep_sharp = True
|
||||
normal.weight = 40
|
||||
|
||||
|
||||
def box(name, loc, dims, mat, edge=0.002, parent=None):
|
||||
bpy.ops.mesh.primitive_cube_add(size=1, location=loc)
|
||||
obj = bpy.context.object
|
||||
obj.name = name
|
||||
obj.dimensions = dims
|
||||
bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
|
||||
move_to(obj)
|
||||
assign(obj, mat)
|
||||
bevel(obj, edge, 3 if edge > 0.003 else 2)
|
||||
if parent:
|
||||
parent_keep(obj, parent)
|
||||
return obj
|
||||
|
||||
|
||||
def cylinder(name, loc, radius, depth, mat, axis='Z', vertices=24, edge=0.0008, parent=None):
|
||||
bpy.ops.mesh.primitive_cylinder_add(vertices=vertices, radius=radius, depth=depth, location=loc)
|
||||
obj = bpy.context.object
|
||||
obj.name = name
|
||||
if axis == 'Y':
|
||||
obj.rotation_euler[0] = math.pi / 2
|
||||
elif axis == 'X':
|
||||
obj.rotation_euler[1] = math.pi / 2
|
||||
move_to(obj)
|
||||
assign(obj, mat)
|
||||
for poly in obj.data.polygons:
|
||||
poly.use_smooth = len(poly.vertices) == 4
|
||||
bevel(obj, edge, 2)
|
||||
if parent:
|
||||
parent_keep(obj, parent)
|
||||
return obj
|
||||
|
||||
|
||||
def torus(name, loc, major, minor, mat, axis='Z', parent=None):
|
||||
rotation = (math.pi / 2, 0, 0) if axis == 'Y' else (0, 0, 0)
|
||||
bpy.ops.mesh.primitive_torus_add(
|
||||
major_segments=32,
|
||||
minor_segments=8,
|
||||
location=loc,
|
||||
rotation=rotation,
|
||||
major_radius=major,
|
||||
minor_radius=minor,
|
||||
)
|
||||
obj = bpy.context.object
|
||||
obj.name = name
|
||||
move_to(obj)
|
||||
assign(obj, mat)
|
||||
for poly in obj.data.polygons:
|
||||
poly.use_smooth = True
|
||||
if parent:
|
||||
parent_keep(obj, parent)
|
||||
return obj
|
||||
|
||||
|
||||
def rod(name, start, end, radius, mat, vertices=16, parent=None):
|
||||
start_v = Vector(start)
|
||||
end_v = Vector(end)
|
||||
direction = end_v - start_v
|
||||
obj = cylinder(name, (start_v + end_v) / 2, radius, direction.length, mat, vertices=vertices, edge=0.0005)
|
||||
obj.rotation_euler = direction.to_track_quat('Z', 'Y').to_euler()
|
||||
if parent:
|
||||
parent_keep(obj, parent)
|
||||
return obj
|
||||
|
||||
|
||||
def empty(name, loc=(0, 0, 0), parent=None, size=0.025):
|
||||
obj = bpy.data.objects.new(name, None)
|
||||
cm.objects.link(obj)
|
||||
obj.empty_display_type = 'PLAIN_AXES'
|
||||
obj.empty_display_size = size
|
||||
obj.location = loc
|
||||
bpy.context.view_layer.update()
|
||||
if parent:
|
||||
parent_keep(obj, parent)
|
||||
return obj
|
||||
|
||||
|
||||
def parent_keep(obj, parent):
|
||||
bpy.context.view_layer.update()
|
||||
obj.parent = parent
|
||||
obj.matrix_parent_inverse = parent.matrix_world.inverted()
|
||||
|
||||
|
||||
def mesh_face(name, vertices, mat, parent=None):
|
||||
mesh = bpy.data.meshes.new(name + '_Mesh')
|
||||
mesh.from_pydata(vertices, [], [list(range(len(vertices)))])
|
||||
mesh.update()
|
||||
obj = bpy.data.objects.new(name, mesh)
|
||||
cm.objects.link(obj)
|
||||
assign(obj, mat)
|
||||
if parent:
|
||||
parent_keep(obj, parent)
|
||||
return obj
|
||||
|
||||
|
||||
def lathe_profile(name, center, profile, mat, segments=48, edge=0.0003, parent=None):
|
||||
x, y, z = center
|
||||
vertices = []
|
||||
for radius, height in profile:
|
||||
for index in range(segments):
|
||||
angle = index * 2 * math.pi / segments
|
||||
vertices.append((x + radius * math.cos(angle), y + radius * math.sin(angle), z + height))
|
||||
faces = []
|
||||
for profile_index in range(len(profile)):
|
||||
next_profile = (profile_index + 1) % len(profile)
|
||||
for index in range(segments):
|
||||
next_index = (index + 1) % segments
|
||||
faces.append((profile_index * segments + index, profile_index * segments + next_index, next_profile * segments + next_index, next_profile * segments + index))
|
||||
mesh = bpy.data.meshes.new(name + '_Mesh')
|
||||
mesh.from_pydata(vertices, [], faces)
|
||||
mesh.update()
|
||||
obj = bpy.data.objects.new(name, mesh)
|
||||
cm.objects.link(obj)
|
||||
assign(obj, mat)
|
||||
for polygon in mesh.polygons:
|
||||
polygon.use_smooth = True
|
||||
bevel(obj, edge, 2)
|
||||
if parent:
|
||||
parent_keep(obj, parent)
|
||||
return obj
|
||||
|
||||
|
||||
def arc_ring(name, center, outer_radius, inner_radius, z_bottom, z_top, start_angle, end_angle, mat, parent=None, edge=0.0003):
|
||||
x, y, z = center
|
||||
segments = max(3, math.ceil((end_angle - start_angle) / (2 * math.pi) * 96))
|
||||
vertices = []
|
||||
for index in range(segments + 1):
|
||||
angle = start_angle + (end_angle - start_angle) * index / segments
|
||||
for radius, height in [(outer_radius, z_bottom), (inner_radius, z_bottom), (outer_radius, z_top), (inner_radius, z_top)]:
|
||||
vertices.append((x + radius * math.cos(angle), y + radius * math.sin(angle), z + height))
|
||||
faces = []
|
||||
for index in range(segments):
|
||||
a = index * 4
|
||||
b = (index + 1) * 4
|
||||
faces.extend([
|
||||
(a, b, b + 2, a + 2),
|
||||
(a + 1, a + 3, b + 3, b + 1),
|
||||
(a, a + 1, b + 1, b),
|
||||
(a + 2, b + 2, b + 3, a + 3),
|
||||
])
|
||||
end = segments * 4
|
||||
faces.extend([(0, 2, 3, 1), (end, end + 1, end + 3, end + 2)])
|
||||
mesh = bpy.data.meshes.new(name + '_Mesh')
|
||||
mesh.from_pydata(vertices, [], faces)
|
||||
mesh.update()
|
||||
obj = bpy.data.objects.new(name, mesh)
|
||||
cm.objects.link(obj)
|
||||
assign(obj, mat)
|
||||
for polygon in mesh.polygons:
|
||||
polygon.use_smooth = len(polygon.vertices) == 4
|
||||
bevel(obj, edge, 2)
|
||||
if parent:
|
||||
parent_keep(obj, parent)
|
||||
return obj
|
||||
|
||||
|
||||
def tube_between(name, start, end, outer_radius, inner_radius, mat, parent=None):
|
||||
start_v = Vector(start)
|
||||
end_v = Vector(end)
|
||||
direction = end_v - start_v
|
||||
half = direction.length / 2
|
||||
obj = lathe_profile(name, (0, 0, 0), [(outer_radius, -half), (outer_radius, half), (inner_radius, half), (inner_radius, -half)], mat, 24, 0.00025)
|
||||
obj.location = (start_v + end_v) / 2
|
||||
obj.rotation_euler = direction.to_track_quat('Z', 'Y').to_euler()
|
||||
if parent:
|
||||
parent_keep(obj, parent)
|
||||
return obj
|
||||
|
||||
|
||||
def horizontal_disc(name, center, radius, mat, parent=None):
|
||||
x, y, z = center
|
||||
segments = 48
|
||||
vertices = [(x, y, z)]
|
||||
uv_coords = [(0.5, 0.5)]
|
||||
for index in range(segments):
|
||||
angle = index * 2 * math.pi / segments
|
||||
vertices.append((x + radius * math.cos(angle), y + radius * math.sin(angle), z))
|
||||
uv_coords.append((0.5 + math.cos(angle) / 2, 0.5 + math.sin(angle) / 2))
|
||||
faces = [(0, index + 1, (index + 1) % segments + 1) for index in range(segments)]
|
||||
mesh = bpy.data.meshes.new(name + '_Mesh')
|
||||
mesh.from_pydata(vertices, [], faces)
|
||||
mesh.update()
|
||||
uv = mesh.uv_layers.new(name='CM_FilterScreen_UV')
|
||||
for loop in mesh.loops:
|
||||
uv.data[loop.index].uv = uv_coords[loop.vertex_index]
|
||||
obj = bpy.data.objects.new(name, mesh)
|
||||
cm.objects.link(obj)
|
||||
assign(obj, mat)
|
||||
if parent:
|
||||
parent_keep(obj, parent)
|
||||
return obj
|
||||
|
||||
|
||||
def text(name, body, loc, size, mat, parent=None, align='CENTER'):
|
||||
curve = bpy.data.curves.new(name + '_Font', 'FONT')
|
||||
curve.body = body
|
||||
curve.size = size
|
||||
curve.align_x = align
|
||||
curve.align_y = 'CENTER'
|
||||
curve.space_character = 1.05
|
||||
curve.resolution_u = 4
|
||||
obj = bpy.data.objects.new(name, curve)
|
||||
cm.objects.link(obj)
|
||||
obj.location = loc
|
||||
obj.rotation_euler = (math.pi / 2, 0, 0)
|
||||
assign(obj, mat)
|
||||
if parent:
|
||||
parent_keep(obj, parent)
|
||||
return obj
|
||||
|
||||
|
||||
def driver(obj, prop, expression, index=1):
|
||||
curve = obj.driver_add('rotation_euler', index)
|
||||
drv = curve.driver
|
||||
drv.type = 'SCRIPTED'
|
||||
var = drv.variables.new()
|
||||
var.name = 'value'
|
||||
var.type = 'SINGLE_PROP'
|
||||
var.targets[0].id = controller
|
||||
var.targets[0].data_path = '["' + prop + '"]'
|
||||
drv.expression = expression
|
||||
|
||||
|
||||
root = empty('CM_CoffeeMachine', size=0.06)
|
||||
root['front_direction'] = '-Y in Blender'
|
||||
root['model_version'] = 'v1.0'
|
||||
root['reference'] = 'Original single-group design based on reference 02 proportions'
|
||||
controller = empty('CM_ControlState', parent=root)
|
||||
controller['hot_water_open'] = 0.0
|
||||
controller['brew_flow'] = 0.0
|
||||
controller['temperature_c'] = 0.0
|
||||
for prop in ['hot_water_open', 'brew_flow']:
|
||||
controller.id_properties_ui(prop).update(min=0.0, max=1.0, description='Normalized control value')
|
||||
controller.id_properties_ui('temperature_c').update(min=0.0, max=100.0, description='Displayed outlet temperature')
|
||||
controller['hot_water_max_degrees'] = 270.0
|
||||
controller['flow_lever_max_degrees'] = 100.0
|
||||
|
||||
# Main body and compact single-group housing.
|
||||
body = empty('CM_Body', parent=root)
|
||||
box('CM_Body_MainShell', (0, 0.025, 0.28), (0.46, 0.35, 0.36), steel, 0.012, body)
|
||||
box('CM_Body_FrontPanel', (0, -0.153, 0.29), (0.45, 0.012, 0.305), steel_light, 0.006, body)
|
||||
box('CM_Body_LeftPanel', (-0.229, 0.025, 0.275), (0.012, 0.325, 0.31), charcoal, 0.005, body)
|
||||
box('CM_Body_RightPanel', (0.229, 0.025, 0.275), (0.012, 0.325, 0.31), charcoal, 0.005, body)
|
||||
box('CM_Body_Base', (0, -0.015, 0.092), (0.46, 0.37, 0.035), steel_dark, 0.005, body)
|
||||
box('CM_Body_TopLip', (0, 0.025, 0.458), (0.45, 0.345, 0.016), steel_dark, 0.005, body)
|
||||
for x in [-0.185, 0.185]:
|
||||
for y in [-0.105, 0.13]:
|
||||
cylinder('CM_Body_Foot', (x, y, 0.028), 0.018, 0.045, rubber, vertices=20, edge=0.002, parent=body)
|
||||
for x in [-0.205, 0.205]:
|
||||
rod('CM_CupRail_Side', (x, -0.125, 0.49), (x, 0.155, 0.49), 0.004, steel_light, parent=body)
|
||||
for y in [-0.125, 0.155]:
|
||||
rod('CM_CupRail_Post', (x, y, 0.46), (x, y, 0.49), 0.0035, steel_light, parent=body)
|
||||
rod('CM_CupRail_Back', (-0.205, 0.155, 0.49), (0.205, 0.155, 0.49), 0.004, steel_light, parent=body)
|
||||
rod('CM_CupRail_FrontLeft', (-0.205, -0.125, 0.49), (-0.10, -0.125, 0.49), 0.004, steel_light, parent=body)
|
||||
rod('CM_CupRail_FrontRight', (0.10, -0.125, 0.49), (0.205, -0.125, 0.49), 0.004, steel_light, parent=body)
|
||||
text('CM_Body_Brand', 'PERFECT COFFEE', (0, -0.161, 0.421), 0.014, ink, body)
|
||||
|
||||
# The fixed brew interface faces down; only its external receiving geometry is modeled.
|
||||
BREW_Y = -0.237
|
||||
BREW_LIFT = 0.070
|
||||
BREW_SEAL_Z = 0.2135 + BREW_LIFT
|
||||
group = empty('CM_GroupHead', (0, BREW_Y, 0.2135), parent=root)
|
||||
group['interface_axis'] = 'Z'
|
||||
group['bayonet_notch_degrees'] = 42.0
|
||||
group['support_arc_count'] = 2
|
||||
group['spout_owner'] = 'CM_Portafilter'
|
||||
cylinder('CM_GroupHead_Mount', (0, BREW_Y + 0.0435, 0.250), 0.038, 0.073, steel_dark, 'Y', 40, 0.002, group)
|
||||
cylinder('CM_GroupHead_Bell', (0, BREW_Y, 0.241), 0.043, 0.042, steel_light, 'Z', 48, 0.002, group)
|
||||
cylinder('CM_GroupHead_UpperCollar', (0, BREW_Y, 0.268), 0.046, 0.012, steel_light, 'Z', 48, 0.0015, group)
|
||||
lathe_profile('CM_GroupHead_SealingSeat', (0, BREW_Y, 0), [(0.050, 0.2135), (0.050, 0.220), (0.0373, 0.220), (0.0373, 0.2135)], steel, 64, 0.0005, group)
|
||||
for suffix, start, end in [('A', 111, 249), ('B', 291, 429)]:
|
||||
arc_ring('CM_GroupHead_BayonetSupport_' + suffix, (0, BREW_Y, 0), 0.050, 0.039, 0.208, 0.2135, math.radians(start), math.radians(end), steel_light, group, 0.0004)
|
||||
lathe_profile('CM_GroupHead_Gasket', (0, BREW_Y, 0), [(0.0373, 0.2135), (0.0373, 0.2165), (0.0348, 0.2165), (0.0337, 0.2148), (0.0348, 0.2135)], rubber, 64, 0.0001, group)
|
||||
|
||||
# Two external bayonet lugs, an open bowl and both spouts move with the handle.
|
||||
portafilter = empty('CM_Portafilter', (0, BREW_Y, 0.2135), parent=root)
|
||||
portafilter['connection_axis'] = 'Z'
|
||||
portafilter['insertion_direction'] = '+Z'
|
||||
portafilter['unlock_rotation_degrees'] = -45.0
|
||||
portafilter['bayonet_lug_count'] = 2
|
||||
portafilter['seal_contact_z_m'] = BREW_SEAL_Z
|
||||
lathe_profile('CM_Portafilter_Bowl', (0, BREW_Y, 0), [(0.0345, 0.1815), (0.0375, 0.184), (0.0375, 0.2095), (0.0385, 0.2095), (0.0385, 0.2135), (0.0340, 0.2135), (0.0330, 0.2105), (0.0295, 0.1915), (0.0005, 0.1915), (0.0005, 0.1815)], steel_light, 64, 0.0004, portafilter)
|
||||
for suffix, angle in [('A', -45), ('B', 135)]:
|
||||
arc_ring('CM_Portafilter_LockingLug_' + suffix, (0, BREW_Y, 0), 0.0475, 0.0355, 0.205, 0.2079, math.radians(angle - 8), math.radians(angle + 8), steel_light, portafilter, 0.0003)
|
||||
lathe_profile('CM_Portafilter_SpoutCollar', (0, BREW_Y, 0), [(0.0105, 0.1745), (0.0105, 0.1815), (0.0065, 0.1815), (0.0065, 0.1745)], steel_light, 32, 0.0005, portafilter)
|
||||
tube_between('CM_Portafilter_SpoutLeft', (0, BREW_Y, 0.176), (-0.014, BREW_Y, 0.157), 0.005, 0.0032, steel_light, portafilter)
|
||||
tube_between('CM_Portafilter_SpoutRight', (0, BREW_Y, 0.176), (0.014, BREW_Y, 0.157), 0.005, 0.0032, steel_light, portafilter)
|
||||
rod('CM_Portafilter_Neck', (-0.024, -0.261, 0.195), (-0.064, -0.300, 0.181), 0.008, steel_light, 20, portafilter)
|
||||
rod('CM_Portafilter_Grip', (-0.061, -0.297, 0.182), (-0.142, -0.400, 0.139), 0.014, rubber, 24, portafilter)
|
||||
rod('CM_Portafilter_GripCap', (-0.139, -0.397, 0.140), (-0.151, -0.410, 0.135), 0.0145, steel_dark, 24, portafilter)
|
||||
|
||||
# Shallow drip tray: all grille holes are represented by a packed texture.
|
||||
drip = empty('CM_DripTray', parent=root)
|
||||
box('CM_DripTray_Base', (0, -0.16, 0.074), (0.46, 0.30, 0.045), steel_dark, 0.006, drip)
|
||||
for x in [-0.222, 0.222]:
|
||||
box('CM_DripTray_SideFrame', (x, -0.16, 0.099), (0.012, 0.29, 0.014), steel_light, 0.002, drip)
|
||||
for y in [-0.301, -0.019]:
|
||||
box('CM_DripTray_EndFrame', (0, y, 0.099), (0.44, 0.012, 0.014), steel_light, 0.002, drip)
|
||||
|
||||
|
||||
def save_generated_image(name, pixels, size, path, non_color=False):
|
||||
image = bpy.data.images.new(name, width=size, height=size, alpha=True)
|
||||
if non_color:
|
||||
image.colorspace_settings.name = 'Non-Color'
|
||||
image.pixels = pixels
|
||||
image.update()
|
||||
image.filepath_raw = str(path)
|
||||
image.file_format = 'PNG'
|
||||
image.save()
|
||||
image.pack()
|
||||
return image
|
||||
|
||||
|
||||
size = 256
|
||||
albedo = []
|
||||
normal_pixels = []
|
||||
roughness = []
|
||||
heights = []
|
||||
for y in range(size):
|
||||
row = []
|
||||
for x in range(size):
|
||||
bar_x = x % 32 < 7
|
||||
bar_y = y % 32 < 5
|
||||
raised = bar_x or bar_y
|
||||
row.append(1.0 if raised else 0.0)
|
||||
if raised:
|
||||
edge = min(x % 32, 7 - x % 32, y % 32, 5 - y % 32)
|
||||
shade = 0.42 + 0.05 * min(edge, 2) + 0.025 * math.sin(y * 0.7)
|
||||
albedo.extend((shade, shade * 1.04, shade * 1.07, 1))
|
||||
roughness.extend((0.3, 0.3, 0.3, 1))
|
||||
else:
|
||||
albedo.extend((0.025, 0.032, 0.036, 1))
|
||||
roughness.extend((0.72, 0.72, 0.72, 1))
|
||||
heights.append(row)
|
||||
for y in range(size):
|
||||
for x in range(size):
|
||||
dx = (heights[y][(x + 1) % size] - heights[y][(x - 1) % size]) * 1.7
|
||||
dy = (heights[(y + 1) % size][x] - heights[(y - 1) % size][x]) * 1.7
|
||||
vec = Vector((-dx, dy, 1)).normalized()
|
||||
normal_pixels.extend((vec.x * 0.5 + 0.5, vec.y * 0.5 + 0.5, vec.z * 0.5 + 0.5, 1))
|
||||
tray_albedo = save_generated_image('CM_DripTray_Albedo', albedo, size, TEX / 'drip_tray_albedo.png')
|
||||
tray_normal = save_generated_image('CM_DripTray_Normal', normal_pixels, size, TEX / 'drip_tray_normal.png', True)
|
||||
tray_rough = save_generated_image('CM_DripTray_Roughness', roughness, size, TEX / 'drip_tray_roughness.png', True)
|
||||
filter_pixels = []
|
||||
for py in range(size):
|
||||
for px in range(size):
|
||||
dx = px % 12 - 5.5
|
||||
dy = py % 12 - 5.5
|
||||
if dx * dx + dy * dy <= 4:
|
||||
filter_pixels.extend((0.008, 0.012, 0.014, 1))
|
||||
else:
|
||||
filter_pixels.extend((0.42, 0.45, 0.47, 1))
|
||||
filter_image = save_generated_image('CM_FilterScreen_Albedo', filter_pixels, size, TEX / 'filter_screen.png')
|
||||
filter_mat = material('CM_FilterScreen_TexturedSteel', (0.42, 0.45, 0.47), 0.65, 0.4)
|
||||
filter_node = filter_mat.node_tree.nodes.new('ShaderNodeTexImage')
|
||||
filter_node.image = filter_image
|
||||
filter_mat.node_tree.links.new(filter_node.outputs['Color'], filter_mat.node_tree.nodes.get('Principled BSDF').inputs['Base Color'])
|
||||
filter_screen = horizontal_disc('CM_Portafilter_FilterScreen', (0, BREW_Y, 0.192), 0.0285, filter_mat, portafilter)
|
||||
filter_screen['holes_representation'] = 'texture'
|
||||
shower_screen = horizontal_disc('CM_GroupHead_ShowerScreen', (0, BREW_Y, 0.2175), 0.0335, filter_mat, group)
|
||||
shower_screen['holes_representation'] = 'texture'
|
||||
# Lift only after every fixed and detachable child has been attached.
|
||||
group.location.z += BREW_LIFT
|
||||
portafilter.location.z += BREW_LIFT
|
||||
group['cup_clearance_lift_m'] = BREW_LIFT
|
||||
portafilter['cup_clearance_lift_m'] = BREW_LIFT
|
||||
bpy.context.view_layer.update()
|
||||
tray_mat = material('CM_DripTray_Textured_Steel', (0.4, 0.45, 0.48), 0.72, 0.35)
|
||||
nodes = tray_mat.node_tree.nodes
|
||||
links = tray_mat.node_tree.links
|
||||
bsdf = nodes.get('Principled BSDF')
|
||||
for image, socket in [(tray_albedo, 'Base Color'), (tray_rough, 'Roughness')]:
|
||||
node = nodes.new('ShaderNodeTexImage')
|
||||
node.image = image
|
||||
links.new(node.outputs['Color'], bsdf.inputs[socket])
|
||||
normal_tex = nodes.new('ShaderNodeTexImage')
|
||||
normal_tex.image = tray_normal
|
||||
normal_node = nodes.new('ShaderNodeNormalMap')
|
||||
normal_node.inputs['Strength'].default_value = 0.65
|
||||
links.new(normal_tex.outputs['Color'], normal_node.inputs['Color'])
|
||||
links.new(normal_node.outputs['Normal'], bsdf.inputs['Normal'])
|
||||
mesh = bpy.data.meshes.new('CM_DripTray_Top_Mesh')
|
||||
mesh.from_pydata([(-0.216, -0.294, 0.098), (0.216, -0.294, 0.098), (0.216, -0.026, 0.098), (-0.216, -0.026, 0.098)], [], [[0, 1, 2, 3]])
|
||||
mesh.update()
|
||||
uv = mesh.uv_layers.new(name='CM_Tray_UV')
|
||||
for loop, coord in zip(uv.data, [(0, 0), (1, 0), (1, 1), (0, 1)]):
|
||||
loop.uv = coord
|
||||
tray_top = bpy.data.objects.new('CM_DripTray_TextureSurface', mesh)
|
||||
cm.objects.link(tray_top)
|
||||
assign(tray_top, tray_mat)
|
||||
parent_keep(tray_top, drip)
|
||||
|
||||
# Fixed red reading arrows and gauge construction helpers.
|
||||
def fixed_arrow(name, x, y, z, parent, direction):
|
||||
image = create_arrow_texture(direction, TEX / ('arrow_left.png' if direction < 0 else 'arrow_right.png'))
|
||||
mat = material(name + '_DecalMaterial', (0.72, 0.025, 0.018), 0.0, 0.85)
|
||||
bsdf = mat.node_tree.nodes.get('Principled BSDF')
|
||||
bsdf.inputs['Specular IOR Level'].default_value = 0.0
|
||||
node = mat.node_tree.nodes.new('ShaderNodeTexImage')
|
||||
node.image = image
|
||||
mat.node_tree.links.new(node.outputs['Color'], bsdf.inputs['Base Color'])
|
||||
mat.node_tree.links.new(node.outputs['Alpha'], bsdf.inputs['Alpha'])
|
||||
if hasattr(mat, 'surface_render_method'):
|
||||
mat.surface_render_method = 'DITHERED'
|
||||
width = 0.028
|
||||
height = 0.018
|
||||
mesh = bpy.data.meshes.new(name + '_DecalMesh')
|
||||
mesh.from_pydata([(x - width / 2, y, z - height / 2), (x + width / 2, y, z - height / 2), (x + width / 2, y, z + height / 2), (x - width / 2, y, z + height / 2)], [], [[0, 1, 2, 3]])
|
||||
mesh.update()
|
||||
uv = mesh.uv_layers.new(name='CM_Decal_UV')
|
||||
for loop, coord in zip(uv.data, [(0, 0), (1, 0), (1, 1), (0, 1)]):
|
||||
loop.uv = coord
|
||||
obj = bpy.data.objects.new(name, mesh)
|
||||
cm.objects.link(obj)
|
||||
assign(obj, mat)
|
||||
parent_keep(obj, parent)
|
||||
if hasattr(obj, 'visible_shadow'):
|
||||
obj.visible_shadow = False
|
||||
obj['representation'] = 'decal_texture'
|
||||
obj['flush_offset_m'] = 0.0003
|
||||
return obj
|
||||
|
||||
|
||||
import sys
|
||||
if str(OUT) not in sys.path:
|
||||
sys.path.insert(0, str(OUT))
|
||||
from dial_textures import create_dial_texture, create_arrow_texture
|
||||
|
||||
|
||||
def face_material(name, image):
|
||||
mat = material(name, (0.88, 0.87, 0.80), 0.0, 0.85)
|
||||
bsdf = mat.node_tree.nodes.get('Principled BSDF')
|
||||
bsdf.inputs['Specular IOR Level'].default_value = 0.0
|
||||
node = mat.node_tree.nodes.new('ShaderNodeTexImage')
|
||||
node.image = image
|
||||
mat.node_tree.links.new(node.outputs['Color'], bsdf.inputs['Base Color'])
|
||||
mat.node_tree.links.new(node.outputs['Color'], bsdf.inputs['Emission Color'])
|
||||
bsdf.inputs['Emission Strength'].default_value = 0.15
|
||||
return mat
|
||||
|
||||
|
||||
def front_texture(name, center, radius, mat, parent):
|
||||
x, y, z = center
|
||||
segments = 48
|
||||
vertices = [(x, y, z)]
|
||||
uv_coords = [(0.5, 0.5)]
|
||||
for index in range(segments):
|
||||
angle = index * 2 * math.pi / segments
|
||||
dx = radius * math.cos(angle)
|
||||
dz = radius * math.sin(angle)
|
||||
vertices.append((x + dx, y, z + dz))
|
||||
uv_coords.append((0.5 + dx / (2 * radius), 0.5 + dz / (2 * radius)))
|
||||
faces = [(0, index + 1, (index + 1) % segments + 1) for index in range(segments)]
|
||||
mesh = bpy.data.meshes.new(name + '_Mesh')
|
||||
mesh.from_pydata(vertices, [], faces)
|
||||
mesh.update()
|
||||
uv = mesh.uv_layers.new(name='CM_Dial_UV')
|
||||
for loop in mesh.loops:
|
||||
uv.data[loop.index].uv = uv_coords[loop.vertex_index]
|
||||
obj = bpy.data.objects.new(name, mesh)
|
||||
cm.objects.link(obj)
|
||||
assign(obj, mat)
|
||||
parent_keep(obj, parent)
|
||||
return obj
|
||||
|
||||
|
||||
CONTROL_ATLAS_LABELS = ['0°', '90°', '180°', '270°', '0%', '50%', '100%']
|
||||
|
||||
|
||||
def create_control_label_atlas(filepath):
|
||||
atlas_scene = bpy.data.scenes.new('CM_ControlLabelAtlas_Temp')
|
||||
bpy.context.window.scene = atlas_scene
|
||||
atlas_scene.render.engine = 'CYCLES'
|
||||
atlas_scene.cycles.samples = 8
|
||||
atlas_scene.cycles.use_denoising = False
|
||||
atlas_scene.render.resolution_x = 2048
|
||||
atlas_scene.render.resolution_y = 512
|
||||
atlas_scene.render.resolution_percentage = 100
|
||||
atlas_scene.render.image_settings.file_format = 'PNG'
|
||||
atlas_scene.render.image_settings.color_mode = 'RGBA'
|
||||
atlas_scene.render.film_transparent = True
|
||||
atlas_scene.render.filepath = str(filepath)
|
||||
atlas_scene.view_settings.view_transform = 'Standard'
|
||||
atlas_scene.view_settings.exposure = 0.0
|
||||
ink_material = bpy.data.materials.new('CM_ControlLabelAtlas_Ink')
|
||||
ink_material.use_nodes = True
|
||||
nodes = ink_material.node_tree.nodes
|
||||
nodes.clear()
|
||||
emission = nodes.new('ShaderNodeEmission')
|
||||
emission.inputs['Color'].default_value = (0.008, 0.012, 0.015, 1.0)
|
||||
emission.inputs['Strength'].default_value = 1.0
|
||||
output = nodes.new('ShaderNodeOutputMaterial')
|
||||
ink_material.node_tree.links.new(emission.outputs[0], output.inputs['Surface'])
|
||||
font_curves = []
|
||||
metrics = {}
|
||||
for index, body in enumerate(CONTROL_ATLAS_LABELS):
|
||||
curve = bpy.data.curves.new('CM_AtlasGlyph_' + str(index), 'FONT')
|
||||
curve.body = body
|
||||
curve.size = 1.0
|
||||
curve.align_x = 'LEFT'
|
||||
curve.align_y = 'CENTER'
|
||||
curve.resolution_u = 12
|
||||
font_curves.append(curve)
|
||||
obj = bpy.data.objects.new('CM_AtlasGlyph_' + str(index), curve)
|
||||
atlas_scene.collection.objects.link(obj)
|
||||
curve.materials.append(ink_material)
|
||||
bpy.context.view_layer.update()
|
||||
bounds = [Vector(corner) for corner in obj.bound_box]
|
||||
min_x = min(corner.x for corner in bounds)
|
||||
max_x = max(corner.x for corner in bounds)
|
||||
min_y = min(corner.y for corner in bounds)
|
||||
max_y = max(corner.y for corner in bounds)
|
||||
width = max_x - min_x
|
||||
height = max_y - min_y
|
||||
scale = min(3.6 / width, 1.6 / height)
|
||||
width *= scale
|
||||
height *= scale
|
||||
obj.scale = (scale, scale, scale)
|
||||
obj.location = (
|
||||
(index % 4 - 1.5) * 4 - (min_x + max_x) * scale / 2,
|
||||
(index // 4 - 0.5) * 2 - (min_y + max_y) * scale / 2,
|
||||
0,
|
||||
)
|
||||
metrics[body] = (width, height)
|
||||
camera_data = bpy.data.cameras.new('CM_ControlLabelAtlas_Camera')
|
||||
camera_data.type = 'ORTHO'
|
||||
camera_data.ortho_scale = 16.0
|
||||
camera_obj = bpy.data.objects.new('CM_ControlLabelAtlas_Camera', camera_data)
|
||||
atlas_scene.collection.objects.link(camera_obj)
|
||||
camera_obj.location = (0, 0, 10)
|
||||
atlas_scene.camera = camera_obj
|
||||
bpy.context.view_layer.update()
|
||||
bpy.ops.render.render(write_still=True, scene=atlas_scene.name)
|
||||
bpy.context.window.scene = scene
|
||||
image = bpy.data.images.load(str(filepath), check_existing=False)
|
||||
image.name = 'CM_ControlLabelAtlas'
|
||||
image.pack()
|
||||
for obj in list(atlas_scene.objects):
|
||||
bpy.data.objects.remove(obj, do_unlink=True)
|
||||
bpy.data.scenes.remove(atlas_scene)
|
||||
for curve in font_curves:
|
||||
if curve.users == 0:
|
||||
bpy.data.curves.remove(curve)
|
||||
if camera_data.users == 0:
|
||||
bpy.data.cameras.remove(camera_data)
|
||||
if ink_material.users == 0:
|
||||
bpy.data.materials.remove(ink_material)
|
||||
return image, metrics
|
||||
|
||||
|
||||
def printed_label_material(image):
|
||||
mat = material('CM_PrintedLabel_AtlasMaterial', (0.008, 0.012, 0.015), 0.0, 0.85)
|
||||
bsdf = mat.node_tree.nodes.get('Principled BSDF')
|
||||
bsdf.inputs['Specular IOR Level'].default_value = 0.0
|
||||
node = mat.node_tree.nodes.new('ShaderNodeTexImage')
|
||||
node.image = image
|
||||
mat.node_tree.links.new(node.outputs['Color'], bsdf.inputs['Base Color'])
|
||||
mat.node_tree.links.new(node.outputs['Alpha'], bsdf.inputs['Alpha'])
|
||||
if hasattr(mat, 'surface_render_method'):
|
||||
mat.surface_render_method = 'DITHERED'
|
||||
if hasattr(mat, 'use_backface_culling'):
|
||||
mat.use_backface_culling = True
|
||||
return mat
|
||||
|
||||
|
||||
control_label_atlas, control_label_metrics = create_control_label_atlas(TEX / 'control_label_atlas.png')
|
||||
control_label_material = printed_label_material(control_label_atlas)
|
||||
|
||||
|
||||
def printed_labels(prefix, pivot, kind):
|
||||
direction = -1 if kind.startswith('hot') else 1
|
||||
maximum = 270 if direction < 0 else 100
|
||||
labels = [(0, '0°'), (90, '90°'), (180, '180°'), (270, '270°')] if direction < 0 else [(0, '0%'), (50, '50%'), (100, '100%')]
|
||||
x, y, z = pivot.location
|
||||
for value, body in labels:
|
||||
atlas_width, atlas_height = control_label_metrics[body]
|
||||
natural_aspect = atlas_width / atlas_height
|
||||
glyph_height = min(0.005, 0.017 / natural_aspect)
|
||||
glyph_width = glyph_height * natural_aspect
|
||||
patch_width = glyph_width * 4.0 / atlas_width
|
||||
patch_height = glyph_height * 2.0 / atlas_height
|
||||
axial_center = 0.014 + glyph_width / 2
|
||||
radius_center = 0.0348 - 0.009 * axial_center / 0.03
|
||||
angle_height = patch_height / radius_center
|
||||
center_angle = math.radians(180 + value * 270 / maximum)
|
||||
vertices = []
|
||||
uv_coords = []
|
||||
width_segments = 4
|
||||
height_segments = 8
|
||||
cell = CONTROL_ATLAS_LABELS.index(body)
|
||||
for ix in range(width_segments + 1):
|
||||
u = ix / width_segments
|
||||
axial = axial_center + direction * (u - 0.5) * patch_width
|
||||
radius = 0.0348 - 0.009 * axial / 0.03
|
||||
for iy in range(height_segments + 1):
|
||||
v = iy / height_segments
|
||||
angle = center_angle - (v - 0.5) * angle_height
|
||||
normal = Vector((direction * 0.3, math.cos(angle), math.sin(angle))).normalized()
|
||||
point = Vector((x + direction * axial, y + radius * math.cos(angle), z + radius * math.sin(angle))) + normal * 0.00004
|
||||
vertices.append(point)
|
||||
uv_coords.append(((cell % 4 + u) / 4, (cell // 4 + v) / 2))
|
||||
faces = []
|
||||
for ix in range(width_segments):
|
||||
for iy in range(height_segments):
|
||||
a = ix * (height_segments + 1) + iy
|
||||
face = (a, a + height_segments + 1, a + height_segments + 2, a + 1)
|
||||
faces.append(face)
|
||||
mesh = bpy.data.meshes.new(prefix + '_PrintedLabel_' + str(value) + '_Mesh')
|
||||
mesh.from_pydata(vertices, [], faces)
|
||||
mesh.update()
|
||||
uv = mesh.uv_layers.new(name='CM_PrintedLabel_UV')
|
||||
for loop in mesh.loops:
|
||||
uv.data[loop.index].uv = uv_coords[loop.vertex_index]
|
||||
for polygon in mesh.polygons:
|
||||
polygon.use_smooth = True
|
||||
obj = bpy.data.objects.new(prefix + '_PrintedLabel_' + str(value), mesh)
|
||||
cm.objects.link(obj)
|
||||
assign(obj, control_label_material)
|
||||
parent_keep(obj, pivot)
|
||||
if hasattr(obj, 'visible_shadow'):
|
||||
obj.visible_shadow = False
|
||||
obj['representation'] = 'vector_text_uv_decal'
|
||||
obj['printed_text'] = body
|
||||
obj['font'] = 'Blender Bfont'
|
||||
obj['glyph_height_m'] = glyph_height
|
||||
obj['natural_aspect_ratio'] = natural_aspect
|
||||
obj['atlas_cell_aspect_ratio'] = 2.0
|
||||
obj['surface_offset_m'] = 0.00004
|
||||
obj['baseline_axis'] = 'X'
|
||||
|
||||
|
||||
def conical_dial(prefix, pivot, kind):
|
||||
segments = 64
|
||||
height = 0.03
|
||||
bottom_radius = 0.0348
|
||||
top_radius = 0.0258
|
||||
direction = -1 if kind.startswith('hot') else 1
|
||||
x, y, z = pivot.location
|
||||
vertices = []
|
||||
for radius, axial_offset in [(bottom_radius, 0), (top_radius, direction * height)]:
|
||||
for index in range(segments):
|
||||
angle = index * 2 * math.pi / segments
|
||||
vertices.append((x + axial_offset, y + radius * math.cos(angle), z + radius * math.sin(angle)))
|
||||
faces = []
|
||||
for index in range(segments):
|
||||
next_index = (index + 1) % segments
|
||||
faces.append((index, next_index, segments + next_index, segments + index))
|
||||
faces.append(tuple(reversed(range(segments))))
|
||||
faces.append(tuple(range(segments, segments * 2)))
|
||||
if direction < 0:
|
||||
faces = [tuple(reversed(face)) for face in faces]
|
||||
mesh = bpy.data.meshes.new(prefix + '_ConicalMesh')
|
||||
mesh.from_pydata(vertices, [], faces)
|
||||
mesh.update()
|
||||
image = create_dial_texture(kind, TEX / (kind + '.png'))
|
||||
obj = bpy.data.objects.new(prefix + '_ConicalSide', mesh)
|
||||
cm.objects.link(obj)
|
||||
assign(obj, face_material(prefix + '_TextureMaterial', image))
|
||||
assign(obj, steel_light)
|
||||
uv = mesh.uv_layers.new(name='CM_Conical_UV')
|
||||
for polygon in mesh.polygons:
|
||||
polygon.material_index = 0 if polygon.index < segments else 1
|
||||
polygon.use_smooth = polygon.index < segments
|
||||
for loop_index in polygon.loop_indices:
|
||||
vertex_index = mesh.loops[loop_index].vertex_index
|
||||
if polygon.index < segments:
|
||||
segment_index = polygon.index
|
||||
u = segment_index / segments if vertex_index in [segment_index, segments + segment_index] else (segment_index + 1) / segments
|
||||
v = 0.0 if vertex_index < segments else 1.0
|
||||
uv.data[loop_index].uv = (u, v)
|
||||
else:
|
||||
uv.data[loop_index].uv = (0.5, 0.5)
|
||||
parent_keep(obj, pivot)
|
||||
printed_labels(prefix, pivot, kind)
|
||||
pivot['mount_plane'] = 'YOZ'
|
||||
pivot['mount_side'] = 'left' if kind.startswith('hot') else 'right'
|
||||
pivot['dial_axis'] = 'X'
|
||||
pivot['shape'] = 'frustum'
|
||||
pivot['height_m'] = height
|
||||
pivot['outward_direction'] = direction
|
||||
pivot['arrow_location'] = 'front'
|
||||
prop = 'hot_water_open' if kind.startswith('hot') else 'brew_flow'
|
||||
driver(pivot, prop, f'-value * {math.radians(270)}', index=0)
|
||||
|
||||
|
||||
def gauge(prefix, center, radius, needle_mat, label, unit, prop, parent=root):
|
||||
x, y, z = center
|
||||
assembly = empty(prefix, center, parent)
|
||||
cylinder(prefix + '_Case', (x, y + 0.004, z), radius, 0.014, steel_dark, 'Y', 32, 0.0015, assembly)
|
||||
torus(prefix + '_Bezel', (x, y - 0.005, z), radius - 0.002, 0.0025, steel_light, 'Y', assembly)
|
||||
cylinder(prefix + '_Face', (x, y - 0.006, z), radius - 0.005, 0.002, ivory, 'Y', 32, 0.0003, assembly)
|
||||
kind = 'temperature' if label == 'TEMP' else 'flow_gauge'
|
||||
image = create_dial_texture(kind, TEX / (kind + '.png'))
|
||||
front_texture(prefix + '_Texture', (x, y - 0.0072, z), radius - 0.005, face_material(prefix + '_TextureMaterial', image), assembly)
|
||||
needle = empty(prefix + '_Needle', center, assembly, 0.01)
|
||||
mesh_face(prefix + '_NeedleShape', [(x - 0.007, y - 0.0105, z - 0.0015), (x + radius * 0.72, y - 0.0105, z), (x - 0.007, y - 0.0105, z + 0.0015)], needle_mat, needle)
|
||||
cylinder(prefix + '_NeedleHub', (x, y - 0.011, z), 0.0035, 0.002, needle_mat, 'Y', 20, 0.0003, assembly)
|
||||
sweep = math.pi if prop == 'brew_flow' else math.pi / 100
|
||||
driver(needle, prop, f'(value * {sweep}) - {math.pi}')
|
||||
return assembly
|
||||
|
||||
|
||||
def top_control(prefix, pivot, current_degrees, hot=False):
|
||||
x, y, z = pivot.location
|
||||
direction = -1 if hot else 1
|
||||
angle = math.radians(135 + current_degrees)
|
||||
dy = math.cos(angle)
|
||||
dz = math.sin(angle)
|
||||
cylinder(prefix + '_TopCap', (x + direction * 0.008, y, z), 0.0234, 0.016, steel_dark, 'X', 32, 0.002, pivot)
|
||||
rod(prefix + '_Stem', (x + direction * 0.016, y, z), (x + direction * 0.030, y + dy * 0.040, z + dz * 0.068), 0.0055, steel_light, 20, pivot)
|
||||
rod(prefix + '_Grip', (x + direction * 0.026, y + dy * 0.032, z + dz * 0.058), (x + direction * 0.043, y + dy * 0.072, z + dz * 0.125), 0.0105, rubber, 24, pivot)
|
||||
if hot:
|
||||
rod(prefix + '_RedMarker', (x + direction * 0.017, y, z), (x + direction * 0.017, y + dy * 0.026, z + dz * 0.026), 0.0018, red, 8, pivot)
|
||||
pivot['mount_plane'] = 'YOZ'
|
||||
pivot['mount_side'] = 'left' if hot else 'right'
|
||||
pivot['dial_axis'] = 'X'
|
||||
pivot['connector_radius_m'] = 0.0234
|
||||
pivot['dial_top_radius_m'] = 0.0258
|
||||
prop = 'hot_water_open' if hot else 'brew_flow'
|
||||
driver(pivot, prop, f'-value * {math.radians(270)}', index=0)
|
||||
|
||||
|
||||
# Left side-mounted frustum, with the narrow top and handle facing outward.
|
||||
hot_dial = empty('CM_HotWaterDial', (-0.235, -0.095, 0.337), root)
|
||||
conical_dial('CM_HotWaterDial', hot_dial, 'hot_water_conical')
|
||||
hot_valve = empty('CM_HotWaterValve', (-0.265, -0.095, 0.337), root)
|
||||
top_control('CM_HotWaterValve', hot_valve, 0.0, hot=True)
|
||||
fixed_arrow('CM_HotWaterValve_FixedArrow', -0.214, -0.1593, 0.337, body, -1)
|
||||
|
||||
# Two enlarged meters remain on the front panel.
|
||||
temp_gauge = gauge('CM_TempGauge', (-0.112, -0.169, 0.337), 0.048, orange, 'TEMP', '°C', 'temperature_c')
|
||||
flow_gauge = gauge('CM_FlowGauge', (0.112, -0.169, 0.337), 0.048, teal, 'FLOW', '%', 'brew_flow')
|
||||
|
||||
# Right side-mounted frustum uses the same relationship.
|
||||
flow_dial = empty('CM_FlowDial', (0.235, -0.095, 0.337), root)
|
||||
conical_dial('CM_FlowDial', flow_dial, 'flow_dial_conical')
|
||||
flow_lever = empty('CM_FlowLever', (0.265, -0.095, 0.337), root)
|
||||
top_control('CM_FlowLever', flow_lever, 0.0)
|
||||
fixed_arrow('CM_FlowLever_FixedArrow', 0.214, -0.1593, 0.337, body, 1)
|
||||
|
||||
# Convert the brand text so the GLB does not depend on font objects.
|
||||
bpy.ops.object.select_all(action='DESELECT')
|
||||
font_objects = [obj for obj in cm.objects if obj.type == 'FONT']
|
||||
for obj in font_objects:
|
||||
obj.select_set(True)
|
||||
if font_objects:
|
||||
bpy.context.view_layer.objects.active = font_objects[0]
|
||||
bpy.ops.object.convert(target='MESH')
|
||||
bpy.ops.object.select_all(action='DESELECT')
|
||||
scene.frame_set(1)
|
||||
bpy.context.view_layer.update()
|
||||
|
||||
# Studio setup is intentionally separate from the exported asset.
|
||||
floor_mat = material('Studio_Warm_Background', (0.19, 0.22, 0.23), 0.0, 0.72)
|
||||
bpy.ops.mesh.primitive_plane_add(size=200, location=(0, 0, -0.002))
|
||||
floor = bpy.context.object
|
||||
floor.name = 'Studio_Floor'
|
||||
move_to(floor, studio)
|
||||
assign(floor, floor_mat)
|
||||
world = bpy.data.worlds.new('Studio_World')
|
||||
scene.world = world
|
||||
world.use_nodes = True
|
||||
world.node_tree.nodes['Background'].inputs['Color'].default_value = (0.16, 0.19, 0.22, 1)
|
||||
world.node_tree.nodes['Background'].inputs['Strength'].default_value = 0.45
|
||||
|
||||
|
||||
def area_light(name, loc, energy, size, color, target=(0, 0, 0.24)):
|
||||
data = bpy.data.lights.new(name, 'AREA')
|
||||
data.energy = energy
|
||||
data.shape = 'DISK'
|
||||
data.size = size
|
||||
data.color = color
|
||||
obj = bpy.data.objects.new(name, data)
|
||||
studio.objects.link(obj)
|
||||
obj.location = loc
|
||||
obj.rotation_euler = (Vector(target) - obj.location).to_track_quat('-Z', 'Y').to_euler()
|
||||
|
||||
|
||||
area_light('Studio_Key', (-0.65, -0.8, 1.15), 90, 0.75, (1.0, 0.87, 0.72))
|
||||
area_light('Studio_Fill', (0.75, -0.45, 0.75), 65, 0.65, (0.72, 0.85, 1.0))
|
||||
area_light('Studio_Rim', (0.1, 0.65, 1.0), 110, 0.6, (1.0, 0.95, 0.85))
|
||||
|
||||
|
||||
def camera(name, loc, target, scale):
|
||||
data = bpy.data.cameras.new(name)
|
||||
data.type = 'ORTHO'
|
||||
data.ortho_scale = scale
|
||||
data.lens = 60
|
||||
obj = bpy.data.objects.new(name, data)
|
||||
studio.objects.link(obj)
|
||||
obj.location = loc
|
||||
obj.rotation_euler = (Vector(target) - obj.location).to_track_quat('-Z', 'Y').to_euler()
|
||||
return obj
|
||||
|
||||
|
||||
front_camera = camera('Acceptance_Front_0deg', (0, -1.8, 0.25), (0, -0.02, 0.25), 0.68)
|
||||
angle_camera = camera('Acceptance_30deg', (0.8, -1.3856, 1.1738), (0, -0.02, 0.25), 0.78)
|
||||
right_camera = camera('Acceptance_Right_YOZ', (1.8, 0, 0.25), (0, 0, 0.25), 0.86)
|
||||
left_camera = camera('Acceptance_Left_YOZ', (-1.8, 0, 0.25), (0, 0, 0.25), 0.86)
|
||||
controls_camera = camera('Acceptance_Controls_Front_XOZ', (0, -1.8, 0.337), (0, -0.095, 0.337), 0.64)
|
||||
brew_camera = camera('Acceptance_Brew_Interface', (0.32, BREW_Y - 0.398, 0.060 + BREW_LIFT), (0, BREW_Y, 0.174 + BREW_LIFT), 0.25)
|
||||
bowl_camera = camera('Acceptance_Portafilter_Bowl', (0.25, BREW_Y - 0.308, 0.49 + BREW_LIFT), (0, BREW_Y - 0.028, 0.17 + BREW_LIFT), 0.25)
|
||||
scene.render.engine = 'CYCLES'
|
||||
scene.cycles.samples = 40
|
||||
scene.cycles.use_denoising = True
|
||||
scene.render.resolution_x = 1100
|
||||
scene.render.resolution_y = 1100
|
||||
scene.render.resolution_percentage = 100
|
||||
scene.render.image_settings.file_format = 'PNG'
|
||||
scene.render.image_settings.color_mode = 'RGBA'
|
||||
scene.render.film_transparent = False
|
||||
scene.view_settings.view_transform = 'AgX'
|
||||
scene.view_settings.exposure = -0.35
|
||||
|
||||
# Export only the machine collection, with current driven poses and packed textures.
|
||||
bpy.ops.object.select_all(action='DESELECT')
|
||||
for obj in cm.all_objects:
|
||||
obj.select_set(True)
|
||||
bpy.context.view_layer.objects.active = root
|
||||
bpy.ops.export_scene.gltf(
|
||||
filepath=str(OUT / 'PerfectCoffee_CoffeeMachine.glb'),
|
||||
export_format='GLB',
|
||||
use_selection=True,
|
||||
export_apply=True,
|
||||
export_animations=False,
|
||||
export_extras=True,
|
||||
)
|
||||
bpy.ops.object.select_all(action='DESELECT')
|
||||
scene.camera = front_camera
|
||||
for screen in bpy.data.screens:
|
||||
for area in screen.areas:
|
||||
if area.type == 'VIEW_3D':
|
||||
area.spaces.active.region_3d.view_perspective = 'CAMERA'
|
||||
area.spaces.active.shading.type = 'MATERIAL'
|
||||
bpy.ops.wm.save_as_mainfile(filepath=str(OUT / 'PerfectCoffee_CoffeeMachine.blend'))
|
||||
|
||||
required = ['CM_Body', 'CM_GroupHead', 'CM_HotWaterValve', 'CM_HotWaterDial', 'CM_TempGauge', 'CM_FlowGauge', 'CM_FlowLever', 'CM_FlowDial', 'CM_Portafilter', 'CM_DripTray']
|
||||
driver_count = sum(len(obj.animation_data.drivers) for obj in cm.all_objects if obj.animation_data)
|
||||
report = {'required_objects': {}, 'camera_bounds': {}, 'mesh_objects': 0, 'vertices': 0, 'polygons': 0, 'drivers': driver_count}
|
||||
for name in required:
|
||||
obj = bpy.data.objects.get(name)
|
||||
report['required_objects'][name] = obj is not None
|
||||
for obj in cm.all_objects:
|
||||
if obj.type == 'MESH':
|
||||
report['mesh_objects'] += 1
|
||||
report['vertices'] += len(obj.data.vertices)
|
||||
report['polygons'] += len(obj.data.polygons)
|
||||
for cam, label in [(front_camera, 'front'), (angle_camera, 'angle_30deg'), (right_camera, 'right_yoz'), (left_camera, 'left_yoz')]:
|
||||
scene.camera = cam
|
||||
bpy.context.view_layer.update()
|
||||
coverage = {}
|
||||
for name in required:
|
||||
obj = bpy.data.objects[name]
|
||||
points = []
|
||||
for child in obj.children_recursive:
|
||||
if child.type == 'MESH':
|
||||
points.extend([child.matrix_world @ Vector(corner) for corner in child.bound_box])
|
||||
if not points:
|
||||
continue
|
||||
projected = [world_to_camera_view(scene, cam, point) for point in points]
|
||||
bounds = [min(p.x for p in projected), max(p.x for p in projected), min(p.y for p in projected), max(p.y for p in projected)]
|
||||
coverage[name] = {'bounds': [round(v, 4) for v in bounds], 'inside_frame': all(0 <= p.x <= 1 and 0 <= p.y <= 1 and p.z > 0 for p in projected)}
|
||||
report['camera_bounds'][label] = coverage
|
||||
for cam, filename in [(front_camera, 'preview_front.png'), (angle_camera, 'preview_30deg.png'), (right_camera, 'preview_right.png'), (left_camera, 'preview_left.png')]:
|
||||
scene.camera = cam
|
||||
scene.render.filepath = str(OUT / filename)
|
||||
bpy.ops.render.render(write_still=True)
|
||||
scene.camera = controls_camera
|
||||
scene.render.resolution_x = 2400
|
||||
scene.render.resolution_y = 1000
|
||||
scene.render.filepath = str(OUT / 'preview_controls_front.png')
|
||||
bpy.ops.render.render(write_still=True)
|
||||
scene.camera = brew_camera
|
||||
scene.render.resolution_x = 1400
|
||||
scene.render.resolution_y = 1400
|
||||
scene.render.filepath = str(OUT / 'preview_brew_interface.png')
|
||||
bpy.ops.render.render(write_still=True)
|
||||
portafilter.rotation_euler.z = math.radians(-45)
|
||||
portafilter.location.y -= 0.035
|
||||
portafilter.location.z -= 0.045
|
||||
bpy.context.view_layer.update()
|
||||
scene.render.filepath = str(OUT / 'preview_portafilter_detached.png')
|
||||
bpy.ops.render.render(write_still=True)
|
||||
scene.camera = bowl_camera
|
||||
scene.render.filepath = str(OUT / 'preview_portafilter_bowl.png')
|
||||
bpy.ops.render.render(write_still=True)
|
||||
portafilter.rotation_euler.z = 0.0
|
||||
portafilter.location.y += 0.035
|
||||
portafilter.location.z += 0.045
|
||||
bpy.context.view_layer.update()
|
||||
scene.render.resolution_x = 1100
|
||||
scene.render.resolution_y = 1100
|
||||
scene.camera = front_camera
|
||||
print('MODEL_VALIDATION=' + json.dumps(report), flush=True)
|
||||
print('MODEL_BUILD_COMPLETE', flush=True)
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"source_machine_unchanged": true,
|
||||
"source_machine_sha256": "c41f0d3636654138a13400002ddf4e32cacddb4b1af939cf5b20ad4313f8bf89",
|
||||
"source_cup_unchanged": true,
|
||||
"source_cup_sha256": "5ac4bfae6528989485136c87548d36e0214bd56b5bcd29dedf4a3dc548cdbada",
|
||||
"lid_included": false,
|
||||
"layout": {
|
||||
"scheme": "A",
|
||||
"brew_center_xy_m": [
|
||||
0.0,
|
||||
-0.2370000034570694
|
||||
],
|
||||
"group_seal_z_mm": 283.49998593330383,
|
||||
"tray_support_z_mm": 97.99999743700027
|
||||
},
|
||||
"cup": {
|
||||
"height_mm": 110,
|
||||
"top_diameter_mm": 85,
|
||||
"bottom_diameter_mm": 60,
|
||||
"bottom_center_m": [
|
||||
0.0,
|
||||
-0.2370000034570694,
|
||||
0.09799999743700027
|
||||
],
|
||||
"bottom_z_mm": 97.99999743700027,
|
||||
"bottom_on_tray_surface": true,
|
||||
"top_z_mm": 208.00000429153442
|
||||
},
|
||||
"lowest_spout_z_mm": 224.03399646282196,
|
||||
"spout_to_tray_clearance_mm": 126.03399902582169,
|
||||
"spout_clearance_above_cup_mm": 16.033992171287537,
|
||||
"centered_head_projection_overlap_percent_of_cup": 100.0,
|
||||
"centered_penetrations": [],
|
||||
"centered_surface_contacts_excluding_tray_support": [],
|
||||
"centered_passed": true,
|
||||
"search": {
|
||||
"xy_step_mm": 2.5,
|
||||
"cup_upright": true,
|
||||
"bottom_remains_on_tray": true,
|
||||
"minimum_projection_overlap_percent_allowed": 25,
|
||||
"tested_collision_free_candidates": 627,
|
||||
"best_valid_position": {
|
||||
"cup_bottom_center_m": [
|
||||
0.0,
|
||||
-0.2370000034570694,
|
||||
0.09799999743700027
|
||||
],
|
||||
"offset_from_brew_axis_mm": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"head_projection_overlap_percent_of_cup": 100.0,
|
||||
"penetrations": 0,
|
||||
"surface_contacts_excluding_tray_support": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
import bpy
|
||||
import math
|
||||
from pathlib import Path
|
||||
|
||||
SIZE = 512
|
||||
INK = (0.012, 0.018, 0.020, 1.0)
|
||||
PAPER = (0.88, 0.87, 0.80, 1.0)
|
||||
FONT = {
|
||||
'0': ['01110', '10001', '10011', '10101', '11001', '10001', '01110'],
|
||||
'1': ['00100', '01100', '00100', '00100', '00100', '00100', '01110'],
|
||||
'2': ['01110', '10001', '00001', '00010', '00100', '01000', '11111'],
|
||||
'3': ['11110', '00001', '00001', '01110', '00001', '00001', '11110'],
|
||||
'4': ['00010', '00110', '01010', '10010', '11111', '00010', '00010'],
|
||||
'5': ['11111', '10000', '10000', '11110', '00001', '00001', '11110'],
|
||||
'6': ['01110', '10000', '10000', '11110', '10001', '10001', '01110'],
|
||||
'7': ['11111', '00001', '00010', '00100', '01000', '01000', '01000'],
|
||||
'8': ['01110', '10001', '10001', '01110', '10001', '10001', '01110'],
|
||||
'9': ['01110', '10001', '10001', '01111', '00001', '00001', '01110'],
|
||||
'T': ['11111', '00100', '00100', '00100', '00100', '00100', '00100'],
|
||||
'E': ['11111', '10000', '10000', '11110', '10000', '10000', '11111'],
|
||||
'M': ['10001', '11011', '10101', '10101', '10001', '10001', '10001'],
|
||||
'P': ['11110', '10001', '10001', '11110', '10000', '10000', '10000'],
|
||||
'F': ['11111', '10000', '10000', '11110', '10000', '10000', '10000'],
|
||||
'L': ['10000', '10000', '10000', '10000', '10000', '10000', '11111'],
|
||||
'O': ['01110', '10001', '10001', '10001', '10001', '10001', '01110'],
|
||||
'W': ['10001', '10001', '10001', '10101', '10101', '11011', '10001'],
|
||||
'D': ['11110', '10001', '10001', '10001', '10001', '10001', '11110'],
|
||||
'G': ['01110', '10001', '10000', '10111', '10001', '10001', '01110'],
|
||||
'C': ['01111', '10000', '10000', '10000', '10000', '10000', '01111'],
|
||||
'°': ['01100', '10010', '10010', '01100', '00000', '00000', '00000'],
|
||||
'%': ['11001', '11010', '00010', '00100', '01000', '01011', '10011'],
|
||||
' ': ['00000'] * 7,
|
||||
}
|
||||
|
||||
|
||||
def canvas():
|
||||
return list(PAPER) * (SIZE * SIZE)
|
||||
|
||||
|
||||
def pixel(data, x, y, color=INK):
|
||||
if 0 <= x < SIZE and 0 <= y < SIZE:
|
||||
index = (y * SIZE + x) * 4
|
||||
data[index:index + 4] = color
|
||||
|
||||
|
||||
def rect(data, x, y, width, height, color=INK):
|
||||
for yy in range(max(0, y), min(SIZE, y + height)):
|
||||
for xx in range(max(0, x), min(SIZE, x + width)):
|
||||
pixel(data, xx, yy, color)
|
||||
|
||||
|
||||
def line(data, x1, y1, x2, y2, width=2, color=INK):
|
||||
dx = x2 - x1
|
||||
dy = y2 - y1
|
||||
length2 = dx * dx + dy * dy
|
||||
min_x = max(0, int(min(x1, x2) - width - 1))
|
||||
max_x = min(SIZE, int(max(x1, x2) + width + 2))
|
||||
min_y = max(0, int(min(y1, y2) - width - 1))
|
||||
max_y = min(SIZE, int(max(y1, y2) + width + 2))
|
||||
for y in range(min_y, max_y):
|
||||
for x in range(min_x, max_x):
|
||||
if length2:
|
||||
t = max(0, min(1, ((x - x1) * dx + (y - y1) * dy) / length2))
|
||||
else:
|
||||
t = 0
|
||||
px = x1 + t * dx
|
||||
py = y1 + t * dy
|
||||
if (x - px) ** 2 + (y - py) ** 2 <= (width / 2) ** 2:
|
||||
pixel(data, x, y, color)
|
||||
|
||||
|
||||
def text(data, body, center_x, top_y, scale=4, color=INK):
|
||||
body = str(body)
|
||||
total = (len(body) * 6 - 1) * scale
|
||||
start_x = int(center_x - total / 2)
|
||||
for index, char in enumerate(body):
|
||||
glyph = FONT.get(char.upper(), FONT[' '])
|
||||
for row, pattern in enumerate(glyph):
|
||||
for column, bit in enumerate(pattern):
|
||||
if bit == '1':
|
||||
rect(data, start_x + (index * 6 + column) * scale, top_y + row * scale, scale, scale, color)
|
||||
|
||||
|
||||
def draw_gauge(data, label, unit):
|
||||
center = SIZE / 2
|
||||
for value in range(0, 101, 5):
|
||||
angle = math.radians(180 - value * 1.8)
|
||||
outer = 226
|
||||
inner = 199 if value % 25 == 0 else 211
|
||||
line(data, center + inner * math.cos(angle), center - inner * math.sin(angle), center + outer * math.cos(angle), center - outer * math.sin(angle), 4 if value % 25 == 0 else 2)
|
||||
if value % 25 == 0:
|
||||
text(data, str(value), center + 155 * math.cos(angle), int(center - 155 * math.sin(angle) - 13), 4 if value != 100 else 3)
|
||||
text(data, label, center, 307, 5)
|
||||
text(data, unit, center, 354, 4)
|
||||
|
||||
|
||||
def draw_rotating(data, maximum, labels, unit):
|
||||
center = SIZE / 2
|
||||
for value in range(maximum + 1):
|
||||
if value % 5:
|
||||
continue
|
||||
angle = math.radians(90 + value * 270 / maximum)
|
||||
outer = 226
|
||||
inner = 199 if value % 30 == 0 else 211
|
||||
line(data, center + inner * math.cos(angle), center - inner * math.sin(angle), center + outer * math.cos(angle), center - outer * math.sin(angle), 4 if value % 30 == 0 else 2)
|
||||
for value, label in labels:
|
||||
angle = math.radians(90 + value * 270 / maximum)
|
||||
text(data, label, center + 148 * math.cos(angle), int(center - 148 * math.sin(angle) - 12), 4 if len(str(label)) < 3 else 3)
|
||||
text(data, unit, center, 343, 4)
|
||||
|
||||
|
||||
def draw_conical(data, maximum):
|
||||
step = 10 if maximum == 270 else 5
|
||||
major_step = 30 if maximum == 270 else 25
|
||||
base_y = SIZE - 1
|
||||
for value in range(maximum + 1):
|
||||
if value % step:
|
||||
continue
|
||||
angle = (180 + value * 270 / maximum) % 360
|
||||
x = int(angle / 360 * SIZE) % SIZE
|
||||
major = value % major_step == 0
|
||||
line(data, x, base_y - 4, x, base_y - (220 if major else 136), 10 if major else 5)
|
||||
|
||||
|
||||
def create_dial_texture(kind, filepath):
|
||||
data = canvas()
|
||||
if kind == 'hot_water_conical':
|
||||
draw_conical(data, 270)
|
||||
elif kind == 'flow_dial_conical':
|
||||
draw_conical(data, 100)
|
||||
elif kind == 'hot_water':
|
||||
draw_rotating(data, 270, [(0, '0'), (90, '90'), (180, '180'), (270, '270')], 'DEG')
|
||||
elif kind == 'flow_dial':
|
||||
draw_rotating(data, 100, [(0, '0'), (25, '25'), (50, '50'), (75, '75'), (100, '100')], '%')
|
||||
elif kind == 'temperature':
|
||||
draw_gauge(data, 'TEMP', '°C')
|
||||
elif kind == 'flow_gauge':
|
||||
draw_gauge(data, 'FLOW', '%')
|
||||
else:
|
||||
raise ValueError(kind)
|
||||
pixels = []
|
||||
for y in range(SIZE - 1, -1, -1):
|
||||
start = y * SIZE * 4
|
||||
pixels.extend(data[start:start + SIZE * 4])
|
||||
image = bpy.data.images.new('CM_' + kind + '_FaceTexture', width=SIZE, height=SIZE, alpha=True)
|
||||
image.pixels = pixels
|
||||
image.update()
|
||||
image.filepath_raw = str(Path(filepath))
|
||||
image.file_format = 'PNG'
|
||||
image.save()
|
||||
image.pack()
|
||||
return image
|
||||
|
||||
|
||||
def create_arrow_texture(direction, filepath):
|
||||
data = [0.0] * (SIZE * SIZE * 4)
|
||||
red = (0.72, 0.025, 0.018, 1.0)
|
||||
for y in range(120, 393):
|
||||
ratio = abs(y - 256) / 136
|
||||
if direction < 0:
|
||||
start = int(60 + 320 * ratio)
|
||||
end = 380
|
||||
else:
|
||||
start = 132
|
||||
end = int(452 - 320 * ratio)
|
||||
for x in range(start, end + 1):
|
||||
index = (y * SIZE + x) * 4
|
||||
data[index:index + 4] = red
|
||||
pixels = []
|
||||
for y in range(SIZE - 1, -1, -1):
|
||||
start = y * SIZE * 4
|
||||
pixels.extend(data[start:start + SIZE * 4])
|
||||
kind = 'arrow_left' if direction < 0 else 'arrow_right'
|
||||
image = bpy.data.images.new('CM_' + kind + '_DecalTexture', width=SIZE, height=SIZE, alpha=True)
|
||||
image.pixels = pixels
|
||||
image.update()
|
||||
image.filepath_raw = str(Path(filepath))
|
||||
image.file_format = 'PNG'
|
||||
image.save()
|
||||
image.pack()
|
||||
return image
|
||||
@@ -0,0 +1,211 @@
|
||||
from pathlib import Path
|
||||
import json
|
||||
import math
|
||||
|
||||
import bpy
|
||||
from mathutils import Matrix, Vector
|
||||
from bpy_extras.object_utils import world_to_camera_view
|
||||
|
||||
OUT = Path(__file__).resolve().parent
|
||||
SOURCE = OUT / 'PerfectCoffee_CoffeeMachine.blend'
|
||||
|
||||
bpy.ops.wm.open_mainfile(filepath=str(SOURCE))
|
||||
source_root = bpy.data.objects.get('CM_Portafilter')
|
||||
if source_root is None:
|
||||
raise RuntimeError('CM_Portafilter was not found in the source file.')
|
||||
source_objects = [source_root, *source_root.children_recursive]
|
||||
|
||||
preview_scene = bpy.data.scenes.new('PerfectCoffee_Portafilter')
|
||||
bpy.context.window.scene = preview_scene
|
||||
model_collection = bpy.data.collections.new('CM_Portafilter_Model')
|
||||
preview_scene.collection.children.link(model_collection)
|
||||
studio_collection = bpy.data.collections.new('Studio_Exclude_From_Export')
|
||||
preview_scene.collection.children.link(studio_collection)
|
||||
|
||||
object_map = {}
|
||||
for source in source_objects:
|
||||
copied = source.copy()
|
||||
if source.data is not None:
|
||||
copied.data = source.data.copy()
|
||||
copied.animation_data_clear()
|
||||
model_collection.objects.link(copied)
|
||||
object_map[source] = copied
|
||||
|
||||
for source, copied in object_map.items():
|
||||
copied.matrix_world = source.matrix_world.copy()
|
||||
if source == source_root:
|
||||
copied.parent = None
|
||||
else:
|
||||
copied.parent = object_map[source.parent]
|
||||
copied.matrix_parent_inverse = source.matrix_parent_inverse.copy()
|
||||
copied.matrix_world = source.matrix_world.copy()
|
||||
|
||||
portafilter = object_map[source_root]
|
||||
sealing_height = source_root.matrix_world.translation.z - source_root.get('cup_clearance_lift_m', 0.0)
|
||||
for source, copied in object_map.items():
|
||||
if source != source_root:
|
||||
copied.matrix_parent_inverse = Matrix.Identity(4)
|
||||
copied.matrix_world = source.matrix_world.copy()
|
||||
for source in source_objects:
|
||||
bpy.data.objects.remove(source, do_unlink=True)
|
||||
for copied in object_map.values():
|
||||
copied.name = copied.name.removesuffix('.001')
|
||||
bpy.data.scenes.remove(bpy.data.scenes['Scene'], do_unlink=True)
|
||||
|
||||
portafilter.location = (0, 0, sealing_height)
|
||||
portafilter.rotation_euler = (0, 0, 0)
|
||||
portafilter.scale = (1, 1, 1)
|
||||
bpy.context.view_layer.update()
|
||||
|
||||
axis_direction = Vector((0, -1, 0))
|
||||
segment_start = Vector((0, -0.034, (sealing_height - 0.0185)))
|
||||
rod_lengths = {}
|
||||
rod_endpoints = {}
|
||||
for name in ('Neck', 'Grip', 'GripCap'):
|
||||
rod = bpy.data.objects['CM_Portafilter_' + name]
|
||||
length = max(vertex.co.z for vertex in rod.data.vertices) - min(vertex.co.z for vertex in rod.data.vertices)
|
||||
if name != 'Neck':
|
||||
segment_start -= axis_direction * 0.003
|
||||
segment_end = segment_start + axis_direction * length
|
||||
rod.matrix_world = Matrix.Translation((segment_start + segment_end) * 0.5) @ axis_direction.to_track_quat('Z', 'Y').to_matrix().to_4x4()
|
||||
rod['axis_alignment'] = 'Y; shared centerline with neck, grip and cap'
|
||||
rod_lengths[name] = length
|
||||
rod_endpoints[name] = [list(segment_start), list(segment_end)]
|
||||
segment_start = segment_end
|
||||
|
||||
portafilter['source_file'] = SOURCE.name
|
||||
portafilter['extraction'] = 'Standalone part; source machine excluded. Bowl centered in XOY; handle aligned to Y.'
|
||||
portafilter['bowl_center_xy_m'] = [0.0, 0.0]
|
||||
portafilter['grip_axis'] = 'Y'
|
||||
preview_scene.unit_settings.system = 'METRIC'
|
||||
preview_scene.unit_settings.length_unit = 'METERS'
|
||||
preview_scene.unit_settings.scale_length = 1.0
|
||||
bpy.context.view_layer.update()
|
||||
|
||||
bowl = bpy.data.objects['CM_Portafilter_Bowl']
|
||||
bowl_center = sum((bowl.matrix_world @ vertex.co for vertex in bowl.data.vertices), Vector()) / len(bowl.data.vertices)
|
||||
assert abs(bowl_center.x) < 1e-7 and abs(bowl_center.y) < 1e-7
|
||||
assert abs(portafilter.matrix_world.translation.x) < 1e-7 and abs(portafilter.matrix_world.translation.y) < 1e-7
|
||||
for name in rod_endpoints:
|
||||
rod = bpy.data.objects['CM_Portafilter_' + name]
|
||||
half_length = rod_lengths[name] * 0.5
|
||||
world_endpoints = [rod.matrix_world @ Vector((0, 0, sign * half_length)) for sign in (-1, 1)]
|
||||
for point in world_endpoints:
|
||||
assert abs(point.x) < 1e-7 and abs(point.z - (sealing_height - 0.0185)) < 1e-7, (name, [tuple(p) for p in world_endpoints], tuple(rod.location), tuple(rod.rotation_euler), tuple(portafilter.matrix_world.translation), [list(row) for row in rod.matrix_parent_inverse])
|
||||
assert abs((world_endpoints[1] - world_endpoints[0]).length - rod_lengths[name]) < 1e-7
|
||||
rod_endpoints[name] = [list(point) for point in world_endpoints]
|
||||
|
||||
mesh_objects = [obj for obj in model_collection.objects if obj.type == 'MESH']
|
||||
points = [obj.matrix_world @ Vector(corner) for obj in mesh_objects for corner in obj.bound_box]
|
||||
bounds_min = Vector(tuple(min(point[axis] for point in points) for axis in range(3)))
|
||||
bounds_max = Vector(tuple(max(point[axis] for point in points) for axis in range(3)))
|
||||
center = (bounds_min + bounds_max) * 0.5
|
||||
extent = bounds_max - bounds_min
|
||||
|
||||
|
||||
def point_at(obj, target):
|
||||
obj.rotation_euler = (Vector(target) - obj.location).to_track_quat('-Z', 'Y').to_euler()
|
||||
|
||||
|
||||
def camera(name, direction, width, height):
|
||||
data = bpy.data.cameras.new(name)
|
||||
data.type = 'ORTHO'
|
||||
data.clip_start = 0.001
|
||||
data.clip_end = 100
|
||||
obj = bpy.data.objects.new(name, data)
|
||||
studio_collection.objects.link(obj)
|
||||
obj.location = center + Vector(direction) * 1.2
|
||||
point_at(obj, center)
|
||||
preview_scene.camera = obj
|
||||
data.ortho_scale = max(extent) * 1.20
|
||||
bpy.context.view_layer.update()
|
||||
data.lens = 55
|
||||
return obj
|
||||
|
||||
|
||||
def area_light(name, position, power, size, color):
|
||||
data = bpy.data.lights.new(name, 'AREA')
|
||||
data.energy = power
|
||||
data.shape = 'DISK'
|
||||
data.size = size
|
||||
data.color = color
|
||||
obj = bpy.data.objects.new(name, data)
|
||||
studio_collection.objects.link(obj)
|
||||
obj.location = center + Vector(position)
|
||||
point_at(obj, center)
|
||||
|
||||
|
||||
area_light('Studio_Key', (-0.4, -0.45, 0.65), 35, 0.5, (1.0, 0.92, 0.82))
|
||||
area_light('Studio_Fill', (0.45, -0.1, 0.3), 25, 0.45, (0.80, 0.90, 1.0))
|
||||
area_light('Studio_Rim', (0.0, 0.5, 0.6), 40, 0.4, (1.0, 1.0, 1.0))
|
||||
|
||||
world = bpy.data.worlds.new('Portafilter_Studio_World')
|
||||
world.use_nodes = True
|
||||
world.node_tree.nodes['Background'].inputs['Color'].default_value = (0.20, 0.23, 0.27, 1)
|
||||
world.node_tree.nodes['Background'].inputs['Strength'].default_value = 0.45
|
||||
preview_scene.world = world
|
||||
preview_scene.render.engine = 'CYCLES'
|
||||
preview_scene.cycles.samples = 40
|
||||
preview_scene.cycles.use_denoising = True
|
||||
preview_scene.render.resolution_x = 1400
|
||||
preview_scene.render.resolution_y = 1400
|
||||
preview_scene.render.resolution_percentage = 100
|
||||
preview_scene.render.image_settings.file_format = 'PNG'
|
||||
preview_scene.render.image_settings.color_mode = 'RGBA'
|
||||
preview_scene.render.film_transparent = False
|
||||
preview_scene.view_settings.view_transform = 'AgX'
|
||||
preview_scene.view_settings.exposure = 0.0
|
||||
|
||||
views = [
|
||||
('Portafilter_Front_XOZ', (0, -1, 0), 'portafilter_front.png'),
|
||||
('Portafilter_Right_YOZ', (1, 0, 0), 'portafilter_side.png'),
|
||||
('Portafilter_Top_XOY', (0, 0, 1), 'portafilter_top.png'),
|
||||
]
|
||||
coverage = {}
|
||||
for name, direction, filename in views:
|
||||
cam = camera(name, direction, 1400, 1400)
|
||||
preview_scene.camera = cam
|
||||
bpy.context.view_layer.update()
|
||||
projected = [world_to_camera_view(preview_scene, cam, point) for point in points]
|
||||
coverage[name] = all(0 < point.x < 1 and 0 < point.y < 1 and point.z > 0 for point in projected)
|
||||
if not coverage[name]:
|
||||
raise RuntimeError('Model is clipped by camera: ' + name + ' bounds=' + str((list(bounds_min), list(bounds_max))) + ' camera=' + str(tuple(cam.matrix_world.translation)) + ' rotation=' + str(tuple(cam.rotation_euler)) + ' projection=' + str([tuple(point) for point in projected]))
|
||||
preview_scene.render.filepath = str(OUT / filename)
|
||||
bpy.ops.render.render(write_still=True)
|
||||
|
||||
bpy.ops.object.select_all(action='DESELECT')
|
||||
for obj in model_collection.objects:
|
||||
obj.select_set(True)
|
||||
bpy.context.view_layer.objects.active = portafilter
|
||||
bpy.ops.export_scene.gltf(
|
||||
filepath=str(OUT / 'PerfectCoffee_Portafilter.glb'),
|
||||
export_format='GLB',
|
||||
use_selection=True,
|
||||
export_apply=True,
|
||||
export_cameras=False,
|
||||
export_lights=False,
|
||||
export_animations=False,
|
||||
)
|
||||
|
||||
preview_scene.camera = bpy.data.objects['Portafilter_Front_XOZ']
|
||||
preview_scene.render.filepath = str(OUT / 'portafilter_front.png')
|
||||
for screen in bpy.data.screens:
|
||||
for area in screen.areas:
|
||||
if area.type == 'VIEW_3D':
|
||||
area.spaces.active.region_3d.view_perspective = 'CAMERA'
|
||||
area.spaces.active.shading.type = 'MATERIAL'
|
||||
bpy.context.window.scene = preview_scene
|
||||
bpy.ops.file.pack_all()
|
||||
removed_orphans = bpy.data.orphans_purge(do_recursive=True)
|
||||
assert not any(name in bpy.data.objects for name in ('CM_CoffeeMachine', 'CM_Body', 'CM_GroupHead'))
|
||||
bpy.ops.wm.save_as_mainfile(filepath=str(OUT / 'PerfectCoffee_Portafilter.blend'))
|
||||
print('PORTAFILTER_EXPORT=' + json.dumps({
|
||||
'mesh_objects': len(mesh_objects),
|
||||
'vertices': sum(len(obj.data.vertices) for obj in mesh_objects),
|
||||
'polygons': sum(len(obj.data.polygons) for obj in mesh_objects),
|
||||
'bounds_min_m': list(bounds_min),
|
||||
'bounds_max_m': list(bounds_max),
|
||||
'all_views_unclipped': all(coverage.values()),
|
||||
'source_modified': False,
|
||||
}, ensure_ascii=False), flush=True)
|
||||
print('PORTAFILTER_EXPORT_COMPLETE', flush=True)
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,327 @@
|
||||
from pathlib import Path
|
||||
import hashlib
|
||||
import json
|
||||
import math
|
||||
|
||||
import bmesh
|
||||
import bpy
|
||||
from mathutils import Vector
|
||||
from mathutils.bvhtree import BVHTree
|
||||
|
||||
ROOT = Path(__file__).resolve().parent
|
||||
SOURCE = ROOT / 'PerfectCoffee_CoffeeMachine.blend'
|
||||
CUP_SOURCE = ROOT.parent / 'coffee_cup' / 'PerfectCoffee_CoffeeCup.blend'
|
||||
OUT = ROOT / 'cup_fit_test'
|
||||
OUT.mkdir(parents=True, exist_ok=True)
|
||||
source_hash = hashlib.sha256(SOURCE.read_bytes()).hexdigest()
|
||||
cup_hash = hashlib.sha256(CUP_SOURCE.read_bytes()).hexdigest()
|
||||
|
||||
bpy.ops.wm.open_mainfile(filepath=str(SOURCE))
|
||||
bpy.context.preferences.filepaths.save_version = 0
|
||||
scene = bpy.context.scene
|
||||
scene.name = 'Cup_Placement_Test'
|
||||
machine = bpy.data.objects['CM_CoffeeMachine']
|
||||
group = bpy.data.objects['CM_GroupHead']
|
||||
tray = bpy.data.objects['CM_DripTray_TextureSurface']
|
||||
bpy.context.view_layer.update()
|
||||
brew_xy = Vector((group.matrix_world.translation.x, group.matrix_world.translation.y))
|
||||
support_z = max((tray.matrix_world @ vertex.co).z for vertex in tray.data.vertices)
|
||||
|
||||
with bpy.data.libraries.load(str(CUP_SOURCE), link=False) as (data_from, data_to):
|
||||
data_to.objects = ['CC_Cup_Body']
|
||||
cup = data_to.objects[0]
|
||||
test_collection = bpy.data.collections.new('Cup_Placement_Test_Only')
|
||||
scene.collection.children.link(test_collection)
|
||||
test_collection.objects.link(cup)
|
||||
cup.parent = None
|
||||
cup.matrix_world.identity()
|
||||
cup.rotation_euler = (0, 0, 0)
|
||||
cup.scale = (1, 1, 1)
|
||||
cup.location = (brew_xy.x, brew_xy.y, support_z)
|
||||
cup['test_only'] = True
|
||||
cup['lid_included'] = False
|
||||
cup['support_surface'] = 'CM_DripTray_TextureSurface'
|
||||
cup['support_z_m'] = support_z
|
||||
|
||||
intersection_collection = bpy.data.collections.new('Test_Intersection_Volumes')
|
||||
scene.collection.children.link(intersection_collection)
|
||||
probe_collection = bpy.data.collections.new('Test_Temporary_Probes')
|
||||
scene.collection.children.link(probe_collection)
|
||||
probe = bpy.data.objects.new('Test_Cup_Intersection_Probe', cup.data.copy())
|
||||
probe_collection.objects.link(probe)
|
||||
|
||||
red = bpy.data.materials.new('Test_Collision_Red')
|
||||
red.use_nodes = True
|
||||
red.diffuse_color = (1, 0.015, 0.005, 1)
|
||||
red.node_tree.nodes.get('Principled BSDF').inputs['Base Color'].default_value = (1, 0.015, 0.005, 1)
|
||||
red.node_tree.nodes.get('Principled BSDF').inputs['Roughness'].default_value = 0.5
|
||||
|
||||
|
||||
def world_mesh(obj, depsgraph):
|
||||
evaluated = obj.evaluated_get(depsgraph)
|
||||
mesh = evaluated.to_mesh()
|
||||
vertices = [evaluated.matrix_world @ vertex.co for vertex in mesh.vertices]
|
||||
polygons = [tuple(polygon.vertices) for polygon in mesh.polygons]
|
||||
evaluated.to_mesh_clear()
|
||||
return vertices, polygons
|
||||
|
||||
|
||||
def bvh_from_world(vertices, polygons):
|
||||
return BVHTree.FromPolygons(vertices, polygons, all_triangles=False, epsilon=0.0)
|
||||
|
||||
|
||||
def bounds_of_vertices(vertices):
|
||||
return {
|
||||
'min': [min(vertex[axis] for vertex in vertices) for axis in range(3)],
|
||||
'max': [max(vertex[axis] for vertex in vertices) for axis in range(3)],
|
||||
}
|
||||
|
||||
|
||||
def intersection_volume(target):
|
||||
probe.data = cup.data.copy()
|
||||
probe.matrix_world = cup.matrix_world.copy()
|
||||
bpy.context.view_layer.update()
|
||||
modifier = probe.modifiers.new('Test_Intersection', 'BOOLEAN')
|
||||
modifier.operation = 'INTERSECT'
|
||||
modifier.solver = 'EXACT'
|
||||
modifier.object = target
|
||||
bpy.context.view_layer.objects.active = probe
|
||||
bpy.ops.object.modifier_apply(modifier=modifier.name)
|
||||
bm = bmesh.new()
|
||||
bm.from_mesh(probe.data)
|
||||
volume = abs(bm.calc_volume(signed=True))
|
||||
bm.free()
|
||||
vertices = [probe.matrix_world @ vertex.co for vertex in probe.data.vertices]
|
||||
return volume, vertices
|
||||
|
||||
|
||||
def check_position(position, keep_intersections=False, exact=True):
|
||||
cup.location = (position[0], position[1], support_z)
|
||||
bpy.context.view_layer.update()
|
||||
depsgraph = bpy.context.evaluated_depsgraph_get()
|
||||
vertices, polygons = world_mesh(cup, depsgraph)
|
||||
cup_bvh = bvh_from_world(vertices, polygons)
|
||||
collisions = []
|
||||
contacts = []
|
||||
for target, target_bvh in machine_bvhs:
|
||||
pairs = cup_bvh.overlap(target_bvh)
|
||||
if not pairs:
|
||||
continue
|
||||
if not exact:
|
||||
contacts.append({'machine_part': target.name, 'overlapping_face_pairs': len(pairs)})
|
||||
continue
|
||||
volume, intersection_vertices = intersection_volume(target)
|
||||
entry = {
|
||||
'machine_part': target.name,
|
||||
'overlapping_face_pairs': len(pairs),
|
||||
'intersection_volume_mm3': volume * 1e9,
|
||||
}
|
||||
if intersection_vertices:
|
||||
entry['intersection_bounds_m'] = bounds_of_vertices(intersection_vertices)
|
||||
if volume > 1e-12:
|
||||
collisions.append(entry)
|
||||
if keep_intersections:
|
||||
intersection_mesh = probe.data.copy()
|
||||
intersection_mesh.name = 'Test_Intersection_' + target.name
|
||||
intersection_mesh.materials.clear()
|
||||
intersection_mesh.materials.append(red)
|
||||
intersection_obj = bpy.data.objects.new(intersection_mesh.name, intersection_mesh)
|
||||
intersection_collection.objects.link(intersection_obj)
|
||||
intersection_obj.matrix_world = probe.matrix_world.copy()
|
||||
intersection_obj['test_only'] = True
|
||||
else:
|
||||
contacts.append(entry)
|
||||
return collisions, contacts
|
||||
|
||||
|
||||
bpy.context.view_layer.update()
|
||||
depsgraph = bpy.context.evaluated_depsgraph_get()
|
||||
machine_objects = [
|
||||
obj for obj in machine.children_recursive
|
||||
if obj.type in {'MESH', 'CURVE', 'FONT', 'SURFACE'} and obj != tray
|
||||
]
|
||||
machine_bvhs = []
|
||||
for obj in machine_objects:
|
||||
vertices, polygons = world_mesh(obj, depsgraph)
|
||||
machine_bvhs.append((obj, bvh_from_world(vertices, polygons)))
|
||||
|
||||
centered_collisions, centered_contacts = check_position(brew_xy, keep_intersections=True)
|
||||
spout_objects = [bpy.data.objects['CM_Portafilter_SpoutLeft'], bpy.data.objects['CM_Portafilter_SpoutRight']]
|
||||
outlet_min_z = min(
|
||||
(obj.matrix_world @ Vector(corner)).z
|
||||
for obj in spout_objects for corner in obj.bound_box
|
||||
)
|
||||
cup_bounds = bounds_of_vertices([
|
||||
cup.matrix_world @ vertex.co for vertex in cup.data.vertices
|
||||
])
|
||||
|
||||
|
||||
def circle_overlap_ratio(dx, dy, small=0.0425, large=0.05):
|
||||
distance = math.hypot(dx, dy)
|
||||
if distance >= small + large:
|
||||
return 0.0
|
||||
if distance <= large - small:
|
||||
return 1.0
|
||||
first = math.acos((distance * distance + small * small - large * large) / (2 * distance * small))
|
||||
second = math.acos((distance * distance + large * large - small * small) / (2 * distance * large))
|
||||
area = small * small * first + large * large * second - 0.5 * math.sqrt(
|
||||
(-distance + small + large) * (distance + small - large)
|
||||
* (distance - small + large) * (distance + small + large)
|
||||
)
|
||||
return area / (math.pi * small * small)
|
||||
|
||||
|
||||
candidates = []
|
||||
for ix in range(-32, 33):
|
||||
dx = ix * 0.0025
|
||||
for iy in range(-22, 22):
|
||||
dy = iy * 0.0025
|
||||
position = brew_xy + Vector((dx, dy))
|
||||
overlap = circle_overlap_ratio(dx, dy)
|
||||
if overlap < 0.25:
|
||||
continue
|
||||
collisions, contacts = check_position(position, exact=False)
|
||||
if not collisions and not contacts:
|
||||
candidates.append({
|
||||
'cup_bottom_center_m': [position.x, position.y, support_z],
|
||||
'offset_from_brew_axis_mm': [dx * 1000, dy * 1000],
|
||||
'head_projection_overlap_percent_of_cup': overlap * 100,
|
||||
'penetrations': 0,
|
||||
'surface_contacts_excluding_tray_support': 0,
|
||||
})
|
||||
|
||||
candidates.sort(key=lambda candidate: (
|
||||
-candidate['head_projection_overlap_percent_of_cup'],
|
||||
math.hypot(*candidate['offset_from_brew_axis_mm']),
|
||||
))
|
||||
best = candidates[0] if candidates else None
|
||||
|
||||
scene.render.engine = 'CYCLES'
|
||||
scene.cycles.samples = 40
|
||||
scene.cycles.use_denoising = True
|
||||
scene.render.resolution_x = 1400
|
||||
scene.render.resolution_y = 1400
|
||||
scene.render.resolution_percentage = 100
|
||||
scene.render.image_settings.file_format = 'PNG'
|
||||
scene.render.image_settings.color_mode = 'RGBA'
|
||||
scene.view_settings.view_transform = 'AgX'
|
||||
|
||||
|
||||
def point_at(obj, target):
|
||||
obj.rotation_euler = (Vector(target) - obj.location).to_track_quat('-Z', 'Y').to_euler()
|
||||
|
||||
|
||||
def test_camera(name, location, target, scale):
|
||||
data = bpy.data.cameras.new(name)
|
||||
data.type = 'ORTHO'
|
||||
data.ortho_scale = scale
|
||||
data.clip_start = 0.001
|
||||
data.clip_end = 100
|
||||
obj = bpy.data.objects.new(name, data)
|
||||
bpy.data.collections['Studio_Exclude_From_Export'].objects.link(obj)
|
||||
obj.location = location
|
||||
point_at(obj, target)
|
||||
return obj
|
||||
|
||||
|
||||
side_camera = test_camera('CupTest_Centered_YOZ', (0.9, brew_xy.y, 0.21), (0, brew_xy.y, 0.18), 0.245)
|
||||
front_camera = test_camera('CupTest_Centered_XOZ', (0, -0.9, 0.215), (0, brew_xy.y, 0.18), 0.245)
|
||||
cup.location = (brew_xy.x, brew_xy.y, support_z)
|
||||
bpy.context.view_layer.update()
|
||||
for camera, filename in [(front_camera, 'centered_front.png'), (side_camera, 'centered_side.png')]:
|
||||
scene.camera = camera
|
||||
scene.render.filepath = str(OUT / filename)
|
||||
bpy.ops.render.render(write_still=True)
|
||||
|
||||
if best:
|
||||
cup.location = best['cup_bottom_center_m']
|
||||
bpy.context.view_layer.update()
|
||||
scene.camera = side_camera
|
||||
scene.render.filepath = str(OUT / 'accepted_side.png')
|
||||
bpy.ops.render.render(write_still=True)
|
||||
|
||||
original_materials = {obj.data: list(obj.data.materials) for obj in machine_objects if obj.type == 'MESH'}
|
||||
ghost = bpy.data.materials.new('Test_Top_Ghost')
|
||||
ghost.use_nodes = True
|
||||
nodes = ghost.node_tree.nodes
|
||||
nodes.clear()
|
||||
transparent = nodes.new('ShaderNodeBsdfTransparent')
|
||||
solid = nodes.new('ShaderNodeBsdfPrincipled')
|
||||
solid.inputs['Base Color'].default_value = (0.42, 0.52, 0.61, 1)
|
||||
solid.inputs['Roughness'].default_value = 0.5
|
||||
mix = nodes.new('ShaderNodeMixShader')
|
||||
mix.inputs[0].default_value = 0.13
|
||||
output = nodes.new('ShaderNodeOutputMaterial')
|
||||
ghost.node_tree.links.new(transparent.outputs[0], mix.inputs[1])
|
||||
ghost.node_tree.links.new(solid.outputs[0], mix.inputs[2])
|
||||
ghost.node_tree.links.new(mix.outputs[0], output.inputs['Surface'])
|
||||
for mesh, materials in original_materials.items():
|
||||
mesh.materials.clear()
|
||||
mesh.materials.append(ghost)
|
||||
top_camera = test_camera('CupTest_Best_XOY_Ghost', (brew_xy.x, brew_xy.y, 0.9), (brew_xy.x, brew_xy.y, 0), 0.30)
|
||||
scene.camera = top_camera
|
||||
scene.render.filepath = str(OUT / 'accepted_top_ghost.png')
|
||||
bpy.ops.render.render(write_still=True)
|
||||
for mesh, materials in original_materials.items():
|
||||
mesh.materials.clear()
|
||||
for material in materials:
|
||||
mesh.materials.append(material)
|
||||
|
||||
cup.location = (brew_xy.x, brew_xy.y, support_z)
|
||||
bpy.context.view_layer.update()
|
||||
probe.hide_render = True
|
||||
probe.hide_viewport = True
|
||||
scene.camera = side_camera
|
||||
scene.render.filepath = str(OUT / 'centered_side.png')
|
||||
for screen in bpy.data.screens:
|
||||
for area in screen.areas:
|
||||
if area.type == 'VIEW_3D':
|
||||
area.spaces.active.region_3d.view_perspective = 'CAMERA'
|
||||
area.spaces.active.shading.type = 'MATERIAL'
|
||||
bpy.ops.wm.save_as_mainfile(filepath=str(OUT / 'CupPlacement_Test.blend'))
|
||||
|
||||
assert hashlib.sha256(SOURCE.read_bytes()).hexdigest() == source_hash
|
||||
assert hashlib.sha256(CUP_SOURCE.read_bytes()).hexdigest() == cup_hash
|
||||
report = {
|
||||
'source_machine_unchanged': True,
|
||||
'source_machine_sha256': source_hash,
|
||||
'source_cup_unchanged': True,
|
||||
'source_cup_sha256': cup_hash,
|
||||
'lid_included': False,
|
||||
'layout': {
|
||||
'scheme': 'A',
|
||||
'brew_center_xy_m': list(brew_xy),
|
||||
'group_seal_z_mm': group.matrix_world.translation.z * 1000,
|
||||
'tray_support_z_mm': support_z * 1000,
|
||||
},
|
||||
'cup': {
|
||||
'height_mm': 110,
|
||||
'top_diameter_mm': 85,
|
||||
'bottom_diameter_mm': 60,
|
||||
'bottom_center_m': [brew_xy.x, brew_xy.y, support_z],
|
||||
'bottom_z_mm': cup_bounds['min'][2] * 1000,
|
||||
'bottom_on_tray_surface': abs(cup_bounds['min'][2] - support_z) < 1e-7,
|
||||
'top_z_mm': cup_bounds['max'][2] * 1000,
|
||||
},
|
||||
'lowest_spout_z_mm': outlet_min_z * 1000,
|
||||
'spout_to_tray_clearance_mm': (outlet_min_z - support_z) * 1000,
|
||||
'spout_clearance_above_cup_mm': (outlet_min_z - cup_bounds['max'][2]) * 1000,
|
||||
'centered_head_projection_overlap_percent_of_cup': circle_overlap_ratio(0, 0) * 100,
|
||||
'centered_penetrations': centered_collisions,
|
||||
'centered_surface_contacts_excluding_tray_support': centered_contacts,
|
||||
'centered_passed': not centered_collisions and not centered_contacts,
|
||||
'search': {
|
||||
'xy_step_mm': 2.5,
|
||||
'cup_upright': True,
|
||||
'bottom_remains_on_tray': True,
|
||||
'minimum_projection_overlap_percent_allowed': 25,
|
||||
'tested_collision_free_candidates': len(candidates),
|
||||
'best_valid_position': best,
|
||||
},
|
||||
}
|
||||
(OUT / 'validation.json').write_text(json.dumps(report, ensure_ascii=False, indent=2), encoding='utf-8')
|
||||
assert report['cup']['bottom_on_tray_surface'], 'Cup bottom is not on the tray surface.'
|
||||
assert report['centered_passed'], 'Cup placement still intersects the coffee machine: ' + json.dumps(centered_collisions + centered_contacts)
|
||||
assert best and best['offset_from_brew_axis_mm'] == [0.0, 0.0], 'The centered position is not the best valid position.'
|
||||
print('CUP_PLACEMENT_VALIDATION=' + json.dumps(report, ensure_ascii=False), flush=True)
|
||||
print('CUP_PLACEMENT_TEST_COMPLETE', flush=True)
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,94 @@
|
||||
# 研磨机参考模型来源与验证
|
||||
|
||||
本目录保留 **11 套不同模型**,按驱动方式分类,原有编号不变:
|
||||
|
||||
- `manual/`:**6 套手摇或复古研磨机**(01–06)。
|
||||
- `electric/`:**5 套电动研磨机**(07–11),其中 08–11 为本次新增,均附原始 GLB 和可直接打开的 `.blend`。
|
||||
|
||||
所有模型均已实际下载,并使用 **Blender 5.2.0 LTS** 重新打开或导入检查。每套均附来源预览、两个角度的本地 Blender 验证图、网格检查报告及机器可读的 `source.json`。第 06 套仍需通过“文件 → 导入 → FBX”打开,其余 `.blend` 均可直接进入居中的 3D 材质预览视图,无须输入命令。
|
||||
|
||||
> 第 06 套的 V-Ray 材质需要在 Blender 中另行重建,其灰模验证图不应与来源彩色预览混淆。08–11 不是 CC0 或开源许可,而是 3D Warehouse 通用模型许可;与 01、07 的 CC0 授权严格区分。
|
||||
|
||||
## 手摇模型 `manual/`
|
||||
|
||||
| 目录 | 外形与主要文件 | 作者 | 授权 | Blender 检查结果 |
|
||||
|---|---|---|---|---|
|
||||
| `manual/01_freepoly_coffee_grinder_cc0` | 木质圆桶机身、金属盖和长曲柄;`CoffeeGrinder.blend` | Free poly | **CC0** | 1 个网格,66,075 个多边形;约 127.9 × 92.3 × 151.0 mm |
|
||||
| `manual/02_mingyang_camping_grinder_rf` | 便携金属圆筒、折叠式长柄;`CampingCoffeeGrinder.blend` | Mingyang J | Royalty Free | 5 个网格,1,667 个多边形;约 93.4 × 38.4 × 133.6 mm |
|
||||
| `manual/03_josemartinez_manual_grinder_rf` | 铸铁手轮、支架和金属接粉罐;`ManualCoffeeGrinder.blend` | José Martinez | Royalty Free | 20 个可见网格,18,312 个多边形;约 262.9 × 237.8 × 498.4 mm |
|
||||
| `manual/04_vertexhorizons_etna_grinder_rf` | 蓝色旧金属方盒、顶部曲柄和接粉抽屉;`AntiqueCoffeeGrinder.blend` | Vertex Horizons | Royalty Free | 2 个网格,4,751 个多边形;约 183.0 × 233.2 × 220.8 mm |
|
||||
| `manual/05_ydd_black_glass_grinder_rf` | 黑色上盖、金属环、玻璃接粉罐和顶部曲柄;`ManualCoffeeGrinder.blend` | ydd 3D | Royalty Free | 10 个网格,21,251 个多边形;约 83.6 × 92.6 × 165.8 mm |
|
||||
| `manual/06_radetzki_vintage_grinder_personal` | 复古齿轮机构、长曲柄、绿色底座及散落咖啡豆;`RVDESIGN_Coffee_Grinder.FBX` | Vladimir Radetzki | **仅个人非商业使用;商业使用需书面许可;禁止再分发** | 9 个网格,237,384 个多边形;V-Ray 材质未自动转换,验证图为灰模 |
|
||||
|
||||
## 电动模型 `electric/`
|
||||
|
||||
| 目录 | 外形与主要文件 | 作者 | 授权 | Blender 检查结果 |
|
||||
|---|---|---|---|---|
|
||||
| `electric/07_grab3d_electric_coffee_grinder_cc0` | 浅蓝色 C 形机身、透明豆仓、调节旋钮、启动按钮、出粉口及独立接粉容器;`coffee-grinder.blend`、`coffee-grinder.glb` | Grab3D | **CC0** | 5 个网格,20,804 个多边形;约 120.0 × 187.3 × 372.8 mm |
|
||||
| `electric/08_baratza_encore_warehouse_terms` | Baratza Encore 风格的家用电动款,锥形豆仓和前侧接粉杯;`BaratzaEncore.blend`、`BaratzaEncore.glb` | Edward F. | 3D Warehouse 通用模型许可 | 4 个网格,2,386 个多边形;约 140.0 × 181.4 × 342.9 mm |
|
||||
| `electric/09_mazzer_mini_electronic_warehouse_terms` | Mazzer Mini Electronic,豆仓、接粉容器、机身和支架;`MazzerMiniElectronic.blend`、`MazzerMiniElectronic.glb` | Sam C. | 3D Warehouse 通用模型许可 | 22 个网格,9,010 个多边形;约 327.5 × 226.4 × 526.7 mm |
|
||||
| `electric/10_kalita_next_g_warehouse_terms` | Kalita NEXT G G2,横向电机机身、顶部豆仓和宽底座;`KalitaNextG.blend`、`KalitaNextG.glb` | 小喵 魅.Sylvia | 3D Warehouse 通用模型许可 | 21 个网格,5,625 个多边形;约 123.0 × 215.0 × 401.0 mm |
|
||||
| `electric/11_eureka_mignon_warehouse_terms` | Eureka Mignon,白色紧凑机身、方形透明豆仓和出粉口;`EurekaMignon.blend`、`EurekaMignon.glb` | MasZakrY .. | 3D Warehouse 通用模型许可 | 6 个网格,1,278 个多边形;约 114.8 × 177.8 × 323.5 mm |
|
||||
|
||||
所有尺寸为本地 Blender 包围盒测量值,包含手柄、抽屉、支架或散落零件,不代表厂商标称机身尺寸。前 5 套及新增的 08–11 套未检测到缺失图片或链接库;第 6 套的原始贴图保留在 `MAPS/` 中,第 7 套的贴图已内嵌。
|
||||
|
||||
## 文件约定
|
||||
|
||||
每套目录包含:
|
||||
|
||||
- 原始 `.blend`、`.glb` 或 `.fbx` 模型;01–05 已将原来的纯 Python Console 界面改为 3D 材质预览视图,未修改几何或材质。
|
||||
- 08–11 额外包含由原始 GLB 转换的 `.blend`:贴图已打包,模型根对象移至地面中心,并对不合理的默认金属度及预览灯光作了修正;原始 GLB 保持不变。
|
||||
- `source_preview.*`:来源页面或压缩包内的彩色预览。
|
||||
- `blender_preview.png`、`blender_opposite.png`:本地 Blender 实际渲染的两个角度。
|
||||
- `inspection.json`:网格、材质、尺寸、图片和链接库检查结果。
|
||||
- `source.json`:作者、来源页面、官方 API 或下载页面及许可摘要。
|
||||
|
||||
第 6 套还包含原始 `LICENSE.txt` 和完整 `MAPS/` 贴图目录。其 FBX 导入后只生成一个中性材质,这是 V-Ray 与 Blender 材质系统不兼容造成的,不是压缩包缺少贴图。第 7 套还包含原始 `LICENSE.txt` 和 `manifest.json`。08–11 套还包含 `warehouse_entity.json`,保存来源接口返回的原始元数据。
|
||||
|
||||
## 授权说明
|
||||
|
||||
### CC0
|
||||
|
||||
`manual/01_freepoly_coffee_grinder_cc0` 和 `electric/07_grab3d_electric_coffee_grinder_cc0` 均明确采用 CC0。CC0 允许使用、修改和再分发,不强制署名,但仍建议保留作者与来源。
|
||||
|
||||
- CC0 1.0:https://creativecommons.org/publicdomain/zero/1.0/
|
||||
- 第 01 套来源 API:https://www.blenderkit.com/api/v1/assets/3f7319a1-cb04-422f-8369-7ca717a0c0a4/
|
||||
- 第 07 套来源与许可:https://grab3d.com/models/food/coffee-grinder/ 、https://grab3d.com/license/
|
||||
- 第 07 套的 `manifest.json` 声明:模型由 Blender 脚本程序化生成,脚本有 AI 辅助,几何和贴图并非由生成式 AI 直接生成。
|
||||
|
||||
### BlenderKit Royalty Free
|
||||
|
||||
第 02–05 套的来源元数据标记为 `royalty_free`。根据 BlenderKit / Blendkit 许可说明,这类模型可用于个人及商业项目,无须署名,但**不允许将原模型或修改后的模型作为模型资产、资产包或场景商品再次销售或分发**。
|
||||
|
||||
- 许可说明:https://www.blendkit.com/docs/licenses
|
||||
- 许可 FAQ:https://www.blendkit.com/docs/licenses/licensing-faq
|
||||
- 各模型的官方 API 来源和下载端点见对应目录的 `source.json`。
|
||||
|
||||
### RVDESIGN 自定义许可
|
||||
|
||||
`manual/06_radetzki_vintage_grinder_personal` 以压缩包内的 `LICENSE.txt` 为准:
|
||||
|
||||
- 仅允许个人非商业使用。
|
||||
- 商业使用必须事先取得 Vladimir Radetzki 的书面许可。
|
||||
- 未经作者同意,禁止转售、再分发或发布到第三方平台及公共渠道。
|
||||
|
||||
因此,这套模型只应作为本地研究和临摹参考,不应放入公开模型库、公开仓库或作为游戏可提取资产发布。
|
||||
|
||||
来源:
|
||||
|
||||
- https://rvdesign.by/free-3d-models/vintazhnaya-kofemolka/
|
||||
- https://drive.google.com/file/d/1559RiyooOUztb469VyBXDkpQCKQ2KCih/view?usp=sharing
|
||||
|
||||
### 3D Warehouse 通用模型许可
|
||||
|
||||
第 08–11 套使用 **3D Warehouse General Model License**,并非 CC0 或开源许可。根据官方条款与 FAQ:
|
||||
|
||||
- 可将模型用于包含其他内容的 Combined Work,也可用于有偿设计交付。
|
||||
- 不得把模型作为独立物品转让或销售,不得进行未经许可的模型聚合或模型库分发。
|
||||
- 家电模型的商标和标志应保留,不得移除或修改。
|
||||
- 官方 FAQ 明确说明,将模型纳入公开发布的研究项目属于需要各开发者另行批准的聚合行为。
|
||||
|
||||
因此,08–11 套及其转换文件仅作为本地研究和临摹参考,**不要公开发布这些原始 GLB、转换后的 `.blend` 或整套参考目录**。各模型的作者、来源页面和公开下载地址见对应 `source.json`。
|
||||
|
||||
- 使用条款:https://3dwarehouse.sketchup.com/tos
|
||||
- 官方许可 FAQ:https://help.sketchup.com/en/3d-warehouse/3d-warehouse-terms-use-faq
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
|
||||
|
||||
To the extent possible under law, Grab3D has waived all copyright and related or neighboring rights to the
|
||||
3D models, textures and images in this package. This work is published from: Germany.
|
||||
|
||||
https://creativecommons.org/publicdomain/zero/1.0/legalcode
|
||||
|
||||
Origin / AI disclosure
|
||||
----------------------
|
||||
Method: procedural (no AI-generated geometry or textures, AI-assisted code)
|
||||
Built procedurally with Blender scripts. The scripts were written with the help of an AI coding assistant. No
|
||||
generative AI model produced the geometry or textures directly.
|
||||
If your platform asks whether AI was used in the creation process, note that the generator scripts were
|
||||
written with an AI coding assistant.
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+238
@@ -0,0 +1,238 @@
|
||||
{
|
||||
"source": "/Users/yanchenyu/Documents/WebApps/PerfetCoffee/model_assets/reference/bean_grinder/.electric_candidates/coffee-grinder.glb",
|
||||
"blender_version": "5.2.0 LTS",
|
||||
"screens": [
|
||||
[
|
||||
"Animation",
|
||||
[
|
||||
"PROPERTIES",
|
||||
"OUTLINER",
|
||||
"VIEW_3D",
|
||||
"DOPESHEET_EDITOR",
|
||||
"VIEW_3D"
|
||||
]
|
||||
],
|
||||
[
|
||||
"Compositing",
|
||||
[
|
||||
"PROPERTIES",
|
||||
"IMAGE_EDITOR",
|
||||
"DOPESHEET_EDITOR",
|
||||
"NODE_EDITOR"
|
||||
]
|
||||
],
|
||||
[
|
||||
"Geometry Nodes",
|
||||
[
|
||||
"PROPERTIES",
|
||||
"NODE_EDITOR",
|
||||
"VIEW_3D",
|
||||
"SPREADSHEET",
|
||||
"OUTLINER",
|
||||
"DOPESHEET_EDITOR"
|
||||
]
|
||||
],
|
||||
[
|
||||
"Layout",
|
||||
[
|
||||
"PROPERTIES",
|
||||
"OUTLINER",
|
||||
"DOPESHEET_EDITOR",
|
||||
"VIEW_3D"
|
||||
]
|
||||
],
|
||||
[
|
||||
"Modeling",
|
||||
[
|
||||
"PROPERTIES",
|
||||
"OUTLINER",
|
||||
"VIEW_3D"
|
||||
]
|
||||
],
|
||||
[
|
||||
"Rendering",
|
||||
[
|
||||
"PROPERTIES",
|
||||
"DOPESHEET_EDITOR",
|
||||
"IMAGE_EDITOR"
|
||||
]
|
||||
],
|
||||
[
|
||||
"Scripting",
|
||||
[
|
||||
"PROPERTIES",
|
||||
"OUTLINER",
|
||||
"INFO",
|
||||
"OUTLINER",
|
||||
"TEXT_EDITOR",
|
||||
"VIEW_3D",
|
||||
"CONSOLE"
|
||||
]
|
||||
],
|
||||
[
|
||||
"Sculpting",
|
||||
[
|
||||
"PROPERTIES",
|
||||
"OUTLINER",
|
||||
"VIEW_3D"
|
||||
]
|
||||
],
|
||||
[
|
||||
"Shading",
|
||||
[
|
||||
"PROPERTIES",
|
||||
"OUTLINER",
|
||||
"IMAGE_EDITOR",
|
||||
"NODE_EDITOR",
|
||||
"FILE_BROWSER",
|
||||
"VIEW_3D"
|
||||
]
|
||||
],
|
||||
[
|
||||
"Texture Paint",
|
||||
[
|
||||
"PROPERTIES",
|
||||
"OUTLINER",
|
||||
"IMAGE_EDITOR",
|
||||
"VIEW_3D"
|
||||
]
|
||||
],
|
||||
[
|
||||
"UV Editing",
|
||||
[
|
||||
"PROPERTIES",
|
||||
"OUTLINER",
|
||||
"IMAGE_EDITOR",
|
||||
"VIEW_3D"
|
||||
]
|
||||
]
|
||||
],
|
||||
"mesh_objects": 5,
|
||||
"vertices": 15111,
|
||||
"polygons": 20804,
|
||||
"dimensions": [
|
||||
0.11999999731779099,
|
||||
0.18731001019477844,
|
||||
0.3728218078613281
|
||||
],
|
||||
"bounds_min": [
|
||||
-0.05999999865889549,
|
||||
-0.09365500509738922,
|
||||
0.0
|
||||
],
|
||||
"bounds_max": [
|
||||
0.05999999865889549,
|
||||
0.09365500509738922,
|
||||
0.3728218078613281
|
||||
],
|
||||
"objects": [
|
||||
{
|
||||
"name": "coffee-grinder_body",
|
||||
"vertices": 8379,
|
||||
"polygons": 10552,
|
||||
"dimensions": [
|
||||
0.11999999731779099,
|
||||
0.18700000643730164,
|
||||
0.3177372217178345
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "coffee-grinder_catcher",
|
||||
"vertices": 1199,
|
||||
"polygons": 1732,
|
||||
"dimensions": [
|
||||
0.06599976122379303,
|
||||
0.07004991173744202,
|
||||
0.04993381351232529
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "coffee-grinder_catcher_glass",
|
||||
"vertices": 1124,
|
||||
"polygons": 1632,
|
||||
"dimensions": [
|
||||
0.0689999982714653,
|
||||
0.05381999909877777,
|
||||
0.05858337879180908
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "coffee-grinder_hopper_glass",
|
||||
"vertices": 1369,
|
||||
"polygons": 2016,
|
||||
"dimensions": [
|
||||
0.10899999737739563,
|
||||
0.10899999737739563,
|
||||
0.10272184014320374
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "coffee-grinder_lid",
|
||||
"vertices": 3040,
|
||||
"polygons": 4872,
|
||||
"dimensions": [
|
||||
0.11570926010608673,
|
||||
0.11570926010608673,
|
||||
0.03949996829032898
|
||||
]
|
||||
}
|
||||
],
|
||||
"images": [
|
||||
{
|
||||
"name": "coffee-grinder_body_basecolor",
|
||||
"packed": true,
|
||||
"path": "",
|
||||
"available": true
|
||||
},
|
||||
{
|
||||
"name": "coffee-grinder_body_metallic-coffee-grinder_body_roughness",
|
||||
"packed": true,
|
||||
"path": "",
|
||||
"available": true
|
||||
},
|
||||
{
|
||||
"name": "coffee-grinder_body_normal",
|
||||
"packed": true,
|
||||
"path": "",
|
||||
"available": true
|
||||
},
|
||||
{
|
||||
"name": "coffee-grinder_catcher_basecolor",
|
||||
"packed": true,
|
||||
"path": "",
|
||||
"available": true
|
||||
},
|
||||
{
|
||||
"name": "coffee-grinder_catcher_metallic-coffee-grinder_catcher_roughness",
|
||||
"packed": true,
|
||||
"path": "",
|
||||
"available": true
|
||||
},
|
||||
{
|
||||
"name": "coffee-grinder_catcher_normal",
|
||||
"packed": true,
|
||||
"path": "",
|
||||
"available": true
|
||||
},
|
||||
{
|
||||
"name": "coffee-grinder_lid_basecolor",
|
||||
"packed": true,
|
||||
"path": "",
|
||||
"available": true
|
||||
},
|
||||
{
|
||||
"name": "coffee-grinder_lid_metallic-coffee-grinder_lid_roughness",
|
||||
"packed": true,
|
||||
"path": "",
|
||||
"available": true
|
||||
},
|
||||
{
|
||||
"name": "coffee-grinder_lid_normal",
|
||||
"packed": true,
|
||||
"path": "",
|
||||
"available": true
|
||||
}
|
||||
],
|
||||
"missing_images": [],
|
||||
"linked_libraries": []
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"slug": "coffee-grinder",
|
||||
"triangles": 20804,
|
||||
"texture_px": 2048,
|
||||
"triangles_light": 13092,
|
||||
"texture_px_light": 1024,
|
||||
"files": {
|
||||
"glb": {
|
||||
"name": "coffee-grinder.glb",
|
||||
"bytes": 1795896
|
||||
},
|
||||
"blend": {
|
||||
"name": "coffee-grinder.blend",
|
||||
"bytes": 1470630
|
||||
},
|
||||
"fbx": {
|
||||
"name": "coffee-grinder.fbx",
|
||||
"bytes": 2888764
|
||||
},
|
||||
"obj": {
|
||||
"name": "coffee-grinder-obj.zip",
|
||||
"bytes": 1438118
|
||||
},
|
||||
"usdz": {
|
||||
"name": "coffee-grinder.usdz",
|
||||
"bytes": 2672681
|
||||
},
|
||||
"glb_light": {
|
||||
"name": "coffee-grinder-light.glb",
|
||||
"bytes": 668624
|
||||
},
|
||||
"fbx_light": {
|
||||
"name": "coffee-grinder-light.fbx",
|
||||
"bytes": 1382876
|
||||
}
|
||||
},
|
||||
"extras": {
|
||||
"license": "CC0-1.0",
|
||||
"source": "grab3d.com",
|
||||
"dimensions_m": "0.120 x 0.187 x 0.373",
|
||||
"triangles": 20804,
|
||||
"textures": "PBR 2048px: base color, roughness, metallic, normal (baked)",
|
||||
"generator": "Created by grab3d",
|
||||
"created": "2026-10-26",
|
||||
"real_size": "electric burr coffee grinder, 12 x 17 x 35 cm",
|
||||
"notes": "softly rounded light blue C-shaped housing (base plate, column, overhanging head) on four rubber feet, cream collar with a clear bean hopper (not baked) full of coffee beans (bean fill plus single beans lying on top) and a cream grinder lid with a wooden knob. Grind size dial with tick marks (no digits) and a pink start button at the front, dark chute under the head, clear grounds container with ground coffee and a cream handle. Movable groups: 'coffee-grinder_lid' (lid and knob, origin at the centre of the rim seat, lift along +Z) and 'coffee-grinder_catcher' (container, grounds and handle, origin at the centre of its base, pulls out along -Y), no text",
|
||||
"set": "Cozy Kitchen Utensils Kit"
|
||||
},
|
||||
"origin": {
|
||||
"method": "procedural",
|
||||
"detail": "Built procedurally with Blender scripts. The scripts were written with the help of an AI coding assistant. No generative AI model produced the geometry or textures directly.",
|
||||
"ai_content": false,
|
||||
"ai_assisted_code": true
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "Coffee Grinder",
|
||||
"author": "Grab3D",
|
||||
"source_page": "https://grab3d.com/models/food/coffee-grinder/",
|
||||
"blend_download": "https://grab3d.com/dl/coffee-grinder/coffee-grinder.blend",
|
||||
"glb_download": "https://grab3d.com/dl/coffee-grinder/coffee-grinder.glb",
|
||||
"license": "CC0 1.0 Universal",
|
||||
"license_page": "https://grab3d.com/license/",
|
||||
"published": "2026-10-26",
|
||||
"kit": "Cozy Kitchen Utensils Kit",
|
||||
"type": "Home electric burr coffee grinder with hopper and grounds catcher",
|
||||
"dimensions_m": [0.12, 0.18731001019477844, 0.3728218078613281],
|
||||
"mesh_objects": 5,
|
||||
"triangles": 20804,
|
||||
"moving_parts": [
|
||||
"coffee-grinder_lid",
|
||||
"coffee-grinder_catcher"
|
||||
],
|
||||
"origin": "Procedurally built with Blender scripts; AI-assisted code, no AI-generated geometry or textures",
|
||||
"verification": "Blend reopened and GLB imported successfully in Blender 5.2.0 LTS; no missing images or linked libraries"
|
||||
}
|
||||
BIN
Binary file not shown.
LFS
BIN
Binary file not shown.
LFS
BIN
Binary file not shown.
LFS
BIN
Binary file not shown.
LFS
BIN
Binary file not shown.
+99
@@ -0,0 +1,99 @@
|
||||
{
|
||||
"source_file": "BaratzaEncore.glb",
|
||||
"blender_file": "BaratzaEncore.blend",
|
||||
"blender_version": "5.2.0 LTS",
|
||||
"mesh_objects": 4,
|
||||
"vertices": 2549,
|
||||
"polygons": 2386,
|
||||
"bounds_min": [
|
||||
-0.07001273334026337,
|
||||
-0.09071781486272812,
|
||||
1.7763568394002505e-15
|
||||
],
|
||||
"bounds_max": [
|
||||
0.07001274824142456,
|
||||
0.09071779996156693,
|
||||
0.3429000675678253
|
||||
],
|
||||
"dimensions": [
|
||||
0.14002548158168793,
|
||||
0.18143561482429504,
|
||||
0.3429000675678253
|
||||
],
|
||||
"objects": [
|
||||
{
|
||||
"name": "Mesh_0",
|
||||
"vertices": 112,
|
||||
"polygons": 92,
|
||||
"dimensions": [
|
||||
0.08254999667406082,
|
||||
0.009525001049041748,
|
||||
0.08255001157522202
|
||||
],
|
||||
"materials": [
|
||||
"*1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Mesh_1",
|
||||
"vertices": 1874,
|
||||
"polygons": 1694,
|
||||
"dimensions": [
|
||||
0.11429999768733978,
|
||||
0.2305774986743927,
|
||||
0.18143558502197266
|
||||
],
|
||||
"materials": [
|
||||
"*1",
|
||||
"Translucent_Glass_Corrugated"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Mesh_2",
|
||||
"vertices": 60,
|
||||
"polygons": 48,
|
||||
"dimensions": [
|
||||
0.13967455923557281,
|
||||
0.09899982810020447,
|
||||
0.1396745890378952
|
||||
],
|
||||
"materials": [
|
||||
"Translucent_Glass_Gray"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Mesh_3",
|
||||
"vertices": 503,
|
||||
"polygons": 552,
|
||||
"dimensions": [
|
||||
0.14002548158168793,
|
||||
0.012700001709163189,
|
||||
0.14002549648284912
|
||||
],
|
||||
"materials": [
|
||||
"Translucent_Glass_Gray"
|
||||
]
|
||||
}
|
||||
],
|
||||
"images": [
|
||||
{
|
||||
"name": "Image_0",
|
||||
"source": "FILE",
|
||||
"packed": true,
|
||||
"available": true,
|
||||
"size": [
|
||||
128,
|
||||
128
|
||||
]
|
||||
}
|
||||
],
|
||||
"missing_images": [],
|
||||
"linked_libraries": [],
|
||||
"active_screen": "Layout",
|
||||
"active_areas": [
|
||||
"PROPERTIES",
|
||||
"OUTLINER",
|
||||
"DOPESHEET_EDITOR",
|
||||
"VIEW_3D"
|
||||
]
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "Coffee grinder (Baratza Encore)",
|
||||
"author": "Edward F.",
|
||||
"source": "3D Warehouse",
|
||||
"entity_id": "ua5abb5f3-2e40-4d43-861e-fdc32079757e",
|
||||
"source_page": "https://3dwarehouse.sketchup.com/model/ua5abb5f3-2e40-4d43-861e-fdc32079757e/Coffee-grinder",
|
||||
"api_url": "https://3dwarehouse.sketchup.com/warehouse/v1.0/entities/ua5abb5f3-2e40-4d43-861e-fdc32079757e",
|
||||
"download_url": "https://download-warehouse.sketchup.com/warehouse/v1.0/content/public/5ba23dbe-fca1-4386-8157-e3b4a1572c19",
|
||||
"source_format": "GLB",
|
||||
"source_file": "BaratzaEncore.glb",
|
||||
"source_file_size": 87964,
|
||||
"license": "3D Warehouse General Model License; not CC0 or an open-source license",
|
||||
"license_url": "https://3dwarehouse.sketchup.com/tos",
|
||||
"license_faq": "https://help.sketchup.com/en/3d-warehouse/3d-warehouse-terms-use-faq",
|
||||
"usage_note": "可在 Combined Work 中使用,但不得将原模型或轻微修改版本作为独立模型、模型库或研究资料包再分发。保留作者信息、商标和标志;本目录仅用于本地研究与临摹。",
|
||||
"conversion": "BaratzaEncore.blend 由原始 GLB 在 Blender 5.2.0 LTS 中导入生成,贴图已打包,模型根对象移至地面中心;对默认金属度和预览灯光做了修正;原始 GLB 保留。"
|
||||
}
|
||||
LFS
BIN
Binary file not shown.
+1
File diff suppressed because one or more lines are too long
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+319
@@ -0,0 +1,319 @@
|
||||
{
|
||||
"source_file": "MazzerMiniElectronic.glb",
|
||||
"blender_file": "MazzerMiniElectronic.blend",
|
||||
"blender_version": "5.2.0 LTS",
|
||||
"mesh_objects": 22,
|
||||
"vertices": 17514,
|
||||
"polygons": 9010,
|
||||
"bounds_min": [
|
||||
-0.1637597680091858,
|
||||
-0.11317738890647888,
|
||||
9.801803813047627e-10
|
||||
],
|
||||
"bounds_max": [
|
||||
0.1637597531080246,
|
||||
0.11317738145589828,
|
||||
0.5267032980918884
|
||||
],
|
||||
"dimensions": [
|
||||
0.3275195360183716,
|
||||
0.22635477781295776,
|
||||
0.5267032980918884
|
||||
],
|
||||
"objects": [
|
||||
{
|
||||
"name": "Geom3D",
|
||||
"vertices": 24,
|
||||
"polygons": 12,
|
||||
"dimensions": [
|
||||
0.0478999949991703,
|
||||
0.043107375502586365,
|
||||
0.05616452544927597
|
||||
],
|
||||
"materials": [
|
||||
"Grey"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.001",
|
||||
"vertices": 2336,
|
||||
"polygons": 1158,
|
||||
"dimensions": [
|
||||
0.13487231731414795,
|
||||
0.13487233221530914,
|
||||
0.15608036518096924
|
||||
],
|
||||
"materials": [
|
||||
"Steel Polished"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.002",
|
||||
"vertices": 2116,
|
||||
"polygons": 1076,
|
||||
"dimensions": [
|
||||
0.13487231731414795,
|
||||
0.13487233221530914,
|
||||
0.006938155274838209
|
||||
],
|
||||
"materials": [
|
||||
"[0135_DarkGray]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.003",
|
||||
"vertices": 372,
|
||||
"polygons": 210,
|
||||
"dimensions": [
|
||||
0.04905218258500099,
|
||||
0.06959615647792816,
|
||||
0.0006996482843533158
|
||||
],
|
||||
"materials": [
|
||||
"[0133_Gray]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.004",
|
||||
"vertices": 696,
|
||||
"polygons": 358,
|
||||
"dimensions": [
|
||||
0.1725102812051773,
|
||||
0.12284203618764877,
|
||||
0.1725102961063385
|
||||
],
|
||||
"materials": [
|
||||
"Plastic"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_",
|
||||
"vertices": 24,
|
||||
"polygons": 22,
|
||||
"dimensions": [
|
||||
0.15281891822814941,
|
||||
0.0,
|
||||
0.1528189331293106
|
||||
],
|
||||
"materials": []
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.005",
|
||||
"vertices": 1349,
|
||||
"polygons": 626,
|
||||
"dimensions": [
|
||||
0.16993401944637299,
|
||||
0.05420165881514549,
|
||||
0.17321625351905823
|
||||
],
|
||||
"materials": [
|
||||
"[0135_DarkGray]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.007",
|
||||
"vertices": 3015,
|
||||
"polygons": 1376,
|
||||
"dimensions": [
|
||||
0.18862995505332947,
|
||||
0.31829869747161865,
|
||||
0.08095019310712814
|
||||
],
|
||||
"materials": [
|
||||
"Grey"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.008",
|
||||
"vertices": 148,
|
||||
"polygons": 88,
|
||||
"dimensions": [
|
||||
0.17060105502605438,
|
||||
0.004460840951651335,
|
||||
0.012298340909183025
|
||||
],
|
||||
"materials": [
|
||||
"[0134_DimGray]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.009",
|
||||
"vertices": 100,
|
||||
"polygons": 48,
|
||||
"dimensions": [
|
||||
0.17060105502605438,
|
||||
0.006659321021288633,
|
||||
0.012298340909183025
|
||||
],
|
||||
"materials": [
|
||||
"Steel Polished"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.010",
|
||||
"vertices": 135,
|
||||
"polygons": 77,
|
||||
"dimensions": [
|
||||
0.18862995505332947,
|
||||
0.31829869747161865,
|
||||
0.06706587970256805
|
||||
],
|
||||
"materials": [
|
||||
"Grey"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.011",
|
||||
"vertices": 3015,
|
||||
"polygons": 1376,
|
||||
"dimensions": [
|
||||
0.18862995505332947,
|
||||
0.31829869747161865,
|
||||
0.08095019310712814
|
||||
],
|
||||
"materials": [
|
||||
"Grey"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.012",
|
||||
"vertices": 148,
|
||||
"polygons": 88,
|
||||
"dimensions": [
|
||||
0.17060105502605438,
|
||||
0.004460840951651335,
|
||||
0.012298340909183025
|
||||
],
|
||||
"materials": [
|
||||
"[0134_DimGray]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.013",
|
||||
"vertices": 100,
|
||||
"polygons": 48,
|
||||
"dimensions": [
|
||||
0.17060105502605438,
|
||||
0.006659321021288633,
|
||||
0.012298340909183025
|
||||
],
|
||||
"materials": [
|
||||
"Steel Polished"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.014",
|
||||
"vertices": 160,
|
||||
"polygons": 100,
|
||||
"dimensions": [
|
||||
0.05217872932553291,
|
||||
0.022584373131394386,
|
||||
0.011885624378919601
|
||||
],
|
||||
"materials": [
|
||||
"[0135_DarkGray]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.015",
|
||||
"vertices": 1790,
|
||||
"polygons": 1156,
|
||||
"dimensions": [
|
||||
0.15482357144355774,
|
||||
0.06593499332666397,
|
||||
0.05839381739497185
|
||||
],
|
||||
"materials": [
|
||||
"Steel Polished"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.016",
|
||||
"vertices": 1359,
|
||||
"polygons": 845,
|
||||
"dimensions": [
|
||||
0.08969008922576904,
|
||||
0.013402936980128288,
|
||||
0.08969009667634964
|
||||
],
|
||||
"materials": [
|
||||
"Steel Polished"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.017",
|
||||
"vertices": 129,
|
||||
"polygons": 73,
|
||||
"dimensions": [
|
||||
0.056037914007902145,
|
||||
0.018207764253020287,
|
||||
0.05603792518377304
|
||||
],
|
||||
"materials": [
|
||||
"[0135_DarkGray]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.018",
|
||||
"vertices": 19,
|
||||
"polygons": 11,
|
||||
"dimensions": [
|
||||
0.015426903031766415,
|
||||
0.0031189227011054754,
|
||||
0.023063167929649353
|
||||
],
|
||||
"materials": [
|
||||
"Steel Polished"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.019",
|
||||
"vertices": 91,
|
||||
"polygons": 50,
|
||||
"dimensions": [
|
||||
0.045957744121551514,
|
||||
0.005479188170284033,
|
||||
0.023063167929649353
|
||||
],
|
||||
"materials": [
|
||||
"[0135_DarkGray]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.020",
|
||||
"vertices": 358,
|
||||
"polygons": 196,
|
||||
"dimensions": [
|
||||
0.08496363461017609,
|
||||
0.0015173139981925488,
|
||||
0.08490774035453796
|
||||
],
|
||||
"materials": [
|
||||
"Steel Polished"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D.021",
|
||||
"vertices": 30,
|
||||
"polygons": 16,
|
||||
"dimensions": [
|
||||
0.0037760662380605936,
|
||||
0.11543028056621552,
|
||||
0.11687370389699936
|
||||
],
|
||||
"materials": [
|
||||
"Steel Polished"
|
||||
]
|
||||
}
|
||||
],
|
||||
"images": [],
|
||||
"missing_images": [],
|
||||
"linked_libraries": [],
|
||||
"active_screen": "Layout",
|
||||
"active_areas": [
|
||||
"PROPERTIES",
|
||||
"OUTLINER",
|
||||
"DOPESHEET_EDITOR",
|
||||
"VIEW_3D"
|
||||
]
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "Coffee Grinder Mazzer Mini Electronic",
|
||||
"author": "Sam C.",
|
||||
"source": "3D Warehouse",
|
||||
"entity_id": "2fd61a43-d173-4fb1-90bd-f8e225937419",
|
||||
"source_page": "https://3dwarehouse.sketchup.com/model/2fd61a43-d173-4fb1-90bd-f8e225937419/Coffee-Grinder-Mazzer-Mini-Electronic",
|
||||
"api_url": "https://3dwarehouse.sketchup.com/warehouse/v1.0/entities/2fd61a43-d173-4fb1-90bd-f8e225937419",
|
||||
"download_url": "https://download-warehouse.sketchup.com/warehouse/v1.0/content/public/1d8f69ab-7629-447f-9162-78f8379b6165",
|
||||
"source_format": "GLB",
|
||||
"source_file": "MazzerMiniElectronic.glb",
|
||||
"source_file_size": 514444,
|
||||
"license": "3D Warehouse General Model License; not CC0 or an open-source license",
|
||||
"license_url": "https://3dwarehouse.sketchup.com/tos",
|
||||
"license_faq": "https://help.sketchup.com/en/3d-warehouse/3d-warehouse-terms-use-faq",
|
||||
"usage_note": "可在 Combined Work 中使用,但不得将原模型或轻微修改版本作为独立模型、模型库或研究资料包再分发。保留作者信息、商标和标志;本目录仅用于本地研究与临摹。",
|
||||
"conversion": "MazzerMiniElectronic.blend 由原始 GLB 在 Blender 5.2.0 LTS 中导入生成,贴图已打包,模型根对象移至地面中心;对默认金属度和预览灯光做了修正;原始 GLB 保留。"
|
||||
}
|
||||
BIN
Binary file not shown.
+1
File diff suppressed because one or more lines are too long
BIN
Binary file not shown.
BIN
Binary file not shown.
LFS
BIN
Binary file not shown.
LFS
BIN
Binary file not shown.
+308
@@ -0,0 +1,308 @@
|
||||
{
|
||||
"source_file": "KalitaNextG.glb",
|
||||
"blender_file": "KalitaNextG.blend",
|
||||
"blender_version": "5.2.0 LTS",
|
||||
"mesh_objects": 21,
|
||||
"vertices": 13619,
|
||||
"polygons": 5625,
|
||||
"bounds_min": [
|
||||
-0.06150001287460327,
|
||||
-0.10750001668930054,
|
||||
1.7763568394002505e-15
|
||||
],
|
||||
"bounds_max": [
|
||||
0.06149999797344208,
|
||||
0.10750006139278412,
|
||||
0.40100008249282837
|
||||
],
|
||||
"dimensions": [
|
||||
0.12300001084804535,
|
||||
0.21500007808208466,
|
||||
0.40100008249282837
|
||||
],
|
||||
"objects": [
|
||||
{
|
||||
"name": "Geom3D_",
|
||||
"vertices": 148,
|
||||
"polygons": 92,
|
||||
"dimensions": [
|
||||
0.02987534925341606,
|
||||
0.02987535111606121,
|
||||
0.010000000707805157
|
||||
],
|
||||
"materials": [
|
||||
"材料14"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_.001",
|
||||
"vertices": 148,
|
||||
"polygons": 92,
|
||||
"dimensions": [
|
||||
0.010000000707805157,
|
||||
0.010000000707805157,
|
||||
0.020000001415610313
|
||||
],
|
||||
"materials": [
|
||||
"材料14"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_.002",
|
||||
"vertices": 148,
|
||||
"polygons": 92,
|
||||
"dimensions": [
|
||||
0.009966944344341755,
|
||||
0.00996694527566433,
|
||||
0.0020000003278255463
|
||||
],
|
||||
"materials": [
|
||||
"材料14"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_.003",
|
||||
"vertices": 148,
|
||||
"polygons": 92,
|
||||
"dimensions": [
|
||||
0.00799576472491026,
|
||||
0.007995765656232834,
|
||||
0.0010000001639127731
|
||||
],
|
||||
"materials": [
|
||||
"材料14"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_.004",
|
||||
"vertices": 244,
|
||||
"polygons": 156,
|
||||
"dimensions": [
|
||||
0.09521041810512543,
|
||||
0.09521042555570602,
|
||||
0.05800000578165054
|
||||
],
|
||||
"materials": [
|
||||
"材料14"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_.005",
|
||||
"vertices": 244,
|
||||
"polygons": 156,
|
||||
"dimensions": [
|
||||
0.09521041810512543,
|
||||
0.09521042555570602,
|
||||
0.046000007539987564
|
||||
],
|
||||
"materials": [
|
||||
"材料14"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_.006",
|
||||
"vertices": 244,
|
||||
"polygons": 156,
|
||||
"dimensions": [
|
||||
0.09521041810512543,
|
||||
0.09521042555570602,
|
||||
0.002999998861923814
|
||||
],
|
||||
"materials": [
|
||||
"材料14"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_.007",
|
||||
"vertices": 244,
|
||||
"polygons": 156,
|
||||
"dimensions": [
|
||||
0.09521041810512543,
|
||||
0.09521042555570602,
|
||||
0.06800000369548798
|
||||
],
|
||||
"materials": [
|
||||
"材料14"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_.008",
|
||||
"vertices": 244,
|
||||
"polygons": 156,
|
||||
"dimensions": [
|
||||
0.09521041810512543,
|
||||
0.09521042555570602,
|
||||
0.002999998861923814
|
||||
],
|
||||
"materials": [
|
||||
"材料14"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D",
|
||||
"vertices": 819,
|
||||
"polygons": 329,
|
||||
"dimensions": [
|
||||
0.08436838537454605,
|
||||
0.08483311533927917,
|
||||
0.03700000420212746
|
||||
],
|
||||
"materials": [
|
||||
"材料14"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_.009",
|
||||
"vertices": 148,
|
||||
"polygons": 92,
|
||||
"dimensions": [
|
||||
0.010000000707805157,
|
||||
0.010000000707805157,
|
||||
0.020000001415610313
|
||||
],
|
||||
"materials": [
|
||||
"材料14"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_.010",
|
||||
"vertices": 148,
|
||||
"polygons": 92,
|
||||
"dimensions": [
|
||||
0.009966944344341755,
|
||||
0.00996694527566433,
|
||||
0.0020000003278255463
|
||||
],
|
||||
"materials": [
|
||||
"材料14"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_.011",
|
||||
"vertices": 148,
|
||||
"polygons": 92,
|
||||
"dimensions": [
|
||||
0.00799576472491026,
|
||||
0.007995765656232834,
|
||||
0.0010000001639127731
|
||||
],
|
||||
"materials": [
|
||||
"材料14"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_.012",
|
||||
"vertices": 148,
|
||||
"polygons": 92,
|
||||
"dimensions": [
|
||||
0.010000000707805157,
|
||||
0.010000000707805157,
|
||||
0.010000000707805157
|
||||
],
|
||||
"materials": [
|
||||
"材料14"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_.013",
|
||||
"vertices": 182,
|
||||
"polygons": 116,
|
||||
"dimensions": [
|
||||
0.12300001084804535,
|
||||
0.030000004917383194,
|
||||
0.21500003337860107
|
||||
],
|
||||
"materials": [
|
||||
"材料14"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_.014",
|
||||
"vertices": 510,
|
||||
"polygons": 332,
|
||||
"dimensions": [
|
||||
0.12300001084804535,
|
||||
0.011000001803040504,
|
||||
0.09000001102685928
|
||||
],
|
||||
"materials": [
|
||||
"材料14"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_.015",
|
||||
"vertices": 172,
|
||||
"polygons": 108,
|
||||
"dimensions": [
|
||||
0.09300000220537186,
|
||||
0.1300000101327896,
|
||||
0.10000001639127731
|
||||
],
|
||||
"materials": [
|
||||
"材料14"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_.016",
|
||||
"vertices": 24,
|
||||
"polygons": 12,
|
||||
"dimensions": [
|
||||
0.030000003054738045,
|
||||
0.020000001415610313,
|
||||
0.030000004917383194
|
||||
],
|
||||
"materials": [
|
||||
"材料14"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_.017",
|
||||
"vertices": 7560,
|
||||
"polygons": 2520,
|
||||
"dimensions": [
|
||||
0.0795617550611496,
|
||||
0.015000002458691597,
|
||||
0.08000000566244125
|
||||
],
|
||||
"materials": [
|
||||
"材料12"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_.018",
|
||||
"vertices": 148,
|
||||
"polygons": 92,
|
||||
"dimensions": [
|
||||
0.010000000707805157,
|
||||
0.010000000707805157,
|
||||
0.010000000707805157
|
||||
],
|
||||
"materials": [
|
||||
"材料12"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Geom3D_.019",
|
||||
"vertices": 1800,
|
||||
"polygons": 600,
|
||||
"dimensions": [
|
||||
0.08231262862682343,
|
||||
0.11064339429140091,
|
||||
0.0818617194890976
|
||||
],
|
||||
"materials": [
|
||||
"材料12"
|
||||
]
|
||||
}
|
||||
],
|
||||
"images": [],
|
||||
"missing_images": [],
|
||||
"linked_libraries": [],
|
||||
"active_screen": "Layout",
|
||||
"active_areas": [
|
||||
"PROPERTIES",
|
||||
"OUTLINER",
|
||||
"DOPESHEET_EDITOR",
|
||||
"VIEW_3D"
|
||||
]
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "Kalita NEXT G G2 electric grinder",
|
||||
"author": "小喵 魅.Sylvia",
|
||||
"source": "3D Warehouse",
|
||||
"entity_id": "091e9382-eb34-4486-bd4b-483fd628725a",
|
||||
"source_page": "https://3dwarehouse.sketchup.com/model/091e9382-eb34-4486-bd4b-483fd628725a/Kalita-NEXT-G-G2%E9%9B%BB%E5%8B%95%E7%A3%A8%E8%B1%86%E6%A9%9Felectric-grinder",
|
||||
"api_url": "https://3dwarehouse.sketchup.com/warehouse/v1.0/entities/091e9382-eb34-4486-bd4b-483fd628725a",
|
||||
"download_url": "https://download-warehouse.sketchup.com/warehouse/v1.0/content/public/4a0fb8d0-131e-4985-977a-34d9c90092f1",
|
||||
"source_format": "GLB",
|
||||
"source_file": "KalitaNextG.glb",
|
||||
"source_file_size": 446276,
|
||||
"license": "3D Warehouse General Model License; not CC0 or an open-source license",
|
||||
"license_url": "https://3dwarehouse.sketchup.com/tos",
|
||||
"license_faq": "https://help.sketchup.com/en/3d-warehouse/3d-warehouse-terms-use-faq",
|
||||
"usage_note": "可在 Combined Work 中使用,但不得将原模型或轻微修改版本作为独立模型、模型库或研究资料包再分发。保留作者信息、商标和标志;本目录仅用于本地研究与临摹。",
|
||||
"conversion": "KalitaNextG.blend 由原始 GLB 在 Blender 5.2.0 LTS 中导入生成,贴图已打包,模型根对象移至地面中心;对默认金属度和预览灯光做了修正;原始 GLB 保留。"
|
||||
}
|
||||
LFS
BIN
Binary file not shown.
+1
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user