Have a flat wall with different size tiles.
Want to get tile each size into a primitive attribute.
Looks like the bounding box is giving me the dimensions compared to the overall wall size.
Thinking the FOREACH will do this by grabbing each primitive and getting a new bounding box based on it's center?
I'm later going to transfer this to a Point Attribute at the center of each tile. This way I can copy any type of tile/brick to the center of the original wall while retaining the correct dimension (see attached file).
~Shawn
Finding the size (x, y, z) of a the primitives
17146 4 2-
- massta
- Member
- 61 posts
- Joined: Dec. 2005
- Offline
-
- old_school
- Staff
- 2540 posts
- Joined: July 2005
- Offline
First off $BBX $BBY and $BBZ return the current point's position relative to the incoming geometry. For what you want to do, use $SIZEX, $SIZEY and $SIZEZ to return the size of the incoming geometry.
The ForEach SOP is one way to go about it if you want to process each primitive in turn and not return the entire bounding box of the geometry. Just needed to copy/paste the SOPs in to the ForEach set to process points/primitives and replaced the bbx with the size.
The ForEach SOP is one way to go about it if you want to process each primitive in turn and not return the entire bounding box of the geometry. Just needed to copy/paste the SOPs in to the ForEach set to process points/primitives and replaced the bbx with the size.
There's at least one school like the old school!
-
- massta
- Member
- 61 posts
- Joined: Dec. 2005
- Offline
Thanks Jeff, this worked wonderfully.
I forgot all about $SIZE
It's not listed under the Primitive Local Variables in the help.
But neither is Bounding Box; $BB
Is there a page that lists these variables?
note:
Had to make sure that the foreach node was working with Each Primitive/Point for what I needed, default is Each Group.
What a great SOP!
~Shawn
I forgot all about $SIZE
It's not listed under the Primitive Local Variables in the help.
But neither is Bounding Box; $BB
Is there a page that lists these variables?
note:
Had to make sure that the foreach node was working with Each Primitive/Point for what I needed, default is Each Group.
What a great SOP!
~Shawn
Touch Designer User
-
- old_school
- Staff
- 2540 posts
- Joined: July 2005
- Offline
Local Variables are local to the current operator and many operators have their own unique local variables. In the case of the Primitive SOP, there are specific local variables that work just with this node such as SIZE?
The best place is to open the help for the Primitive SOP and press the Local Variables link in the upper right list in the help card. This lists all the specific local variables for the Primitive SOP only. There you will find both BB? and SIZE? local variables with descriptions of each.
H12 now also will list all the available local variables if you start typing them in a roll-over.
The best place is to open the help for the Primitive SOP and press the Local Variables link in the upper right list in the help card. This lists all the specific local variables for the Primitive SOP only. There you will find both BB? and SIZE? local variables with descriptions of each.
H12 now also will list all the available local variables if you start typing them in a roll-over.
There's at least one school like the old school!
-
- massta
- Member
- 61 posts
- Joined: Dec. 2005
- Offline
Hey Jeff,
I don't see $SIZE and $BB in the help. Here is a list of the Help's Primitive Local Variable:
Local variables
PR
Primitive or profile number.
NPR
Total number of primitives or profiles.
PT
Point number of first point in primitive.
NVTX
The number of vertices in the primitive.
CEX, CEY, CEZ
Centroid of the primitive or profile.
DX, DY, DZ
Direction from the centroid to the primitive centroid.
NX, NY, NZ
Normal of the primitive.
CR, CG, CB, CA
Diffuse primitive color & Alpha for primitive.
CREASE
Crease weight for each edge of primitive
WEIGHT
Weight of meta-primitive (0 for non-meta-primitive)
—
It does mention in the beginning that each geo primitive has certain attributes “such as XYZ position, size, orientation, color, and alpha”.
and good to note the includedtip:
The local variables in the Primitive SOP are relative to the primitive. You can use the prefixes “det”, “pt”, or “vtx” to use detail, point, or vertex variables. For example, $ptTX, $ptTY, $ptTZ for point coordinates.
—
Which I believe you can grab any attribute (including user created primitive attributes) and use them accordingly if I use the $FOO, correct? Thought it needed to be all caps.
~Shawn
I don't see $SIZE and $BB in the help. Here is a list of the Help's Primitive Local Variable:
Local variables
PR
Primitive or profile number.
NPR
Total number of primitives or profiles.
PT
Point number of first point in primitive.
NVTX
The number of vertices in the primitive.
CEX, CEY, CEZ
Centroid of the primitive or profile.
DX, DY, DZ
Direction from the centroid to the primitive centroid.
NX, NY, NZ
Normal of the primitive.
CR, CG, CB, CA
Diffuse primitive color & Alpha for primitive.
CREASE
Crease weight for each edge of primitive
WEIGHT
Weight of meta-primitive (0 for non-meta-primitive)
—
It does mention in the beginning that each geo primitive has certain attributes “such as XYZ position, size, orientation, color, and alpha”.
and good to note the includedtip:
The local variables in the Primitive SOP are relative to the primitive. You can use the prefixes “det”, “pt”, or “vtx” to use detail, point, or vertex variables. For example, $ptTX, $ptTY, $ptTZ for point coordinates.
—
Which I believe you can grab any attribute (including user created primitive attributes) and use them accordingly if I use the $FOO, correct? Thought it needed to be all caps.
~Shawn
Touch Designer User
-
- Quick Links

