ENH: Support per-instance geometry parameters for actors#1170
Open
JigyasuRajput wants to merge 1 commit intofury-gl:v2from
Open
ENH: Support per-instance geometry parameters for actors#1170JigyasuRajput wants to merge 1 commit intofury-gl:v2from
JigyasuRajput wants to merge 1 commit intofury-gl:v2from
Conversation
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 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.actormodule, 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, andringactor 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_vertsparameter toactor_from_primitiveto avoid redundant tiling. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Testing and validation:
arrow,cone, andcylinderactors, 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):