CreatePCurve returns null

Apr 21, 2004 1 Replies

Hello All!



now i am tring to create pcurve (parametric curve or curve projection onto surface) from 3D-curve (e.g. from LINE).



The following is pascal (Delphi) variant of code: var v_props, v_knots, v_ctrlPtCoords: variant; ... val := iCrv.ConvertLineToBcurve (v_start, v_end); v_props := VarArrayCreate([0,1], varDouble); v_props[0] := val[0]; //DimensionControlPoints and Order //in this case: DimensionControlPoints=3 , Order=2 v_props[1] := val[1]; //NumCtrlPoints and Periodicity //in this case: NumCtrlPoints=2 , Periodicity=0 v_knots := VarArrayCreate([0, NumCtrlPoints+order-1], varDouble); v_ctrlPtCoords := VarArrayCreate([0, NumCtrlPoints*DimensionControlPoints-1], varDouble);



for i:=0 to (NumCtrlPoints + order) -1 do v_knots[i] := val[i+2]; sz := i+2; for i:=0 to (NumCtrlPoints * DimensionControlPoints) -1 do v_ctrlPtCoords[i] := val[i+sz];



pCurve := fModeler.CreatePCurve(fSurface,v_props,v_knots,v_ctrlPtCoords) as iCurve;



and here : (pCurve == nil) ?!?! why? could You help me please?



Thanks, Vasilii Sorokin


Hello All!

now i am tring to create pcurve (parametric curve or curve projection onto surface) from 3D-curve (e.g. from line).

The following is pascal (Delphi) variant of code: var v_props, v_knots, v_ctrlPtCoords: variant; ... val := iCrv.ConvertLineToBcurve (v_start, v_end); v_props := VarArrayCreate([0,1], varDouble); v_props[0] := val[0]; //DimensionControlPoints and Order //in this case: DimensionControlPoints=3 , Order=2 v_props[1] := val[1]; //NumCtrlPoints and Periodicity //in this case: NumCtrlPoints=2 , Periodicity=0 v_knots := VarArrayCreate([0, NumCtrlPoints+order-1], varDouble); v_ctrlPtCoords := VarArrayCreate([0, NumCtrlPoints*DimensionControlPoints-1], varDouble);

for i:=0 to (NumCtrlPoints + order) -1 do v_knots[i] := val[i+2]; sz := i+2; for i:=0 to (NumCtrlPoints * DimensionControlPoints) -1 do v_ctrlPtCoords[i] := val[i+sz];

pCurve := fModeler.CreatePCurve(fSurface,v_props,v_knots,v_ctrlPtCoords) as iCurve;

and here : (pCurve == nil) ?!?! why? could You help me please?

Thanks. Vasilii Sorokin

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required