-
Notifications
You must be signed in to change notification settings - Fork 726
Auto-fixes for pim/feat/scene-cooking #2696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Nabla7
merged 30 commits into
pim/feat/scene-cooking
from
pim/feat/scene-cooking-autofixes
Jul 6, 2026
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
d06b8a8
fix: narrow broad excepts in collision_export mesh/visual writers
paul-nechifor 85ec55d
fix: narrow broad except in collision_policy primitive fitting
paul-nechifor 4f986b0
fix: stop mislabeling missing CoACD as a decomposition failure
paul-nechifor dcf35c8
refactor: dedupe CoACD log-silencing into a shared helper
paul-nechifor 5b10a0f
refactor: delete dead GeomEmission dataclass, fix stale docstrings
paul-nechifor 6f395f7
chore: drop scene extra deps already declared as core dependencies
paul-nechifor 25e0d00
refactor: name min-extent epsilon, dedupe AABB-extent clamp helper
paul-nechifor 4ba6ce8
refactor: name the floor-probe ray height constant in mesh.py
paul-nechifor 998c189
refactor: name magic numbers in glb.py
paul-nechifor 6949ec0
fix: narrow broad except in normalized_texture_bytes
paul-nechifor eeb155b
refactor: reuse glb.py's public GLB layout constants in test_glb.py
paul-nechifor 73c5233
refactor: drop redundant rerun browser visual profile
paul-nechifor 3e0c74e
refactor: name magic numbers in collision_export.py
paul-nechifor 548c407
refactor: name the entity id sample cap constant in cook.py
paul-nechifor b7213b7
refactor: name the gltfpack warning tail-lines constant
paul-nechifor cb19aec
fix: respect XDG_CACHE_HOME for scene cook cache directories
paul-nechifor e764235
fix: fail entity collision tests on missing open3d/coacd instead of s…
paul-nechifor aa2b07e
refactor: object -> Any in scene_cooking type hints, drop stale ignores
paul-nechifor 7ddb7b5
refactor: hoist numpy import to module scope in entities/collision.py
paul-nechifor 249fbba
refactor: hoist json/scipy imports to module scope in collision_expor…
paul-nechifor 3a73f33
chore: add lazy-import comment for mujoco in cook.py
paul-nechifor a166308
refactor: hoist trimesh import to module scope in browser/collision.py
paul-nechifor dd7dbeb
chore: comment the inline browser.collision import in test_cooking.py
paul-nechifor 18c32cf
refactor: printf-style logging -> structured kwargs
paul-nechifor 001def1
perf: vectorize duplicated fan-triangulation in mesh.py
paul-nechifor 6fa949f
refactor: bare np.ndarray -> NDArray[...] in browser/collision.py
paul-nechifor d762370
refactor: bare np.ndarray -> NDArray[...] in planning.py
paul-nechifor 8e192ef
refactor: bare np.ndarray -> NDArray[...] in mesh.py
paul-nechifor 8400a4d
refactor: bare np.ndarray -> NDArray[...] in collision_export.py
paul-nechifor d2d410a
refactor: bare np.ndarray -> NDArray[...] in collision_policy.py
paul-nechifor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # Copyright 2025-2026 Dimensional Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """Shared CoACD setup for scene-cooking convex decomposition.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
|
|
||
| def silence_coacd_logging() -> None: | ||
| """Quiet CoACD's per-invocation C-library log spam. | ||
|
|
||
| ``set_log_level`` is a cheap call, so this is safe to call before | ||
| every ``coacd.run_coacd`` invocation instead of caching "already | ||
| silenced" state on a function attribute. | ||
| """ | ||
| import coacd # type: ignore[import-not-found, import-untyped] | ||
|
|
||
| coacd.set_log_level("error") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import coacdnow outsidetry—ModuleNotFoundErroris no longer caughtPreviously the entire coacd call (including the import) was inside the
except Exceptionblock, so a missingcoacdinstallation would return[]and fall back to a single convex hull silently. Nowimport coacdis unconditional, so a missing module raisesModuleNotFoundErrorstraight to the caller. The docstring and test file (import coacd # noqa: F401 ensures collection fails loudly) confirm this is intentional — but it is a breaking behaviour change for callers that relied on the silent fallback and may be running without thesceneextra installed. Is this intentional — i.e.coacdis now a hard requirement whenevercook_entity_collision_hullsis called, not an optional accelerator?