Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Succesful install, but functions not working properly #7

Closed
tverbrug opened this issue Sep 4, 2019 · 2 comments
Closed

Succesful install, but functions not working properly #7

tverbrug opened this issue Sep 4, 2019 · 2 comments

Comments

@tverbrug
Copy link

tverbrug commented Sep 4, 2019

Hello,

I was able to succesfully install your library using the pip method on Ubuntu 18.04. I am able to import the module into python and I can run the test_examples.py script. However, when I look at the results, I see that the sampling functions do not work. Both pcu.sample_mesh_random() and pcu.sample_mesh_poisson_disk() just result in the original vertices and faces. There are no error or warning messages.

Screenshot from 2019-09-04 11-25-58

@fwilliams
Copy link
Owner

Hey, thanks for reporting this!

The issue is that sample_mesh_poisson_disk downsamples a mesh using Poisson Disk sampling. Since you specify 100 times the number of vertices, you're going to get the whole mesh. If you have a mesh, you first need to upsample it. The new version of this library will include an upsample_mesh function which upsamples a mesh using subdivision.

@fwilliams
Copy link
Owner

This is now fixed. sample_mesh_poisson_disk generates Poisson disk samples on the mesh. There's a new parameter to generate a given number of samples, or you can use the radius.

I also fixed the random mesh sampling function sample_mesh_random to properly upsample.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants