Hi
I am wondering about the Resample SOP and the curveu attribute
In the example scene attached, a simple polygon and a Resample SOP.
When Treat Polygons is set to “Straight Edges”, curveu ranges from 0 to 1
But when Treat Polygons is set to “Subdivision Curves”, curveu ranges from 0 to 0.33
Does anyone know why and how to have curveu range from 0 to 1 even in Sudbivision mode?
Thanks
B
Resample SOP and curveu attribute output
7760 8 2- bebe
- Member
- 53 posts
- Joined: June 2009
- Offline
- AndyW
- Member
- 336 posts
- Joined: Dec. 2014
- Offline
Looks like when you make subd curves with the resample sop curveu attribute will always be 1/number of points that aren't the first (0) point. I'm sure there's a technical reason why, someone else will have to weigh in on that. That said, it's pretty simple to normalize curveu, in a wrangle do @curveu = (float)@ptnum/(@numpt-1);
Edited by AndyW - Oct. 24, 2017 10:02:12
- Aizatulin
- Member
- 474 posts
- Joined: July 2005
- Offline
Hi,
it seems strange for me too. But if you evaluate the curve with primuv for example for the point attribute ‘P’, the range will be between 0 and 1. You don't have to evaluate ‘curveu’ attribute before. You can look at my example, just switch the uncomment lines (where float cu is defined) in the attribute wrangle to see the difference.
it seems strange for me too. But if you evaluate the curve with primuv for example for the point attribute ‘P’, the range will be between 0 and 1. You don't have to evaluate ‘curveu’ attribute before. You can look at my example, just switch the uncomment lines (where float cu is defined) in the attribute wrangle to see the difference.
- bebe
- Member
- 53 posts
- Joined: June 2009
- Offline
Hi
thanks for answering.
Yes the primuv() parameter ranges from 0 to 1.
But I am more after getting @curveu right for some other operation later on.
I know I can calculate it with the formula given by AndyW, but because I use the Resample SOP anyway I wanted to use this option (and it's also one node less to use).
And I did not realize it was depending on the number of points on the input curve.
This confuses me even more
I'll keep digging
Thanks
thanks for answering.
Yes the primuv() parameter ranges from 0 to 1.
But I am more after getting @curveu right for some other operation later on.
I know I can calculate it with the formula given by AndyW, but because I use the Resample SOP anyway I wanted to use this option (and it's also one node less to use).
And I did not realize it was depending on the number of points on the input curve.
This confuses me even more
I'll keep digging
Thanks
- Aizatulin
- Member
- 474 posts
- Joined: July 2005
- Offline
Hi,
it looks like a bug for me but I'm not sure. If you have a set of curves which are connected with increasing prim numbers (n-numbers) and every curve is (0,1) u-para, curve (i) can be reparametrize with (i,i+1) just subtracting the prim number (which is “i”) from the interval boundaries, so the whole curve is (0,n). Now if you want the whole curve (0,1) just divide by n so the first curve is (0,1/n) … the i-th will be (i/n,(i+1)/n), it is just an idea and I don't even thing it makes much sense here. You can avoid this anyway by just resampling the curve again but you need an extra node.
it looks like a bug for me but I'm not sure. If you have a set of curves which are connected with increasing prim numbers (n-numbers) and every curve is (0,1) u-para, curve (i) can be reparametrize with (i,i+1) just subtracting the prim number (which is “i”) from the interval boundaries, so the whole curve is (0,n). Now if you want the whole curve (0,1) just divide by n so the first curve is (0,1/n) … the i-th will be (i/n,(i+1)/n), it is just an idea and I don't even thing it makes much sense here. You can avoid this anyway by just resampling the curve again but you need an extra node.
Edited by Aizatulin - Oct. 26, 2017 15:16:10
- gotchee
- Member
- 37 posts
- Joined: March 2014
- Offline
- neil_math_comp
- Member
- 1743 posts
- Joined: March 2012
- Offline
gotcheeThanks! It should be fixed soon. The value was already in the “unit” domain in that case, and was being converted from “real” domain to “unit” domain unnecessarily, so it was easy to fix.
I‘ve just came across the same bug and contacted the sideFX Support.
They have logged it as a bug.
Edited by neil_math_comp - Oct. 28, 2017 21:33:14
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
- bebe
- Member
- 53 posts
- Joined: June 2009
- Offline
- NealXu
- Member
- 1 posts
- Joined: Jan. 2018
- Offline
Hi… if you evaluate the curve with primuv for example for the point attribute ‘P’, the range will be between 0 and 1. You don't have to evaluate ‘curveu’ attribute before. You can look at my example, just switch the uncomment lines in the attribute wrangle to see the difference.
pcba board [www.7pcb.com]
pcba board [www.7pcb.com]
Edited by NealXu - Jan. 30, 2018 15:18:08
-
- Quick Links