Jump to content

Rotation Profile Problem


kubabuk

Recommended Posts

Hey guys

I've got following problem, maybe somebody could help me...

During sweeping along quite complex curve, my profile tends to rotate slightly along sweeping axis. I attached a file with two cameras showing right and wrong position (dimond or polywireSOP like shape is the wrong one).

The resampling the curve helps a little, but this is not the ideal solution because the memory limits run out pretty quickly and it doesn't work at all times.

I came up to semi-solution by extracting each segment of the curve (kuba_curve_segmentationSOP) an sweep it individually - but that produces some overlaping issues where the curve bends.

Fixing angle on the sweepSOP or moving pivot of the profile didn't solve the problem to me. Maybe somebody has faced similar problem, I would be really happy to see the solution for that.

cheers

kuba

Sweep_rotation_issue.hip

Link to comment
Share on other sites

Do you plan on skinning your sweep? If so, you might as well just jump to using the PolyWire SOP directly.

Yup, polywire works fine but I do want to end up with square profile, whereas polywireSOP gives me a square profile, but rotated by 45 deg. (I called in my previous post diamond shape) Sounds simple to fix this rotation... no?

cheers

kuba

Link to comment
Share on other sites

I think that to do a true box sweep in this situation, you need to proceed in a loop starting from point 0 onwards.

I woke up this morning and realized that this is easily done using the approach in my hip file above though if we turn off Rotate to Normal in the Copy SOP. Then we can build each segment exactly lik we want.

Link to comment
Share on other sites

That is really smart edward, thanks man!!! :)

Is that right that copy stamp assigns to lineSOP the length equal of the distance between two neighbour points and that was done using length expression? - That means that I could store any values as normals and reuse them later. Do you think the same effect would be possible storing values, for example, within colour? (in the pointSOP)

I don't quite get the idea of your last post - if you turn it off elements won't align with the template curve... :unsure:

once again, big thanks

kuba

Link to comment
Share on other sites

Is that right that copy stamp assigns to lineSOP the length equal of the distance between two neighbour points and that was done using length expression? - That means that I could store any values as normals and reuse them later. Do you think the same effect would be possible storing values, for example, within colour? (in the pointSOP)

It's more than that. In the Copy SOP, look at the Stamp page that's where we set up the data to be passed to the left input. You can pass any values you want and those expressions are evaluated per point copy. I think there's some examples of stamping in the Copy SOP's helpcard. I just used normals because it was convenient. :)

I don't quite get the idea of your last post - if you turn it off elements won't align with the template curve... :unsure:

Since we can pass all the information we want, we can do more than just pass the difference in successive point positions. We can also pass the _next_ difference in point positions. So this information can be used to construct each segment of the sweep exactly, without the need for the Copy SOP to do any rotation for us. I've attached my attempt at doing this. It was interesting. :) Note the comment in the copy1 SOP in this new file for how to test the setup.

boxsweep3.hipnc

Link to comment
Share on other sites

Here's a way that doesn't use boxes just a profile and the copy sop, this way gives you only one profile at each corner like polywire but without the rotation (diamonds) problem of polywire.

Sweep_box.hipnc

Just realised that the first copy sop ( copy3 ) is set to stamp - this is a hang over from an early attempt and can be turned off as it has no effect.

Edited by sibarrick
Link to comment
Share on other sites

Well, I could add all the vector attributes in one vex sop, and do the "pick_best_skin" in another one, and the xform on the copied grid isn't really needed either as that can be done in the original grid sop.

So I could in *theory* cut it down to 8 nodes..... or is that cheating?

Or you could do it all in hdk and make it one node, but that really would be cheating. :P

Link to comment
Share on other sites

Well, I could add all the vector attributes in one vex sop, and do the "pick_best_skin" in another one, and the xform on the copied grid isn't really needed either as that can be done in the original grid sop.

So I could in *theory* cut it down to 8 nodes..... or is that cheating?

Or you could do it all in hdk and make it one node, but that really would be cheating. :P

Heh, I had meant as in terms of complexity using Houdini. :)

So taking your lead, I've simplified my construction.

boxsweep4.hipnc

Link to comment
Share on other sites

hey guys that is absolutely amazing - very cool, thanks

hmmm edward, what is the adventage of this method (boxsweep3) comparing to the first one? I find the first one more self explenetory and simpler ;) (well at least at this stage of learning H). If you don't use "rotate to template normals" does it speed up cooking of the network or is it just different approach?

hey simon that looks awesome, one question though, could you briefly explain what does "detail" expression do in the if statment? Is the "pick best skinSOP" picking the gemoetry which has the smallest area?

cheers

kuba

Link to comment
Share on other sites

hey simon that looks awesome, one question though, could you briefly explain what does "detail" expression do in the if statment? Is the "pick best skinSOP" picking the gemoetry which has the smallest area?

Well nearly, the "pick best skinSOP" picks the one with the smallest total perimeter for all the polys in the skin between any pair of profiles. I create the perimeter attribute as a primitive attribute first then bounce it up to a detail attribute by summing all the values for the polys in each skin. That gives me the total edge length for each attempt to do the best skin.

The detail expression just lets me compare this final "size" metric for each potential version and pick the one that is the smallest. The detail expression itself is like the point or prim expression but is for reading detail attributes.

Link to comment
Share on other sites

hmmm edward, what is the adventage of this method (boxsweep3) comparing to the first one? I find the first one more self explenetory and simpler ;) (well at least at this stage of learning H). If you don't use "rotate to template normals" does it speed up cooking of the network or is it just different approach?

boxsweep3 is a cheat because it's not hollow all the way through.

Or how about this for 15 nodes, no stamping....

Well, I consider myself trumped for good now. :)

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...