How to remove some inner idges?

   4549   8   1
User Avatar
Member
44 posts
Joined: April 2017
Offline
Hey guys! Really stuck at that one. I need to remove all edges which are ‘diagonal’, i.e. I want to have only quadrals as result. I can use Point Wrangle do detect such points one way or another, but if I delete point, it randomly re-orgs geometry and I am getting wrong results. For example, if I remove central point, it is not getting rid of diagonal edges, but just snaps diagonal line to the nearest point.

Is there some clever way to operate on ‘edge’ level?

Edited by assignators - June 4, 2018 14:46:55

Attachments:
polyscript.png (392.7 KB)

User Avatar
Member
2036 posts
Joined: Sept. 2015
Offline
Remove the two prims(the one of the angled prim ‘within’ the rectangular prim),

keeping points - removeprim() function last argument set to zero.

Create new prim from corner points - delete unneeded point/s
Edited by BabaJ - June 4, 2018 14:51:38
User Avatar
Member
44 posts
Joined: April 2017
Offline
Thanks! I found out after many experimentations, that my problem is even more fundamental.

This is what I use to prepare my polygon for cutting:



Basically, I raycast from point (say, 10) and create another point in places of intersection with some edge (say, 18). So, the next logical step is to connect that point with new created point with the straight line.

This is where I fail.

If I use PolySplit, it expects vertices. If I use PolySplitwith points only, it produced the image I had before with diagonal lines and some missing cuts. Not gonna work.

But, if I add vertices along with the point, they mess up polygon immediately.

Now, in this situation, I can not simply start creating some primitives, because I have no clue. Is there really no way to create new edge between 2 points properly?

Attachments:
polycut.png (209.3 KB)

User Avatar
Member
2036 posts
Joined: Sept. 2015
Offline
Well, just from a vex point of view…

you have all the points you need to create the divisions you want.

You dont need to ray cast at all, just decide which points you want to connect to get the unique polygon shapes you want.

Post a hip, and say what you want - and if I'm on later I'll do something.

Otherwise, someone is likely to know how to do this easily with sop nodes.
User Avatar
Member
897 posts
Joined: July 2018
Offline
If I understand correctly: create a line between your points and feed that into the polysplits second input, your geo to the first.
B.Henriksson, DICE
User Avatar
Member
44 posts
Joined: April 2017
Offline
you have all the points you need to create the divisions you want.
This all wholly procedural, I have like 1000s of different shapes. So, in reality, I need to raycast and do all other stuff, because shapes are very different.
If I understand correctly: create a line between your points and feed that into the polysplits second input, your geo to the first.

Ohhh! I just noticed, that polysplit has second input 0_0 It expects some projections curve. But if that is just the line, and it will cut, I think I can manage from there, just be making forloop and feeding those lines as second input
Edited by assignators - June 5, 2018 03:13:24
User Avatar
Member
897 posts
Joined: July 2018
Offline
Beware polysplit doesn't handles holes along the cut curve so you need to split it up per continuous segment.
B.Henriksson, DICE
User Avatar
Member
44 posts
Joined: April 2017
Offline
That is fine, I will not have holes. Thanks a lot! I'll do experiments with it this evening.
User Avatar
Member
2036 posts
Joined: Sept. 2015
Offline
This all wholly procedural, I have like 1000s of different shapes. So, in reality, I need to raycast and do all other stuff, because shapes are very different

It still can be done proceduraly no matter how many different shapes.

What makes the difference is the set up, with the end result in mind and it's variations.

Then from there how the procedural process is set up is determined.
Edited by BabaJ - June 5, 2018 09:05:00
  • Quick Links