
Middlepoint on a curve created by AddPathCurve
Re: Middlepoint on a curve created by AddPathCurve
Nice use of the vector lib 

Re: Middlepoint on a curve created by AddPathCurve
Dear Little John, do you have working example?Little John wrote:Oops, I'm too slow.While I was writing an answer, you posted again ...
Well, here is my reply, I hope that it's understandable.
Your image looks impressive.Code: Select all
Procedure AddPathBezierCurve(List Points.struct_Point(), xDisplacement.d = 0, yDisplacement.d = 0) Protected halfLen.d=0.0, temp.d=0.0 ForEach Points() If (Not ListIndex(Points())) MovePathCursor(xDisplacement + Points()\x, yDisplacement + Points()\y) Else Select (ListSize(Points()) - ListIndex(Points())) Case 1 [...] AddPathCurve(x1, y1, x2, y2, x3, y3) halfLen + <length of this Bezier segment As shown before> Case 2 [...] AddPathCurve(x1, y1, x2, y2, x3, y3) halfLen + <length of this Bezier segment As shown before> Default [...] AddPathCurve(x1, y1, x2, y2, x3, y3) halfLen + <length of this Bezier segment As shown before> EndSelect EndIf Next halfLen / 2 ForEach Points() If (Not ListIndex(Points())) ; MovePathCursor(xDisplacement + Points()\x, yDisplacement + Points()\y) Else Select (ListSize(Points()) - ListIndex(Points())) Case 1 [...] temp + <length of this Bezier segment As shown before> If temp > halfLen Break EndIf Case 2 [...] temp + <length of this Bezier segment As shown before> If temp > halfLen Break EndIf Default [...] temp + <length of this Bezier segment As shown before> If temp > halfLen Break EndIf EndSelect EndIf Next excess = temp - halfLen ; The Break took place in the Bezier segment where the midpoint of the whole curve is. ; Now investigate that segment similar as shown before. However, now don't look for ; the midpoint of that segment, but for <length of that segment> - excess. EndProcedure
You might want to look at Danilo's DrawBezierText().Absolutely perfect would be to have the text following the curve [...]
THX
-
- Addict
- Posts: 4778
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Middlepoint on a curve created by AddPathCurve
No, sorry. I only have that sketch of my approach, which was just meant as a suggestion for Didelphodon.l1marik wrote:Dear Little John, do you have working example?