pytorch3d icon indicating copy to clipboard operation
pytorch3d copied to clipboard

utils: adding plane

Open orgicus opened this issue 2 years ago • 2 comments

Hi,

I'd like contribute a plane utility. It is mostly based mostly on ico_sphere.

(I've followed the Contributing to PyTorch3D guide (signed CLA, ran linter, etc.)).

orgicus avatar Jul 16 '22 21:07 orgicus

For ico_sphere, the level actually affects the shape produced. There is a reason why a higher level than 0 is useful. For this plane, the level doesn't affect the shape at all, just its representation, so I'm not sure why it's worth allowing the user to specify the level at all.

Do you have an application in mind for this utility? Maybe "rectangle" would be a better name than "plane". It is necessary to specify the location of the plane in the docstring and add a test for the new function. Maybe the location should be controllable via an input.

bottler avatar Jul 17 '22 20:07 bottler

@bottler Thank you so much for the feedback.

Regarding the level, I saw that as shorthand for subdividing the plane instead of manually setting up SubdivideMeshes.

When I was going through the PyTorch fit mesh notebook for some target meshes the plane source mesh worked a bit better. I thought other people might find a plane (or a even a cube) useful for similar experiments.

Just to make sure I understood correctly, by location of the plane, do mean the fact that plane's "pivot" is at the centre of the mesh or does that also refer to the plane's orientation (e.g. would handy to add options like align with XY, XZ or YZ planes), etc. ?

Many thanks again, I'll go ahead with the changes based on your suggestions.

orgicus avatar Jul 18 '22 09:07 orgicus

After further consideration I'm retracting this PR.

Should others find it useful they can grab a patch from my branch.

Additionally, a workaround is to use pytorch to load an .obj file which can be a plane / cube / etc.

orgicus avatar Aug 31 '22 13:08 orgicus