Disconnect edges only certain degree(s) orientation?

Discussions about SOFTIMAGEs© Interactive Creative Environment©
Post Reply
Bullit
Moderator
Posts: 2621
Joined: 24 May 2012, 09:44

Disconnect edges only certain degree(s) orientation?

Post by Bullit » 26 Apr 2014, 21:56

What would be the best way to only disconnect edges that are at 45, 135, 225, 315º or approximate from horizontal?

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: Disconnect edges only certain degree(s) orientation?

Post by Hirazi Blue » 26 Apr 2014, 23:12

IIRC rray's RCTools offer a filter based on angle.
After selecting thusly disconnecting manually should be relatively easy.
Stay safe, sane & healthy!

Bullit
Moderator
Posts: 2621
Joined: 24 May 2012, 09:44

Re: Disconnect edges only certain degree(s) orientation?

Post by Bullit » 26 Apr 2014, 23:47

Thanks. This is to be "automatic" with ICE.

grahamef
Posts: 281
Joined: 23 Jun 2009, 21:01

Re: Disconnect edges only certain degree(s) orientation?

Post by grahamef » 28 Apr 2014, 20:23

I haven't tested this but it should work (or at least give you a starting point).

1. Get self.PointLocations
2. Plug Value into the Source of another Get Data, and get PointNeighbors. You should have an array of locations per point.
3. Plug that into yet another Get Data, and get PointPosition. You should now have an array of positions (vectors) per point.
4. Get self.PointPosition, and subtract it from the array above. You now have an array of vector offsets from each point to its neighbors, i.e., you have the connected edges expressed as vectors.
5. Get the angle between them and the vertical (0, 1, 0). You now have an array of scalar angles per point.
7. Use <= and >= to test whether they are within the range you want. You can avoid duplicates from shared edges by restricting the range to <= 90 degrees (because if the angle between edge AB and the vertical is >= 90, then the angle between BA and the vertical is <= 90). You now have an array of Booleans per point.
8. Use Find in Array to find True. You now have an array of integers, being the indices of the original PointNeighbors array corresponding to the edges you want to disconnect.
9. Get self.VertexToEdges. This is an array of integers (edge indices) per point. The order of elements in this array conveniently corresponds to the order of the PointNeighbors array.
10. Plug the above into the Array port of a Select in Array, and plug the integers from step 8 into the Index Port. You now have, per point, an array containing the edge indices connected to that point that you want to disconnect.
11. Plug the whole thing into a Build Array from Set. You now have one big array containing all the edge indices to disconnect.
12. Plug into Disconnect Component.

Bullit
Moderator
Posts: 2621
Joined: 24 May 2012, 09:44

Re: Disconnect edges only certain degree(s) orientation?

Post by Bullit » 28 Apr 2014, 22:52

Thanks Graham . Will post feedback.

Bullit
Moderator
Posts: 2621
Joined: 24 May 2012, 09:44

Re: Disconnect edges only certain degree(s) orientation?

Post by Bullit » 30 Apr 2014, 03:57

Hi, i have made the first test. I was unable to use the "and" node to not have two "Find in Array", for some reason it will not work with it. I am unable yet to work with less than function instead of equal . I'll have to think about it more but i think the issue are the results of "angle between".
Btw your way to explain was very clear and makes think. I still have a question, why i have to build an array from set after the select in array?
PolyDisconnectByAngle.jpg

grahamef
Posts: 281
Joined: 23 Jun 2009, 21:01

Re: Disconnect edges only certain degree(s) orientation?

Post by grahamef » 30 Apr 2014, 16:26

Bullit wrote:I still have a question, why i have to build an array from set after the select in array?
That step might not be necessary if the Disconnect Component node also accepts a set of arrays per point, in addition to a set of integers or a singleton array. As I said, I didn't try it myself. Anyway, good luck and keep us posted.

Bullit
Moderator
Posts: 2621
Joined: 24 May 2012, 09:44

Re: Disconnect edges only certain degree(s) orientation?

Post by Bullit » 02 May 2014, 01:21

Okay. Thanks.

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests