tfg.geometry.representation.mesh.normals.vertex_normals
Stay organized with collections
Save and categorize content based on your preferences.
Computes vertex normals from a mesh.
tfg.geometry.representation.mesh.normals.vertex_normals(
vertices: type_alias.TensorLike,
indices: type_alias.TensorLike,
clockwise: bool = True,
name: str = 'normals_vertex_normals'
) -> type_alias.TensorLike
This function computes vertex normals as the weighted sum of the adjacent
face normals, where the weights correspond to the area of each face. This
function supports planar convex polygon faces. For non-triangular meshes,
this function converts them into triangular meshes to calculate vertex
normals.
Note |
In the following, A1 to An are optional batch dimensions.
|
Args |
vertices
|
A tensor of shape [A1, ..., An, V, 3] , where V is the number of
vertices.
|
indices
|
A tensor of shape [A1, ..., An, F, M] , where F is the number of
faces and M is the number of vertices per face.
|
clockwise
|
Winding order to determine front-facing faces. The order of
vertices should be either clockwise or counterclockwise.
|
name
|
A name for this op. Defaults to "normals_vertex_normals".
|
Returns |
A tensor of shape [A1, ..., An, V, 3] containing vertex normals. If
vertices and indices have different batch dimensions, this function
broadcasts them into the same batch dimensions and the output batch
dimensions are the broadcasted.
|
Raises |
ValueError
|
If the shape of vertices , indices is not supported.
|
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 2022-10-28 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2022-10-28 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2022-10-28 UTC."],[],[]]