CS19 REPAIR

This commit is contained in:
Flash 2025-07-27 20:20:20 +08:00
parent bc60273eca
commit 413eb3e49f
7 changed files with 52 additions and 7 deletions

BIN
embryo-backend/Data/CS19.glb (Stored with Git LFS)

Binary file not shown.

BIN
embryo-backend/Data/CS19.h5ad (Stored with Git LFS)

Binary file not shown.

BIN
embryo-backend/Data/CS19_old.glb (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,42 @@
import bpy
import os
import bmesh
import mathutils
# ==== 参数 ====
input_glb = r"C:/Users/lry/Desktop/digital-embryo/embryo-backend/Data/CS19.glb"
output_glb = r"C:/Users/lry/Desktop/digital-embryo/embryo-backend/Data/CS19_fixed.glb"
# ==== 清空场景 ====
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete(use_global=False)
# ==== 导入 GLB ====
print(f"📥 载入 {input_glb}")
bpy.ops.import_scene.gltf(filepath=input_glb)
# ==== 强制应用 matrix_world 到每个顶点 ====
for obj in [o for o in bpy.context.scene.objects if o.type == 'MESH']:
bpy.context.view_layer.objects.active = obj
obj.select_set(True)
# 进入编辑模式
bpy.ops.object.mode_set(mode='EDIT')
bm = bmesh.from_edit_mesh(obj.data)
# 将所有顶点转换到世界坐标
for v in bm.verts:
v.co = obj.matrix_world @ v.co
bmesh.update_edit_mesh(obj.data)
bpy.ops.object.mode_set(mode='OBJECT')
# 重置 transform避免重复应用
obj.matrix_world = mathutils.Matrix.Identity(4)
obj.select_set(False)
# ==== 导出修复版 GLB ====
print(f"💾 导出修复版 → {output_glb}")
bpy.ops.export_scene.gltf(filepath=output_glb, export_format='GLB', export_apply=True)
print("✅ 修复完成!")

BIN
embryo-backend/Data/CS23.glb (Stored with Git LFS)

Binary file not shown.

BIN
embryo-backend/Data/CS23.h5ad (Stored with Git LFS)

Binary file not shown.

View File

@ -6,7 +6,7 @@ import anndata as ad
# ==== 参数 ====
script_dir = os.path.dirname(os.path.realpath(__file__))
glb_files = [f"CS{i}.glb" for i in range(11,24,1)]
glb_files = [f"CS{i}.glb" for i in range(19,20,1)]
N_total = 30000
use_surface_sampling = False
n_genes = 1000