물 분자 전체를 실제 물 영역 안에 포함한 r3 시제품 검증

This commit is contained in:
NINI
2026-10-10 01:30:59 +09:00
parent b1d697e320
commit ee3d18be33
20 changed files with 2165 additions and 43 deletions
@@ -7,7 +7,7 @@ import bpy
from mathutils import Vector
ROOT = Path(__file__).resolve().parents[3]
OUT = ROOT / "projects/water-hydrogen-bond-surface-tension/stages/08-scenes/r2/generated-source/preview.blend"
OUT = ROOT / "projects/water-hydrogen-bond-surface-tension/stages/08-scenes/r3/generated-source/preview.blend"
if OUT.exists():
history=OUT.parent/'history'
history.mkdir(exist_ok=True)
@@ -164,16 +164,17 @@ for frame, x in ((905,1.65),(1018,1.65),(1118,.85),(1220,.85),(1637,.85)):
dash("Pair_HO_Dash_", aa[1], ba[0], [905,1018,1118,1220,1637])
interface = scene("Interface", (2469,3173), (0,-14,6), 13)
# 옆면/뒤쪽의 청색 체적만 보이는 잘라낸 설명 모형. 경계 위 고체 막 없음.
bpy.ops.mesh.primitive_cube_add(size=1, location=(0,1.7,-1.15))
body = bpy.context.object
body.name = 'WaterCutawayBody'
body.scale = (5,1.5,3)
# 실제 물 영역 전체를 표시하되 앞면·윗면을 열어 내부 분자를 보이는 절개 설명 모형.
low, high = (-2.85,-.85,-3.15), (2.85,1.35,.80)
vertices=[(x,y,z) for z in (low[2],high[2]) for y in (low[1],high[1]) for x in (low[0],high[0])]
mesh=bpy.data.meshes.new('WaterCutawayMesh')
mesh.from_pydata(vertices,[],[(0,2,3,1),(2,6,7,3),(0,4,6,2),(1,3,7,5)])
mesh.update()
body=bpy.data.objects.new('WaterCutawayBody',mesh)
interface.collection.objects.link(body)
body.data.materials.append(GHOST)
body['role'] = 'cutaway_water'
bevel=body.modifiers.new('SoftCutawayEdges','BEVEL')
bevel.width=.055
bevel.segments=3
body['role']='cutaway_water'
body['representation']='앞면·윗면이 열린 물 체적의 설명용 절개'
positions = [(-1.8,-.1,.25),(.4,.2,.18),(1.95,.45,.25),(-2,.3,-1.5),(-.65,.15,-1.15),(.9,.3,-1.6),(2,.35,-1.3),(-1.6,.3,-2.5),(.2,.4,-2.45),(1.6,.1,-2.6)]
mols=[]
for i, pos in enumerate(positions):