group3 = group1 minus group2 how do i do this in vex

   3350   6   1
User Avatar
Member
91 posts
Joined: Oct. 2015
Offline
how do i do this in vex and group1 and group2 are Primitives.

group3 = group1 - group2

group3 = group1 minus group2
Edited by gfxfx - Oct. 20, 2018 08:00:45

Attachments:
too_groups.jpg (46.7 KB)

User Avatar
Member
61 posts
Joined: April 2018
Offline
In an Attribute Wrangle running over Primitives,

@group_group3 = @group_group1 && !@group_group2;

You can find more information here [www.sidefx.com], under section “Accessing group membership”.
User Avatar
Member
8531 posts
Joined: July 2007
Online
also there is Group Combine node for this
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
91 posts
Joined: Oct. 2015
Offline
i played a round with Group Combine before i post this and the documents on the Group Combine were bit confusing

Thank you pabcou that was very helpful can you show me were the “minus” was in @group_group3 = @group_group1 && !@group_group2;

i do not see a minus in the equation can you show me how do It with a “plus” i not c++ or vex programmer but i am kind of a novice python programmer.
bit break down would be useful

its only easy when you know how!!!
Edited by gfxfx - Oct. 20, 2018 15:38:39
User Avatar
Member
32 posts
Joined: Sept. 2013
Offline
gfxfx
i played a round with Group Combine before i post this and the documents on the Group Combine were bit confusing

Thank you pabcou that was very helpful can you show me were the “minus” was in @group_group3 = @group_group1 && !@group_group2;

i do not see a minus in the equation can you show me how do It with a “plus” i not c++ or vex programmer but i am kind of a novice python programmer.
bit break down would be useful

its only easy when you know how!!!
gfxfx
i played a round with Group Combine before i post this and the documents on the Group Combine were bit confusing

Thank you pabcou that was very helpful can you show me were the “minus” was in @group_group3 = @group_group1 && !@group_group2;

i do not see a minus in the equation can you show me how do It with a “plus” i not c++ or vex programmer but i am kind of a novice python programmer.
bit break down would be useful

its only easy when you know how!!!

“@group_group3 = @group_group1 && !@group_group2;”

by putting @group_group3 = @group_group1 your have both the groups equal or say components of group3 are same as group1 ,now “&&” is the logic gate operator that executes only if both conditions LHS and RHS are satisfied,in this case group3 is not equal to group2(“!” is notation for not),which means put components in group3 if they are equal to group1 and at the same time not equal to group2,or say group1-group2.I hope I made myself clear.
User Avatar
Member
61 posts
Joined: April 2018
Offline
gfxfx
Thank you pabcou that was very helpful can you show me were the “minus” was in @group_group3 = @group_group1 && !@group_group2;

i do not see a minus in the equation can you show me how do It with a “plus” i not c++ or vex programmer but i am kind of a novice python programmer.
bit break down would be useful
If we have groups A and B, and we want the elements of A minus the elements of B, that is equivalent to taking the elements that are in A and not in B. This translates, in pseudocode, to “A && !B” (“&&” is Boolean AND, “!” is Boolean NOT). We can make use of this with the special attribute @group_*, which, when set for some point/primitive/etc., describes being in a group (value 1) or not being in that group (value 0). For example,
@group_SomeGroup = 1;
when run on some piece of geometry, makes it a member of the group “SomeGroup”.

Now, using code analogous to the one from the previous post:
@group_C = @group_A && !@group_B;
can be read, for some element that is in A and not in B, as
@group_C = 1 && !0;
which, given that logically (1 && !0) → (1 && 1) → 1, evaluates to
@group_C = 1;
making that element a member of group C. It goes similarly, according to the rules of Boolean logic, for all other combinations of membership in the relevant groups.
Edited by pabcou - Oct. 20, 2018 17:49:14
User Avatar
Member
91 posts
Joined: Oct. 2015
Offline
Thank you your very kind "pabcou" for taking the time to post it's much appreciate.

I understand how it works now.
Edited by gfxfx - Oct. 21, 2018 13:42:35
  • Quick Links