Page 1 of 1
AddPolyBezier
Posted: 01 Jun 2006, 17:02
by schulz
Hello,
i have some problems with Bezier curves.
Where i have to put the coordiates for the "manipulation points" in the TDataExport record?
Best regards
Armin
Posted: 01 Jun 2006, 17:46
by Evgeny
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by schulz</i>
<br />Hello,
i have some problems with Bezier curves.
Where i have to put the coordiates for the "manipulation points" in the TDataExport record?
Best regards
Armin
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
Please look at Exporter Main.pas:
Code: Select all
<b>const</b> arrBezier: <b>array</b> [0..countBezier-1] <b>of</b> TPoint = ( (X:200;Y:230), (X:190;Y:310), (X:280;Y:330), (X:310;Y:310), (X:340;Y:290), (X:390;Y:270), (X:355;Y:225), (X:330;Y:240), (X:305;Y:255), (X:415;Y:255), (X:440;Y:240), (X:480;Y:220), (X:430;Y:200));
<b>const</b> countBezier = 13;
<b>procedure</b> TfmDXFExporter.btnFormShapesClick(Sender: TObject);
<b>var</b>
vDXF: TsgDXFExport;
Data: TdxfExportData;
Pt: PexpPoint;
I: Integer;
<b>procedure</b>FreeDataPoints;
<b>var</b>
J, K: Integer;
<b>begin
for</b> K := 0 <b>to</b> Data.Points.Count - 1 <b>do
begin
for</b> J := 0 <b>to</b> TList(Data.Points[K]).Count - 1 <b>do</b>
Dispose(PexpPoint(TList(Data.Points[K]).Items[J]));
TList(Data.Points[K]).Free;
<b>end</b>;
Data.Points.Free;
<b>end</b>;
...
FillChar(Data, SizeOf(Data), 0);
Data.Color := DXF_PURPLE;
Data.Count := High(arrBezier)-Low(arrBezier)+1;
Data.Points := TList.Create;
Data.Points.Add(TList.Create);
<b>for</b> I := 0 <b>to</b> Data.Count - 1 <b>do
begin</b>
New(Pt);
Pt^.X := arrBezier[I].X;
Pt^.Y := -arrBezier[I].Y;
Pt^.Z := 0;
TList(Data.Points[0]).Add(Pt);
<b>end</b>;
vDXF.AddPolyBezier(Data, 0);
FreeDataPoints;
...
Posted: 01 Jun 2006, 17:58
by schulz
Hello Evgeny,
i tried that example, but when i open the dxf-file i have lines(vector) no curves
Best regards
Armin
Posted: 01 Jun 2006, 18:29
by Evgeny
Hello Armin,
Bezier curve parameters are the same as for Widnows PolyBezier function:
Code: Select all
procedure TfmDXFExporter.FormPaint(Sender: TObject);
...
Windows.PolyBezier(Canvas.Handle, arrBezier, countBezier);
...
For direct export please see:
1. Press: "MAke DXF directly" and save to DXF file.
2. Open this file - you will see Bezier curve in Block reference - it is "Spline" entity.
Kind regards,
Evgeny