Page 1 of 1

Bézier Curves

Posted: Sun Jan 26, 2014 10:47 am
by Eugene Lutsenko
Somewhere I saw a standard graphics function Alaska, which allows you to build or jagged curves or Bezier curves. But now I can not find it. Could not tell what kind of function?

http://www.jasondavies.com/animated-bezier/

Re: Bézier Curves

Posted: Mon Jan 27, 2014 5:54 am
by Eugene Lutsenko
found:

Code: Select all

// Рисование кривой
// В примере сплайн рисуется из 13 точек. Сопоставление этих точек произведено с помощью маркера и точки соединены  линиями.
 
   #include "Gra.ch" 
 
   PROCEDURE Main 
      LOCAL aPoints, i 
 
      SetColor("N/W")                     // Закрасить окно светло-серым
      CLS 
 
      aPoints := { {  30, 314 }, ;        // Задать точки X,Y сплайна
                   {  80, 106 }, ; 
                   { 130, 110 }, ; 
                   { 180, 164 }, ; 
                   { 230, 172 }, ; 
                   { 280, 257 }, ; 
                   { 330, 203 }, ; 
                   { 380, 274 }, ; 
                   { 430,  58 }, ; 
                   { 480, 109 }, ; 
                   { 530, 144 }, ; 
                   { 580, 250 }, ; 
                   { 630, 138 }  } 
 
      GraSpline( NIL, aPoints, .F. )      // нарисовать сплайн
 
      GraMarker( NIL, aPoints[1] )        // пометить 1-ю точку

 
      FOR i:=2 TO 13                      // пометить другие точки и соединить их линиями
         GraLine( , , aPoints[i] )        // 
         GraMarker( , aPoints[i] ) 
      NEXT 
 
      Inkey(0)                            // ожидание нажатия клавиши
 

RETURN


Re: Bézier Curves

Posted: Mon Jan 27, 2014 7:14 am
by Eugene Lutsenko
In general, what I wanted, I got:

Image
Image

Re: Bézier Curves

Posted: Tue Jan 28, 2014 11:56 am
by Eugene Lutsenko
And if available in Alaska standard means other splines, except Bezier curve?

Re: Bézier Curves

Posted: Tue Jan 28, 2014 2:46 pm
by Auge_Ohr
Eugene Lutsenko wrote:And if available in Alaska standard means other splines, except Bezier curve?
Foundation Xbase++ (without XbTools) does not even have SIN() oder COS() Function to calculate Curve to paint a Grafic...
you can try search in Alaska Newforum for some Math LIB ...

Re: Bézier Curves

Posted: Wed Jan 29, 2014 2:31 am
by reganc
Auge_Ohr wrote:
Eugene Lutsenko wrote:And if available in Alaska standard means other splines, except Bezier curve?
Foundation Xbase++ (without XbTools) does not even have SIN() oder COS() Function to calculate Curve to paint a Grafic...
you can try search in Alaska Newforum for some Math LIB ...
Jimmy

There are SIN() and COS() functions (and a few others) in XbToolsIII...

Re: Bézier Curves

Posted: Wed Jan 29, 2014 6:00 am
by Eugene Lutsenko
So I realized that Jimmy just says that these functions are not included in the basic package of Alaska, but there are only XbToolsIII

Re: Bézier Curves

Posted: Wed Jan 29, 2014 4:50 pm
by Auge_Ohr
hi,

perhaps a 3PP DLL / OCX can help. http://www.mathworks.de
they have some "Curve Fitting Toolbox" ... not sure if it have a COM IDispatch Interface like MathLAB

Re: Bézier Curves

Posted: Fri Jan 31, 2014 3:11 am
by Eugene Lutsenko
Such technologies for me hardly available in connection with my qualifications. But there is also an ideological argument: I think better to try to do without any exotic tools for standard language features. eXpress++ this consideration does not apply, as it organically blended in Alaska or Alaska in it.