Skip to content

Fixes for particles algebra api in Python - #251

Open
tychedelia wants to merge 1 commit into
dispatch-uniform-fixesfrom
vector-map-broadcast
Open

tychedelia wants to merge 1 commit into
dispatch-uniform-fixesfrom
vector-map-broadcast

Conversation

@tychedelia

@tychedelia tychedelia commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Working toward composing things like flocking from attribute math alone, without custom shaders, and two things were missing.

  • Vector length ops. MAP now has NORMALIZE (to length=) and LIMIT (min_length=/max_length=). Both work on the whole vector; zero stays zero.
  • Broadcasting. Like numpy's (N, 1) * (N, 3): a 1-component b in COMBINE now applies across every component, so you can scale by a per-particle value or multiply by a 0/1 mask.

p.apply(MAP, "velocity", op=LIMIT, max_length=10)
p.apply(COMBINE, "velocity", "speed", op=MUL)

Positional operands come in the next PR.

@tychedelia
tychedelia added this pull request to stack #256 September 29, 2026 04:50
@tychedelia
tychedelia removed this pull request from stack #256 September 29, 2026 05:06
@tychedelia
tychedelia added this pull request to stack #258 September 29, 2026 05:06
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Visual regression: no changes across 43 cases

baseline f4e69a80d4 · adapter llvmpipe (LLVM 20.1.2, 256 bits) (Vulkan, Mesa 25.2.8-0ubuntu0.24.04.2 (LLVM 20.1.2))

Open the visual report · workflow run

This branch has not been deployed

No deployments
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.

1 participant