Using modulo to delete points from a cached simulation


hat tip to tekano bob who did all the work; I’m just pointing out some things about his ICE tree 🙂

First, he’s using the Element Index in case the ID was not cached (if you cache with the Cache Manager, then by default the ID attribute is not cached).
modulo_getelementindex

When I saw that, I thought maybe I could use First Valid to use either the ID, if available, or the Element Index:
modulo_getpointid

But that gives wacky results, because Delete Point automagically restores IDs to all the points in the cached simulation. So you have no choice but to use the Element Index.

Another interesting thing I’d like to point out is how you can use modulo to delete two-thirds of all points (instead of just deleting every third point). Now, modulo by 3 has three possible results: 0, 1, and 2. If you test for modulo != 0 or modulo > 0, then you’ll be deleting two-thirds of all points:
modulo_two-thirds

If you test for modulo = 0, then you’ll delete every third point:
modulo_one-third

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s