Given a 2D triangle mesh, we could randomly generate cloud points that fill in the triangle mesh.
Or you could use command line arguments:
python disp_mesh.py -i data/socks.txt
We provide three tirangle meshes: bunny, armadillo and christmas socks.
Triangle mesh format
numPoints 100 0.1 0.2 .... numTriangles 200 0 1 2 ....
- Read the triangle mesh with
- Find boundary edges using
- Generate random points
pin the AABB of triangle mesh
- Shoot a ray from
pand count how many time the ray intersects with boundary edges
- If the number of intersections is even, then the point
pis outside the triangle mesh
- Otherwise, the point
pis inside the triangle mesh
pis inside the triangle mesh, we add it into the final cloud points field (