freaq Posted October 23, 2013 Share Posted October 23, 2013 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) Quote Link to comment Share on other sites More sharing options...
tmdag Posted October 23, 2013 Share Posted October 23, 2013 can you just store and read length attribute from point 0 of your curve? Quote Link to comment Share on other sites More sharing options...
freaq Posted October 23, 2013 Author Share Posted October 23, 2013 (edited) 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 October 23, 2013 by freaq Quote Link to comment Share on other sites More sharing options...
tmdag Posted October 23, 2013 Share Posted October 23, 2013 so you want to have different point amount based on edge length or whole curve length ? could you provide some example scene ? Quote Link to comment Share on other sites More sharing options...
acey195 Posted October 23, 2013 Share Posted October 23, 2013 (edited) 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 October 24, 2013 by acey195 Quote Link to comment Share on other sites More sharing options...
freaq Posted October 24, 2013 Author Share Posted October 24, 2013 (edited) 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 October 24, 2013 by freaq Quote Link to comment Share on other sites More sharing options...
tmdag Posted October 24, 2013 Share Posted October 24, 2013 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 Quote Link to comment Share on other sites More sharing options...
acey195 Posted October 24, 2013 Share Posted October 24, 2013 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. Quote Link to comment Share on other sites More sharing options...
freaq Posted October 27, 2013 Author Share Posted October 27, 2013 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) Quote Link to comment Share on other sites More sharing options...
tmdag Posted October 27, 2013 Share Posted October 27, 2013 (edited) I am not sure about existence of $PR in resample sop, you would have to ask sesi directly about that. Instead for each sop, you could use copy sop that should be much faster in this case len.hipnc Edited October 27, 2013 by tmdag Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.