False “Invalid mesh topology” warning on the final valid face in `computeSmoothNormals`
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 74/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- cpp
調査の方向性
utils/src/geometry.cpp の computeSmoothNormals から始め、コミットで固定された UtahTeapot.usd アセットを usdconvert.exe で使用して警告を再現します。最終フェイスの境界条件を確認し、フェイス数がインデックス配列の長さとちょうど一致するメッシュのリグレッションテストカバレッジを追加します。すべてのフェイスが無効なトポロジ警告なしで処理されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Hi Everyone, I found an issue while building a cli tool around around what this repo offers.
Description
When exporting a valid USD mesh to STL, glTF, or GLB using Adobe USD File Format Plugins 2026.07, the exporter emits the following warning:
Invalid mesh topology: offset 4944 into indices for face 1235 is larger than total indices 4944
The source mesh topology is valid:
Faces: 1236
Sum of faceVertexCounts: 4944
Number of faceVertexIndices: 4944
Therefore:
sum(faceVertexCounts) == faceVertexIndices.size()
The warning occurs while processing the final face, where the calculated exclusive end offset is exactly equal to the total number of indices.
The export still completes successfully with exit code 0, but the normal-generation loop appears to stop before processing the final face.
Reproduction asset
The issue reproduces using the unmodified Utah Teapot USD asset from the ASWF USD Assets Working Group repository.
The asset is provided under the Public Domain/CC0 license.
- [Commit-pinned UtahTeapot.usd](https://github.com/usd-wg/assets/blob/0cfdafe7ed4b9507a215553f614e63882907074e/full_assets/Teapot/geo/UtahTeapot.usd)
- [Raw UtahTeapot.usd download](https://raw.githubusercontent.com/usd-wg/assets/0cfdafe7ed4b9507a215553f614e63882907074e/full_assets/Teapot/geo/UtahTeapot.usd)
- [Teapot asset directory](https://github.com/usd-wg/assets/tree/0cfdafe7ed4b9507a215553f614e63882907074e/full_assets/Teapot)
- [Asset README and license information](https://github.com/usd-wg/assets/blob/0cfdafe7ed4b9507a215553f614e63882907074e/full_assets/Teapot/README.md)
- [Upstream asset commit](https://github.com/usd-wg/assets/commit/0cfdafe7ed4b9507a215553f614e63882907074e)
No modifications to the upstream USD file are required to reproduce the warning.
Steps to reproduce
Download the commit-pinned UtahTeapot.usd file and export it to STL:
usdconvert.exe UtahTeapot.usd -o UtahTeapot.stl
The same warning can also be reproduced when exporting to glTF or GLB:
usdconvert.exe UtahTeapot.usd -o UtahTeapot.gltf
usdconvert.exe UtahTeapot.usd -o UtahTeapot.glb
Actual result
The export completes with exit code 0, but emits:
Warning: in computeSmoothNormals at line 762 of utils/src/geometry.cpp
-- Invalid mesh topology: offset 4944 into indices for face 1235 is larger than total indices 4944
The warning is produced for STL, glTF, and GLB exports.
FBX and OBJ exports of the same source mesh complete without this warning.
Expected result
- The mesh should not be reported as having invalid topology.
- The final face should be included in smooth-normal generation.
- No topology warning should be emitted when the exclusive end offset is exactly equal to the total number of indices.
Suspected cause
The current implementation in utils/src/geometry.cpp contains the following condition:
if ((size_t)(faceVertexIndex + numFaceVertices) >= totalNumFaceVertices) {
TF_WARN(
"Invalid mesh topology: offset %d into indices for face %zu is larger than "
"total indices %zu",
faceVertexIndex + numFaceVertices,
faceIdx,
totalNumFaceVertices);
break;
}
For the final valid face:
faceVertexIndex + numFaceVertices == totalNumFaceVertices
This equality is valid because the calculated value is the exclusive end offset.
The condition appears to reject a valid final face because it uses >=.
A possible correction would be:
if ((size_t)(faceVertexIndex + numFaceVertices) > totalNumFaceVertices) {
The warning text also says the offset is “larger than” the total number of indices, although in this reproduction the two values are equal.
Potential impact
Because the function calls break, normal generation stops before the final face is processed.
Although the export succeeds, the last face may receive incomplete or incorrect generated normal data.
Environment
OS: Windows 10 x64
Adobe USD File Format Plugins: 2026.07
OpenUSD: 25.11
Affected exports: STL, glTF, GLB
Source mesh faces: 1236
Sum of faceVertexCounts: 4944
faceVertexIndices count: 4944
Suggested regression test
Add a valid mesh where the final face ends exactly at the end of the index array:
sum(mesh.faces) == mesh.indices.size()
Verify that:
computeSmoothNormalsprocesses every face.- No invalid-topology warning is emitted.
- The generated normals include the final face.
Existing-issue search
I searched the repository’s open and closed issues and pull requests for:
- the exact warning text
computeSmoothNormalsfaceVertexIndexfaceVertexIndicestotalNumFaceVertices- mesh topology and normal-generation issues
- related STL and glTF reports
I did not find an existing report for this final-face boundary condition.
- 主要言語
- C++
- スター
- 396
- フォーク
- 42
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
adobe/USD-Fileformat-plugins のほかの issue
-
Use system eigen オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
adobe/USD-Fileformat-plugins#80 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 50/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
adobe/USD-Fileformat-plugins の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
AXERA-TECH/ax-llm#77 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
games-on-whales/wolf#509 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
bug-unconfirmed
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
NVIDIA/cuda-samples#453 ·