4
$\begingroup$

This question is similar to Selecting every n'th index using modulo in geometry nodes but with an added range option.

I can select every n'th number thanks to Hulifier

img1

I'm trying to select every n'th index, but only choose from the selected indexes between the ranges of b and c using modulo in geometry nodes.

My logic doesn't seem to work for selecting every n'th index between the numerical index ranges b and c using modulo. I checked the output with the viewer (it seems to select the index range I want but the modulo doesn't seem to be executing the way I thought. I should have only 3 icospheres showing up.)

img2

$\endgroup$

1 Answer 1

5
$\begingroup$

you have to take modulo from index, not from boolean. Modulo is the rest of a division, so it makes no sense to get a modulo value from a boolean (which is just 0 and 1). you might want to add an add note before your modulo so that it starts with 0 and not an arbitrary value.

this should work:

enter image description here

$\endgroup$
10
  • $\begingroup$ Ok that makes sense. But is it possible to choose from a specified index range? It's like I need another Node that does an AND operation but for indexes instead of booleans. $\endgroup$
    – Rick T
    Commented May 9, 2022 at 5:22
  • $\begingroup$ but you did this already perfectly in your node tree! you connected "and" to the "lower" and "greater" - that's the right way! So i don't understand what you mean now? $\endgroup$
    – Chris
    Commented May 9, 2022 at 5:23
  • 1
    $\begingroup$ just connect index to "modulo value" and the "and" result boolean to the last "and" boolean $\endgroup$
    – Chris
    Commented May 9, 2022 at 5:25
  • $\begingroup$ i updated my answer $\endgroup$
    – Chris
    Commented May 9, 2022 at 5:27
  • $\begingroup$ Thanks that did it. $\endgroup$
    – Rick T
    Commented May 9, 2022 at 5:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .