Skip to content

Conversation

@markstor
Copy link
Contributor

Hi again @mikedh! ^^

Here a PR that extends CollisionManager.min_distance_internal() with an optional name parameter to compute distances from a specific object to all others.

Changes

  • Added name=None parameter to min_distance_internal()
  • When name provided: computes distance from specified object to others
  • When name=None: existing behavior (all pairs) unchanged
  • Temporarily removes target object from manager to avoid self-distance calculation
  • Added test check for new functionality

Usage

# Existing (unchanged)
distance = manager.min_distance_internal()

# New functionality  
distance = manager.min_distance_internal(name="my_object")

- Add optional 'name' parameter to min_distance_internal method
- When name=None (default), maintains existing behavior for all object pairs
- When name is provided, computes distance from specified object to others
- Temporarily removes target object from manager to avoid self-distance calculation
- Add test case to verify single object distance functionality
@mikedh mikedh changed the base branch from main to release/collision November 7, 2025 19:20
@mikedh mikedh merged commit b47cd4c into mikedh:release/collision Nov 7, 2025
21 of 22 checks passed
@mikedh mikedh mentioned this pull request Nov 7, 2025
@mikedh
Copy link
Owner

mikedh commented Nov 11, 2025

Awesome thanks for the PR!! By any chance did you check the performance of unregisterObject/etc? Before I release I was going to check if that was "free-ish," I could imagine there's some world where that has to rebuild the scene.

mikedh added a commit that referenced this pull request Nov 24, 2025
- release #2475 
- release #2474 
- release #2483 
- release #2481 
- release #2486 
- release #2480
- this applies the March 2024 deprecation removing
`Trimesh.remove_degenerate_faces` and `Trimesh.remove_duplicate_faces`.
- moves the `SceneViewer` control instructions from the README to print
on the `h` keypress, and make the default window caption include `h for
help`
- remove `psutil` from dependencies. It was only used to check if a
`scipy.spatial.cdist` call was going to use more than 50% of free system
memory before falling back to a more memory-efficient but slower loop.
This now falls back to a looping method if the `cdist` call is going to
use more than a fixed `4 GB` of memory,
- add check that primitives (i.e. `Cylinder`) mostly override `area` and
`volume` by checking that their primitive area/volume is not exactly
floating point equal to their meshed volume. This caught that `Capsule`
didn't return analytical volume/area which was also fixed. We could
probably make Primitive a multiple inheritance ABC that requires certain
properties but since Primitive already inherits from Trimesh that seems
unnecessary and confusing.
- clean up references to OpenCTM, which [was
deprecated](trimesh/openctm#5) for low use,
being unmaintained, and inflicting a burden on upstream package
management.
- docker images now build with 3.14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants