scikit-tda / tadasets

Synthetic data sets apt for Topological Data Analysis
http://tadasets.scikit-tda.org
MIT License
34 stars 7 forks source link

Sampling from a triangulation #3

Open sauln opened 5 years ago

sauln commented 5 years ago

Many people have triangulations of their favorite objects. It could be nice to have a method of taking a triangulation and sampling points on the surface with various levels of noise and density.

ctralie commented 5 years ago

I've actually written some pure numpy and for-loop free code to evenly sample points on a triangle mesh by area:

https://github.com/ctralie/pyhks/blob/a66c317866d984a7a1f37f5c8ab839dec7210739/HKS.py#L249

It's designed for 3D but I'm sure it could be extended to higher dimensions without too much trouble

sauln commented 5 years ago

That's awesome. I'll try to add this now.

sauln commented 5 years ago

Began a port here:

https://github.com/scikit-tda/tadasets/blob/69423d78ae0460bff78a4c886a1e698028750156/tadasets/sample.py#L9-L13