View Full Version : MFnNurbsSurface U - V parameter length
11-26-2012, 01:16 PM
This is probably a really simple question but I'm quickly trying to evenly distribute a given number of points on the nurbsSurface with MFnNurbsSurface. I'm using the tangents and normal methods yet these require a given U and V parameter.
Yet the total U and V parameters covering the surface depends on a variety of settings of the surface, the degree, spans, etc. Though I'm having a hard time figuring out how to actually calculate or get this max U and V parameter. (Easiest would be to have it mapped between 0 and 1 for the whole surface)
I'm using Maya 2013. ;)
If I remember correctly, you can use getKnotDomain
11-26-2012, 10:45 PM
Amazing how I missed it.
I went over the methods this morning, totally missing that the values you would put into this method were references and it was actually returning the values I needed.
Haven't checked yet but I think this will work. Feeling so stupid at the moment, durrr... ;)
More coffee tomorrow! ;)
11-26-2012, 10:56 PM
As you have guess you can extract from the U or V direction knot vector array + cv point list to build internally a curve but in a hurry how about using existing maya nodes( curveFromSurfaceIso ) and reading an input curve attribute?
11-28-2012, 12:32 PM
I'm not sure what the benefit of your technique would be as opposed to what Kriz proposed. The 'getKnotDomain' function works perfectly to get the parameter max and minimum (which is exactly what it should do, I just missed the method the first time reading over the list).
What other functionality than creating the curves from the nurbsSurface would you get the U or V direction knot vector array + cv point list for? That would actually only be useful when you want to create actual curves on the surface right? ;)
Thanks again for all the help. Appreciate it.
11-28-2012, 12:59 PM
The most basic advantage of the curveFn is the access to the findParamFromLength method:( never go outside without it)... even with normalize range your surface may not be uniformly spaced... you can choose to bind to a fix U parameter value or decide to bind to the a curve lenght or ratio.... look at the motion path node option and try to reproduce it.
Depending of your surface your tangent value may not be really meaningful ( that's why i use both in my last video: http://vimeo.com/52387664).
11-28-2012, 12:59 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.