Module: tfg.geometry.representation.mesh.sampler
Stay organized with collections
Save and categorize content based on your preferences.
Computes a weighted point sampling of a triangular mesh.
This op computes a uniform sampling of points on the surface of the mesh.
Points are sampled from the surface of each triangle using a uniform
distribution, proportional to a specified face density (e.g. face area).
Uses the approach mentioned in the TOG 2002 paper "Shape distributions"
(https://dl.acm.org/citation.cfm?id=571648)
to generate random barycentric coordinates.
This op can be used for several tasks, including better mesh reconstruction.
For example, see these recent papers demonstrating reconstruction losses using
this op:
- "GEOMetrics: Exploiting Geometric Structure for Graph-Encoded Objects"
(https://arxiv.org/abs/1901.11461) ICML 2019.
- "Mesh R-CNN" (https://arxiv.org/abs/1906.02739) ICCV 2019.
Op is differentiable w.r.t mesh vertex positions.
Functions
area_weighted_random_sample_triangle_mesh(...)
: Performs a face area weighted random sampling of a tri mesh.
generate_random_barycentric_coordinates(...)
: Generate uniformly sampled random barycentric coordinates.
generate_random_face_indices(...)
: Generate a sample of face ids given per face probability.
triangle_area(...)
: Computes triangle areas.
weighted_random_sample_triangle_mesh(...)
: Performs a face probability weighted random sampling of a tri mesh.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-02-05 UTC.
[null,null,["Last updated 2021-02-05 UTC."],[],[],null,["# Module: tfg.geometry.representation.mesh.sampler\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/graphics/blob/master/tensorflow_graphics/geometry/representation/mesh/sampler.py) |\n\nComputes a weighted point sampling of a triangular mesh.\n\nThis op computes a uniform sampling of points on the surface of the mesh.\nPoints are sampled from the surface of each triangle using a uniform\ndistribution, proportional to a specified face density (e.g. face area).\n\nUses the approach mentioned in the TOG 2002 paper \"Shape distributions\"\n(\u003chttps://dl.acm.org/citation.cfm?id=571648\u003e)\nto generate random barycentric coordinates.\n\nThis op can be used for several tasks, including better mesh reconstruction.\nFor example, see these recent papers demonstrating reconstruction losses using\nthis op:\n\n1. \"GEOMetrics: Exploiting Geometric Structure for Graph-Encoded Objects\" (\u003chttps://arxiv.org/abs/1901.11461\u003e) ICML 2019.\n2. \"Mesh R-CNN\" (\u003chttps://arxiv.org/abs/1906.02739\u003e) ICCV 2019.\n\nOp is differentiable w.r.t mesh vertex positions.\n\nFunctions\n---------\n\n[`area_weighted_random_sample_triangle_mesh(...)`](../../../../tfg/geometry/representation/mesh/sampler/area_weighted_random_sample_triangle_mesh): Performs a face area weighted random sampling of a tri mesh.\n\n[`generate_random_barycentric_coordinates(...)`](../../../../tfg/geometry/representation/mesh/sampler/generate_random_barycentric_coordinates): Generate uniformly sampled random barycentric coordinates.\n\n[`generate_random_face_indices(...)`](../../../../tfg/geometry/representation/mesh/sampler/generate_random_face_indices): Generate a sample of face ids given per face probability.\n\n[`triangle_area(...)`](../../../../tfg/geometry/representation/mesh/sampler/triangle_area): Computes triangle areas.\n\n[`weighted_random_sample_triangle_mesh(...)`](../../../../tfg/geometry/representation/mesh/sampler/weighted_random_sample_triangle_mesh): Performs a face probability weighted random sampling of a tri mesh."]]