ChrisWu1997 / PQ-NET

code for our CVPR 2020 paper "PQ-NET: A Generative Part Seq2Seq Network for 3D Shapes"
MIT License
116 stars 19 forks source link

How to split chair legs based on connectivity #21

Open qiminchen opened 3 years ago

qiminchen commented 3 years ago

Hi thanks for the great work. I am wondering how you split chair legs based on connectivity? Is it possible for you to provide code for this? Thanks

ChrisWu1997 commented 3 years ago

If you are working on voxels, you can use the function skimage.morphology.lable to find connected components, hence splitting chair legs.

qiminchen commented 3 years ago

thanks for the help, I also noticed from mesh-voxelization that the first step is to scale the raw meshes to lie in [0, H] x [0, W] x [0, D] corresponding to the chosen resolution H x D x W, will this affect the calculation of bounding box of each part in rescale_part_vox.py?

I want to resample the part from PartNet dataset but if I directly voxelize parts of an object, it returns all-zero voxels. If I translate and scale the parts then how should I compute the box parameters? Do the translations and size need to be in the range of (0,64), can they be in the range of (0,1) for custom dataset?

ChrisWu1997 commented 3 years ago

The the calculation of bounding box of each part in rescale_part_vox.py is independent. The function find_bounding_box computes axis-aligned bounding box on any voxel input.

I don't see any difficulties about computing bounding box parameters on meshes or voxels. You simply need to find the max and the min points. Translations and size can be in the range of (0, 1), if you are transforming original meshes.

lyxhope commented 3 years ago

If you are working on voxels, you can use the function skimage.morphology.lable to find connected components, hence splitting chair legs.

May I ask if there are any tools that can implement the split on mesh instead of voxels?

ChrisWu1997 commented 3 years ago

@lyxhope You can try this trimesh api: https://trimsh.org/trimesh.html#trimesh.Trimesh.split.

lyxhope commented 3 years ago

@lyxhope You can try this trimesh api: https://trimsh.org/trimesh.html#trimesh.Trimesh.split.

Thanks for your help. I have a further question. In your paper, you said that your split based on the second layer of partnet. So did you specifically split the chair legs based on connectivity? Or you split all parts based on connectivity?

ChrisWu1997 commented 3 years ago

In your paper, you said that your split based on the second layer of partnet. So did you specifically split the chair legs based on connectivity? Or you split all parts based on connectivity?

We specifically split the chair legs based on connectivity. Other parts are not further split.

lyxhope commented 3 years ago

In your paper, you said that your split based on the second layer of partnet. So did you specifically split the chair legs based on connectivity? Or you split all parts based on connectivity?

We specifically split the chair legs based on connectivity. Other parts are not further split.

Thanks a lot!