Jump to content

Split Locations Parameter ?


Arthur Spooner

Recommended Posts

This is not easy, but it is possible to reproduce the string that you would get from creating a manual Cut using python or VEX and then referencing that into the string field of the PolySplit tool using `details("../otherNode","cutString")` for instance, but you may be able to find some tools on orbolt which do this operation already.

Link to comment
Share on other sites

4 hours ago, acey195 said:

This is not easy, but it is possible to reproduce the string that you would get from creating a manual Cut using python or VEX and then referencing that into the string field of the PolySplit tool using `details("../otherNode","cutString")` for instance, but you may be able to find some tools on orbolt which do this operation already.

Do you have a clue as to what I need to look for on orbolt ?

Link to comment
Share on other sites

I was hoping you could display some information, then you can extract the location and enter it in.  For example an simple extrusion, the vertices which all connect the faces which make up the faces in a loop could be shown and extracted, somehow.  There has to be a method to which Houdini understands when displaying the manual edgeSplit, otherwise it would not be shown in the parameters area of the node ?

Link to comment
Share on other sites

polysplit will cut from one edge location to another if you provide 2 edge locations, and will cut a edge loop if you provide only 1 edge location.

what I call an edge location is this : 12e2:0.5

read it like this: primitive number 12, edge number 2 at the middle of the edge (0.5)

it means that houdini identify edges as a number 0 or 1 or 2 or 3 which are the 4 sides of a certain primitive. Then you add a position on that edge as a 0to1 float. 0 and 1 being the extremities and 0.5 the middle.

 

so if you want to manually enter the parameters of your polysplit, you need to display the primitives number in the view port, and try to find the edgenumbers of a primitive with testing, as I dont know if it's possible to display the edgenumbers.

 

*edit*

But I still wonder why you'd want to do that, when you can just click in the viewport to place your split.

Edited by 6ril
Link to comment
Share on other sites

1 hour ago, 6ril said:

polysplit will cut from one edge location to another if you provide 2 edge locations, and will cut a edge loop if you provide only 1 edge location.

what I call an edge location is this : 12e2:0.5

read it like this: primitive number 12, edge number 2 at the middle of the edge (0.5)

it means that houdini identify edges as a number 0 or 1 or 2 or 3 which are the 4 sides of a certain primitive. Then you add a position on that edge as a 0to1 float. 0 and 1 being the extremities and 0.5 the middle.

 

so if you want to manually enter the parameters of your polysplit, you need to display the primitives number in the view port, and try to find the edgenumbers of a primitive with testing, as I dont know if it's possible to display the edgenumbers.

 

*edit*

But I still wonder why you'd want to do that, when you can just click in the viewport to place your split.

I placed a few manual edge split.  I have an primitive number on my cube (21) by placing the following in the Split Locations; 21e1:0.3 21e1:0.3 two primitive numbers move on the cube, so obviously something is happening, except not the actual visible edge split line ? 

For many, manually edge splitting will do the job :) I want to understand how it's done numerically :)

Link to comment
Share on other sites

in addition to edges the split also supports snapping to vertices and faces:

20890v0

and

20890f:0.459390,0.497302

respectively 

to get the edge number you want the vertexPrimIndex number, a quad has 4 vertices, 0-1 would be edge0, 1-2 edge 1 etc.

the vertex snap method also uses this number

for faces its the primitive number and then the intrinsic uv value for this primitive,
to find this UV value you can use the intersect() or the xyzdist() VEX functions (maybe others as well)

 

  • Like 1
Link to comment
Share on other sites

2 hours ago, Arthur Spooner said:

I placed a few manual edge split.  I have an primitive number on my cube (21) by placing the following in the Split Locations; 21e1:0.3 21e1:0.3 two primitive numbers move on the cube, so obviously something is happening, except not the actual visible edge split line ? 

For many, manually edge splitting will do the job :) I want to understand how it's done numerically :)

????  21e1:0.3 21e1:0.3  ????  that's twice the same location !

read the doc, watch entry level tutorials as suggested in your other threads. Everything I've wrote here is in the doc, as well as what acey195 added.

I've even shown you via skype share screen how to do all this...

Link to comment
Share on other sites

1 hour ago, 6ril said:

????  21e1:0.3 21e1:0.3  ????  that's twice the same location !

read the doc, watch entry level tutorials as suggested in your other threads. Everything I've wrote here is in the doc, as well as what acey195 added.

I've even shown you via skype share screen how to do all this...

I just read acey reply, calm down, let me catch up :) I'm not a machine ! 

Edited by Arthur Spooner
Link to comment
Share on other sites

Acey - I understand each faces typically has four vertices.  When I placed a manual cut it was done at split Location 0e2 for example, in the documentation it states; for the aeb, cut at the midpoint of edge b of primitive a where a and b are integers.

Do have to run the VEX code on each face ? 

Link to comment
Share on other sites

if you use the expression link method using the details() expression, you want to run the VEX code in detail mode as well. you want to use it to generate one string to put in the split Locations parameter.

If you know you are always going to cut the edge in half, it makes it easier in the sense that the value after the ":" is always 0.5.

I suggest you use some kind of VEX wrangle, just to find which primitive numbers and edges inside them you want to cut.
The code for this can vary wildly on what type of cuts you want to make.

The most straighforward (and reusable) way,
would probably be to use the second input of the wrangle to input a curve, so you can check in the wrangle which primitives and edges it crosses and export that as a detail attribute.
but to do this well, you do require some math and programming knowledge. (hence I said it was not a trivial thing to do)

If you want to use something simpler, you can just cut all the primitives across their 0th and 2nd edges (or 1st and 3rd)
The problem with this is that the split tool only does one cut, so it has to start and stop somewhere,
in a way that creates a reachable path for the splitting operation.

then again, if you want to do the latter, the split tool is probably not really the best way to tackle that task...

Link to comment
Share on other sites

Ok I made you a very simple example, if you want to cut more with the same logic, you just have to add an extra

sprintf("%de%d:0.5,Prim,Edge);

and concat that to the output string.

To input the numbers into the code algorithmically, is something for you to figure out :P, as I have no idea what it is exactly that you are trying to achieve.

I also added a non-code method in the hip file, which may be much better suited for what you are trying to do.

polySplitExample1.hipnc

Link to comment
Share on other sites

This is helpful, I have to study. In the meantime the VEX code is the brains behind numerically doing a polySplit, as mentioned previously but what is the %de%d in the sprintf() command, which you have in the VEX code ? 

Where is the groups getting the pattern information from the VEX node ?  :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...