Merge branches 'main' and 'main' of http://10.80.10.11/wjsjwr/digital-embryo
This commit is contained in:
commit
801700cd3d
BIN
embryo-backend/Data/CS19.glb
(Stored with Git LFS)
BIN
embryo-backend/Data/CS19.glb
(Stored with Git LFS)
Binary file not shown.
BIN
embryo-backend/Data/CS19.h5ad
(Stored with Git LFS)
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
BIN
embryo-backend/Data/CS19_old.glb
(Stored with Git LFS)
Normal file
Binary file not shown.
42
embryo-backend/Data/CS19repair.py
Normal file
42
embryo-backend/Data/CS19repair.py
Normal 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)
BIN
embryo-backend/Data/CS23.glb
(Stored with Git LFS)
Binary file not shown.
BIN
embryo-backend/Data/CS23.h5ad
(Stored with Git LFS)
BIN
embryo-backend/Data/CS23.h5ad
(Stored with Git LFS)
Binary file not shown.
@ -6,7 +6,7 @@ import anndata as ad
|
|||||||
|
|
||||||
# ==== 参数 ====
|
# ==== 参数 ====
|
||||||
script_dir = os.path.dirname(os.path.realpath(__file__))
|
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
|
N_total = 30000
|
||||||
use_surface_sampling = False
|
use_surface_sampling = False
|
||||||
n_genes = 1000
|
n_genes = 1000
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user