program curves_example;
{$apptype console}
uses SysUtils, CastleVectors, CastleFilesUtils, CastleCurves, CastleLog;
var
FirstCurve: TCurve;
Curves: TCurveList;
begin
InitializeLog;
FirstCurve := TCurve.LoadFromFile('castle-data:/my_curves.xml');
try
WritelnLog(FirstCurve.Point(0.0).ToString);
WritelnLog(FirstCurve.Point(0.1).ToString);
finally FreeAndNil(FirstCurve) end;
Curves := TCurveList.Create(true );
try
Curves.LoadFromFile('castle-data:/my_curves.xml');
if Curves.Count = 0 then
raise Exception.Create('No curves defined in file');
FirstCurve := Curves[0];
WritelnLog(FirstCurve.Point(0.0).ToString);
WritelnLog(FirstCurve.Point(0.1).ToString);
WritelnLog(FirstCurve.Point(0.2).ToString);
finally FreeAndNil(Curves) end;
end.