This commit is contained in:
2023-03-10 17:25:44 +00:00
parent cb76d36c4f
commit 4b1cb0b06d
27 changed files with 1890 additions and 207 deletions
+25 -22
View File
@@ -329,30 +329,33 @@ if __name__ == '__main__':
x = np.concatenate((body, posed), axis=0)
# calcualte the sum of face ares of posed mesh that has faces_garment faces
# face_areas = np.linalg.norm(np.cross((x[faces[:,0],:] - x[faces[:,1],:]), (x[faces[:,0],:] - x[faces[:,2],:])), axis=1)
# m = tm.Trimesh(x, faces, process=False, validate=False, vertex_colors=colors)
# x = posed
# x_1 = unposed.copy()
# x_1[:, 0] = x_1[:, 0] + 0.75
# x_2 = unposed_shaped.copy()
# x_2[:, 0] = x_2[:, 0] + 1.75
# garments = np.concatenate((x, x_1, x_2), axis=0)
# all_faces = np.concatenate((faces_garment, faces_garment + x.shape[0], faces_garment + 2*x.shape[0]), axis=0).astype(np.int32)
# mesh = garments
# faces = all_faces
# fig = go.Figure()
# fig.add_trace(go.Mesh3d(
# x=mesh[:,0],
# y=mesh[:,2],
# z=mesh[:,1],
# i = faces[:,0],
# j = faces[:,1],
# k = faces[:,2],
# text="",
# lighting={ 'ambient':0.8, 'diffuse':0.5, 'roughness':0.5 },
x = posed
x_1 = unposed.copy()
x_1[:, 0] = x_1[:, 0] + 0.75
x_2 = unposed_shaped.copy()
x_2[:, 0] = x_2[:, 0] + 1.75
garments = np.concatenate((x, x_1, x_2), axis=0)
all_faces = np.concatenate((faces_garment, faces_garment + x.shape[0], faces_garment + 2*x.shape[0]), axis=0).astype(np.int32)
mesh = garments
faces = all_faces
fig = go.Figure()
fig.add_trace(go.Mesh3d(
x=mesh[:,0],
y=mesh[:,2],
z=mesh[:,1],
i = faces[:,0],
j = faces[:,1],
k = faces[:,2],
text="",
lighting={ 'ambient':0.8, 'diffuse':0.5, 'roughness':0.5 },
# ),)
# fig.show()
),)
fig.show()
# fig = plot_fixed(x, faces, colors)
@@ -367,7 +370,7 @@ if __name__ == '__main__':
# fig.write_image('examples/' + type + '_' + id_str + '_' + frame_nr + '_unposed_shaped.svg')
# uv_mapping_example(body, F, colors[:14475, :], np.ones((14475), bool))
uv_mapping_example_skirt(body, F, colors[:14475, :], np.ones((14475), bool))
# uv_mapping_example_skirt(body, F, colors[:14475, :], np.ones((14475), bool))
# curvature_example(batch['mesh_curvature'][0].numpy(), uv_curvature, posed, faces_garment, mask)
# plot_upscaling(batch['uv_unposed_32'].numpy()[0], batch['uv_unposed'].numpy()[0], batch['uv_mask_32'].numpy()[0], batch['uv_mask'].numpy()[0], faces_garment, colors_garment, mask)