question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reduce duplicated particles

See original GitHub issue

I am trying to display a set of images as particles and I would like each image to be displayed exactly once. Currently is not possible, because each particle gets assigned a random image, thus some of the images will appear multiple times and others won’t show at all.

https://github.com/matteobruni/tsparticles/blob/91681123649caec3e221755e2aa4b847d1393fcb/core/tsparticles/src/Core/Particle.ts#L283


Would it be possible to have an additional configuration option specifically for preventing duplicates as much as possible? It could be a boolean option like reduceDuplicates under params.particles.shape options and when enabled, following behaviour would be expected:

  • if params.particles.number.limit <= image array length, then there will be no duplicates
  • if params.particles.number.limit > image array length, then duplicates are to be expected

I am seeing as possible implementation to have 2 image arrays: original and copy. The original array would be immutable, and the copy array would get consumed with each particle that gets generated, then when the copy array gets empty, will get refreshed from the original array.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
ovidyoucommented, Jun 24, 2020

@matteobruni alright, will try to implement this feature

2reactions
issue-label-bot[bot]commented, Jun 24, 2020

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.87. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Job: Remove Duplicate Particles - CryoSPARC Guide
Remove duplicate particle picks in a given input set of particles. This enables picks from various different pickers (e.g. template picker and blob...
Read more >
system - Duplicate particle emitter - Blender Stack Exchange
To duplicate the settings just add another particle system with the + , and choose the same value from the Settings combobox ...
Read more >
Hair particles duplication with duplicate settings enabled ...
You make a duplicate of an existing groomed hair, reduce the number of them and add more roughness or groom a little bit...
Read more >
How to remove repeated elements in a vector, similar to 'set' in ...
Not all R users will have any idea what "just 'feed' a vector to a set" in python means. By repeating do you...
Read more >
How to control multiple particle systems in Blender 2.93
How to control multiple particle systems in Blender 2.93 - In this video tutorial, I will show you how to control different sets...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found