Message 1 of 7
CV Curve curvature not matching the manual drawn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Im trying to do a CV Curve to match a nurbs curve based on points position.
In the attached image and maxfile (2020) I have three different curves,
Green illustrates the position of each point / vert.
Orange illustrates if I draw a CV Curve in the viewport by clicking on each vert on the green spline
Blue is if I create a CV Curve through maxscript based on the verts position of the green spline.
Orange is the correct representation but I can't achieve it with maxscript, the weight gets completely off.
How can I achieve the same weight as the manually drawn CV Curve?
Example code with the points position of the green spline.
rpt = #([-0.907021,0.0867096,0],
[-0.176184,0.50787,0],
[0.474138,0.0309677,0],
[1.68188,0.29729,0],
[2.44368,-0.266322,0],
[0.820976,-1.20155,0])
nset = NURBSSet ()
-- create a new NURBSCVCurve and set the knots and CVs
c = NURBSCVCurve name:"CV Curve" order:rpt.count numCVs:rpt.count numKnots:(rpt.count*2)
for k in 1 to rpt.count do ( setKnot c k 0; setKnot c (k+rpt.count) 1 )
cv = NURBSControlVertex rpt[1]
setCV c 1 cv
for i= 2 to rpt.count do (
cv.pos = rpt[i]
setCV c i cv
)
-- add the NURBSCVCurve object to the set
appendObject nset c
-- create the NURBS object from the NURBSSet
n = NURBSNode nset name:"nurbs01"a