Jump to content

resapmle sop not taking $PR


freaq

Recommended Posts

seems that something I used to do doesn;t work anymore:

I often did a resample set to number of segments with the expression: arclen("../measure1",$PR,0,1)

basically setting the number of points based on the length of the curve. however now $PR is made red and does nto get accepted anymore?

is this a change? bug? other methods to do this (preferrably without a forloop)

Link to comment
Share on other sites

nope then I still need to do a for loop, as I cant increment which pointnr or prim I want to read from.

I did a measure sop with a perimeter attrib and wanted to read the perimeter value of the curent prim, and I'm 99% confident I was able to do this before.

but now I can only read a specific prim 0,1,2,3 as soon as I want to use anything smart the node fails

Edited by freaq
Link to comment
Share on other sites

Hey Freek,

Can't you just use "Maximum Segment Length" and set the "Length" to 1 (or any other value)

and Resample by polygon edge?

That should give you same result, on nurbs curves.

On a polygon curve it would be slightly different around the original point curves.

which wouldn't be deformed like with the method you are describing I think.

If you are using poly-curves and want the corners to be altered according to the sampling,

I think using a forloop is probably unavoidable, but I don't think that would matter much in terms of speed.

Or you could use the "Maximum Segment Length" and write a VOP that would move the points along the curve.

Edit: Or you could simply choose to not use the "Resample by PolygonEdge" and maintain the last vertex.

Twan

Edited by acey195
Link to comment
Share on other sites

the problem is I want every section to be identical in length,

given a line that is 5.5 units long if I ask to divide it into sections of 1 unit,

I want the result to be 5 equal sections of 1.1 unit in length instead of having one short one at the end.

Edited by freaq
Link to comment
Share on other sites

it is hard to understand without an example.

If I have a line 5.5 units long and use resample sop and resample it into 5 segments (using Maximum Segments - 5) I will get 5 segments of 1.1 unit

Jup, the only thing that doesn't work is if the primitives need to have a variable segment count, say when you want the amount of segs be round(primLength),

I guess that is what Freek is trying to do. The easiest way to accomplish that, I guess, is still by using a forloop.

Alternatively you could use the "Maximum Segment Length" and maintain the last vertex. After that you could measure the distance between the final and semifinal point of each curve

and move all the points back across the curve (using a polyframe and vopsop/pointwrangle) by the measured distance divided by the total amount of points (vertex count per) curve.

Link to comment
Share on other sites

it is hard to understand without an example.

If I have a line 5.5 units long and use resample sop and resample it into 5 segments (using Maximum Segments - 5) I will get 5 segments of 1.1 unit

thats exactly right ;)

so what I want, and I know this was possible before, was to base the amount of segments on the length of the curve.

(i have several curves of varying lenghts) so I put the expression in the field to measure the length of the primitive currently being resampled, make integer and feed that in as the amount of sections I want.

however this is not working anymore: arclen("../null1",$PR,0,1)

seems something in the node has changed for some reason.

I can do it with a for loop but it is just unnescesarily slow. (it is for a tool that should be very responsive)

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