mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-15 11:50:35 +08:00
Allow single offset in offset_verts
Summary: It is common when trying things out to want to move a whole mesh or point cloud by the same amount. Here we allow the offset functions to broadcast. Also add a sanity check to join_meshes_as_scene which it is easy to call wrongly. Reviewed By: nikhilaravi Differential Revision: D25980593 fbshipit-source-id: cdf1568e1317e3b81ad94ed4e608ba7eef81290b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d60c52df4a
commit
ddebdfbcd7
@@ -255,7 +255,7 @@
|
||||
"N = verts.shape[0]\n",
|
||||
"center = verts.mean(0)\n",
|
||||
"scale = max((verts - center).abs().max(0)[0])\n",
|
||||
"mesh.offset_verts_(-center.expand(N, 3))\n",
|
||||
"mesh.offset_verts_(-center)\n",
|
||||
"mesh.scale_verts_((1.0 / float(scale)));"
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user