StuStix
11-08-2009, 05:53 PM
Hi, I am working on a script that analyses curvature continuity on a nurbscurve.
this works:
string $exp = ($curve+".controlPoints[1].zValue = (10/"+$infoNode+".curvatureRadius);");
expression -s $exp;
but there is a 'division by zero' situation if curvatureRadius becomes zero so...
I thought I could use a condition 'if statement':
string $exp = ("if ($infoNode.curvatureRadius==0)"
+"$curve_porc.controlPoints[1].zValue=0;"
+"\r\n else \r\n "
+"$curve_porc.controlPoints[1].zValue = (10/"+$infoNode+".curvatureRadius);");
expression -s $exp;
Syntax error //
the expression works if I make it in the expression editor but I can't get it right
when using the variables within Mel
any ideas? ...pls
sincerely
Mel Newbie
this works:
string $exp = ($curve+".controlPoints[1].zValue = (10/"+$infoNode+".curvatureRadius);");
expression -s $exp;
but there is a 'division by zero' situation if curvatureRadius becomes zero so...
I thought I could use a condition 'if statement':
string $exp = ("if ($infoNode.curvatureRadius==0)"
+"$curve_porc.controlPoints[1].zValue=0;"
+"\r\n else \r\n "
+"$curve_porc.controlPoints[1].zValue = (10/"+$infoNode+".curvatureRadius);");
expression -s $exp;
Syntax error //
the expression works if I make it in the expression editor but I can't get it right
when using the variables within Mel
any ideas? ...pls
sincerely
Mel Newbie
