Skip to content

ENH: Support per-instance geometry parameters for actors#1170

Open
JigyasuRajput wants to merge 1 commit intofury-gl:v2from
JigyasuRajput:feature/per-instance-actor-params
Open

ENH: Support per-instance geometry parameters for actors#1170
JigyasuRajput wants to merge 1 commit intofury-gl:v2from
JigyasuRajput:feature/per-instance-actor-params

Conversation

@JigyasuRajput
Copy link

@JigyasuRajput JigyasuRajput commented Mar 11, 2026

Closes #1091

Allow ring, disk, cone, cylinder, and arrow actors to accept per-instance geometry parameters (e.g. radii, height, inner_radius) as ndarray in addition to scalar values. Also fixes a bug where disk, cone, and cylinder documented ndarray support for radii but passed it directly to prim functions expecting a scalar.
This pull request introduces support for per-instance geometry parameters for several primitive actor functions in the fury.actor module, allowing properties like height and radius to be specified as arrays for each instance rather than just as scalars. This enables more flexible and varied rendering of primitives such as arrows, cylinders, cones, disks, and rings. The changes also include improvements to the internal logic for efficiently handling both uniform and per-instance geometry, and comprehensive tests for the new functionality.

Support for per-instance geometry parameters:

  • Updated arrow, cylinder, cone, disk, and ring actor functions to accept geometry parameters (e.g., height, radii, tip_length, tip_radius, shaft_radius, inner_radius, outer_radius) as either scalars or arrays, enabling per-instance customization. The docstrings were updated to reflect these changes. [1] [2] [3] [4]

  • Added logic to each actor function to efficiently handle the case where all parameters are uniform (fast path) versus when they vary per instance (slow path), including tiling of vertices and correct face indexing. Introduced the have_tiled_verts parameter to actor_from_primitive to avoid redundant tiling. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

Testing and validation:

  • Added comprehensive tests for per-instance geometry in arrow, cone, and cylinder actors, verifying that geometry varies as expected and that incorrect parameter array sizes raise appropriate errors. [1] [2]

Demo:
Each row shows 3 instances of the same actor with different per-instance geometry parameters (increasing left to right):

per_instance_geometry_demo

Allow ring, disk, cone, cylinder, and arrow actors to accept per-instance
geometry parameters (e.g. radii, height, inner_radius) as ndarray in
addition to scalar values. Also fixes a bug where disk, cone, and
cylinder documented ndarray support for radii but passed it directly to
prim functions expecting a scalar.
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.

Update actors to accept individual or ndarray for actor features

1 participant