ICE: Get Polygon (or whatever) by ID

33 views
Skip to first unread message

Thomas Volkmann

unread,
May 9, 2013, 9:09:16 AM5/9/13
to soft...@listproc.autodesk.com
Hi,
we found a working solution to a current problem (set UV per Polygon), but I'm not fully satisfied with it, because it breaks when we have triangles in the mesh (which we can avoid, so it's more a personal problem of not being able to do what I want to do in ICE).
 
Problem:
We want to set a vector per node. Depending on the index of that node when using a PolygonToNodes it will be at (0,0),(0,1),(1,1) or (1,0) in UV-space.
 
Solution for Quads only:
GetNodeID -> find in array
the array:
Get PolygonToNodes -> build array from set 
we modulo the index by 4, and no we know, if this Node is 0,1,2 or 3
 
This solution breaks of course when there is a single polygon that has more or less than 4 points.
 
What I would like to do but can't figure out:
Get NodeToPolygon  (because we need to be in a perNode context)
Use the PolygonID that I get this way, and get PolygonToNodes for that Poly (how the fxxk do I do that?) THAT IS PROBABLY THE MAIN QUESTION!
Then I could check which index the Node has that I got in the beginning.
 
Unfortunately I have some real work to do, and can't continue on this right now, but in the back of my head it's driving me mad.
So if anyone can offer salvation it'll be much appreciated! Even if it's a complete different solution)
 
cheers,
Thomas

Peter Agg

unread,
May 9, 2013, 9:19:02 AM5/9/13
to Thomas Volkmann, soft...@listproc.autodesk.com
So if a quad is (0,0),(0,1),(1,1),(1,0) what would a n-gon be?

A triangle would be (0,0),(0,1),(1,1)? What would a polygon with 5 vertexes have?

Thomas Volkmann

unread,
May 9, 2013, 9:43:44 AM5/9/13
to soft...@listproc.autodesk.com
You can probably see how much vertices a polygon has and then interpolate around the UV-space, but the problem is more the general question, since we have a working solution for our  needs.
 
cheers,
Thomas
Peter Agg <pete...@googlemail.com> hat am 9. Mai 2013 um 15:19 geschrieben:

Fabricio Chamon

unread,
May 9, 2013, 9:51:09 AM5/9/13
to Thomas Volkmann, soft...@listproc.autodesk.com
"Use the PolygonID that I get this way, and get PolygonToNodes for that Poly (how the fxxk do I do that?)"

responding to the main question only, does this icetree work ? 
desired node index range should be: 0 to (num vertices for that polygon -1)

Imagem inline 1


2013/5/9 Thomas Volkmann <li...@thomasvolkmann.com>
image.jpeg

Thomas Volkmann

unread,
May 9, 2013, 10:12:26 AM5/9/13
to soft...@listproc.autodesk.com
Thanks Fabricio, I don't have time to test it right now. From the look of it I would think that we are in a perPolygon context and not perNode. But I'll check if that gets me somewhere. It definitely helps to see different approaches!
 
thanks,
Thomas
Fabricio Chamon <xsim...@gmail.com> hat am 9. Mai 2013 um 15:51 geschrieben:

Thomas Volkmann

unread,
May 9, 2013, 10:33:45 AM5/9/13
to soft...@listproc.autodesk.com
some pseudocode (maybe that's easiest to describe what i want):
 
for node on mesh:
    poly = node.getPolygon()
    nodes = poly.GetNodes()
    index = nodes.index(node)    
    node.StoreSomeAttribute(doSomethingWith(index))
 
Fabricio Chamon <xsim...@gmail.com> hat am 9. Mai 2013 um 15:51 geschrieben:

Grahame Fuller

unread,
May 9, 2013, 11:28:44 AM5/9/13
to soft...@listproc.autodesk.com
Is this what you want?

[cid:image0...@01CE4CA8.5D485040]

gray

From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Thomas Volkmann
Sent: Thursday, May 09, 2013 10:34 AM
To: soft...@listproc.autodesk.com
Subject: Re: ICE: Get Polygon (or whatever) by ID

some pseudocode (maybe that's easiest to describe what i want):

for node on mesh:
poly = node.getPolygon()
nodes = poly.GetNodes()
index = nodes.index(node)
node.StoreSomeAttribute(doSomethingWith(index))

Fabricio Chamon <xsim...@gmail.com<mailto:xsim...@gmail.com>> hat am 9. Mai 2013 um 15:51 geschrieben:
" Use the PolygonID that I get this way, and get PolygonToNodes for that Poly (how the fxxk do I do that?)"

responding to the main question only, does this icetree work ?
desired node index range should be: 0 to (num vertices for that polygon -1)

[Imagem inline 1]

2013/5/9 Thomas Volkmann <li...@thomasvolkmann.com<mailto:li...@thomasvolkmann.com>>
You can probably see how much vertices a polygon has and then interpolate around the UV-space, but the problem is more the general question, since we have a working solution for our needs.

cheers,
Thomas
Peter Agg < pete...@googlemail.com<mailto:pete...@googlemail.com>> hat am 9. Mai 2013 um 15:19 geschrieben:

So if a quad is (0,0),(0,1),(1,1),(1,0) what would a n-gon be?

A triangle would be (0,0),(0,1),(1,1)? What would a polygon with 5 vertexes have?

image001.jpg
image002.jpg

Stephen Blair

unread,
May 9, 2013, 11:44:49 AM5/9/13
to soft...@listproc.autodesk.com
Hey gray
I don't see any of the images you post. Not even in IE or Chrome when I
go to the Google group.
I just see a winmail.dat attachment...are you sending in RTF format
(just a guess as to why this happens) ?

Thomas Volkmann

unread,
May 9, 2013, 11:46:08 AM5/9/13
to soft...@listproc.autodesk.com
Now that I see it, I feel so embarrassed that I had to ask :/
Thanks a ton Grahame!
 
cheers,
Thomas

> Grahame Fuller <Grahame...@autodesk.com> hat am 9. Mai 2013 um 17:28 geschrieben:

Grahame Fuller

unread,
May 9, 2013, 11:50:18 AM5/9/13
to soft...@listproc.autodesk.com
Nope, HTML. I'll try a different way of attaching. I've also put it here: https://dl.dropboxusercontent.com/u/7703976/NodeIndexInPolygon.png

gray

-----Original Message-----
From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Stephen Blair
Sent: Thursday, May 09, 2013 11:45 AM
To: soft...@listproc.autodesk.com
Subject: Re: ICE: Get Polygon (or whatever) by ID

NodeIndexInPolygon.png
Reply all
Reply to author
Forward
0 new messages