• Re: Back & Forth - A programming tale in graphic detail

    From Buzz McCool@21:1/5 to Hans Bezemer on Wed Jan 29 10:49:49 2025
    On 1/18/2025 7:52 AM, Hans Bezemer wrote:
    Ever tried to create a graphics library - only to find that even drawing
    a simple line requires a degree in mathematics? What if I tell you you
    can make a fully fledged graphics library in less than 200 lines,
    providing high quality vector graphics files which can be used in a
    plethora of application programs?

    https://youtu.be/_MKFQIHm_ss

    Hans -

    I believe you said in passing that you didn't like PostScript, but
    didn't elaborate. Just curious if you have any detailed comments about
    using PostScript for graphics.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@21:1/5 to All on Wed Jan 29 19:07:53 2025
    Nice to see somenone coping with graphics in Forth!

    Just to mention a different approach using an external
    plotting library:
    https://www.dislin.de/index.html

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to minforth on Thu Jan 30 14:55:38 2025
    In article <02591b0a10d44b799c1d99f47ca64442@www.novabbs.com>,
    minforth <minforth@gmx.net> wrote:
    Nice to see somenone coping with graphics in Forth!

    Just to mention a different approach using an external
    plotting library:
    https://www.dislin.de/index.html

    Maybe I'm strange but I do believe they can't say they support SUSE.
    There must be a canvas to draw line on. At least this must
    be SUSE + X windows system.
    Nowadays there is talk of Wayland. It is another concession to MS-Windows
    where the terminal is drawn into the kernel (for speed and gaming).
    Things foreseen, X may no longer work in the future as far as I
    can tell.

    Groetjes Albert
    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to albert@spenarnc.xs4all.nl on Thu Jan 30 15:20:56 2025
    In article <nnd$4a833881$5594a625@23fe4f00fa62d734>,
    <albert@spenarnc.xs4all.nl> wrote:
    In article <02591b0a10d44b799c1d99f47ca64442@www.novabbs.com>,
    minforth <minforth@gmx.net> wrote:
    Nice to see somenone coping with graphics in Forth!

    Just to mention a different approach using an external
    plotting library:
    https://www.dislin.de/index.html

    Maybe I'm strange but I do believe they can't say they support SUSE.
    There must be a canvas to draw line on. At least this must
    be SUSE + X windows system.

    I spoke too soon. There it is in the middle of the introduction.
    "
    The supported display types are VGA, X Windows, Windows API and OpenGL.
    "
    Sincere apologies to Helmit Michels.

    Nowadays there is talk of Wayland. It is another concession to MS-Windows >where the terminal is drawn into the kernel (for speed and gaming).
    Things foreseen, X may no longer work in the future as far as I
    can tell.
    The conclusion is that it may not work on Wayland, and this is documented.

    gforth mpeforth can use it, because they support run time linking to
    shared object libraries in Linux.
    I can do this in Microsoft ("dll"), but there I can ignore the
    types of parameters. What is present in gforth adds type protection to
    calls, which forces type protection into Forth which is pain.
    Type information is not helpful. What helps is specifying out of order
    what I supply is
    dll calls are simple:
    call[ x par5 R> par3 .... handle call]

    This means that it is easier to use dislink on ms-windows than on linux.



    Groetjes Albert
    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.
    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to Hans Bezemer on Thu Jan 30 22:51:12 2025
    Hans Bezemer <the.beez.speaks@gmail.com> writes:
    [Postscript]
    Didn't
    feel like I could quickly get that one going, so I moved to the next
    option. And yes, I immediately fell in love with SVG.

    Of course I don't think it's impossible to get things going in PS, the >question is - how much time do I want to put into it? Especially if I
    got the functionality of vector graphics covered.

    Exactly the reason why I have never looked into SVG. I already knew
    PostScript years before SVG was released.

    One of the big benefits of Postscript is that it is a full-blown
    programming language, not just a graphics description language. E.g.,
    when doing a graph that shows some of my measurement results, I put
    all the measurement results in, and then select from these
    measurements the data relevant for the graph, and display them as
    appropriate. E.g., Figures 8-12 of <https://drops.dagstuhl.de/storage/00lipics/lipics-vol313-ecoop2024/LIPIcs.ECOOP.2024.14/LIPIcs.ECOOP.2024.14.pdf>
    all include the same data, it's just what's selected and displayed
    that's different.

    You can find some graphs for getting started in <https://www.complang.tuwien.ac.at/anton/eps-gallery/>.

    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
    comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: https://forth-standard.org/
    EuroForth 2023 proceedings: http://www.euroforth.org/ef23/papers/
    EuroForth 2024 proceedings: http://www.euroforth.org/ef24/papers/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to Buzz McCool on Thu Jan 30 23:08:59 2025
    Buzz McCool <buzz_mccool@yahoo.com> writes:
    Just curious if you have any detailed comments about
    using PostScript for graphics.

    Postscript is great for producing a vector graphics picture. It's not
    designed for animation, and I don't remommend that usage, but you can
    get a little bit done in that direction when running with ghostscript.

    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
    comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: https://forth-standard.org/
    EuroForth 2023 proceedings: http://www.euroforth.org/ef23/papers/
    EuroForth 2024 proceedings: http://www.euroforth.org/ef24/papers/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to the.beez.speaks@gmail.com on Fri Jan 31 12:12:15 2025
    In article <nnd$4b3bccb2$6e4505f6@a25ca100dba5e51f>,
    Hans Bezemer <the.beez.speaks@gmail.com> wrote:
    On 29-01-2025 19:49, Buzz McCool wrote:
    On 1/18/2025 7:52 AM, Hans Bezemer wrote:
    Ever tried to create a graphics library - only to find that even
    drawing a simple line requires a degree in mathematics? What if I tell
    you you can make a fully fledged graphics library in less than 200
    lines, providing high quality vector graphics files which can be used
    in a plethora of application programs?

    https://youtu.be/_MKFQIHm_ss

    Hans -

    I believe you said in passing that you didn't like PostScript, but
    didn't elaborate. Just curious if you have any detailed comments about
    using PostScript for graphics.

    Not really. It was actually as brief as I described in the video. Didn't
    feel like I could quickly get that one going, so I moved to the next
    option. And yes, I immediately fell in love with SVG.

    Of course I don't think it's impossible to get things going in PS, the >question is - how much time do I want to put into it? Especially if I
    got the functionality of vector graphics covered.

    I did some programming almost directly in PostScript (Rotterdam Harbour)
    I could draw the harbour almost directly from the sql database that contains the boundaries between water and land. PostScript did not mind that
    there are details that are contained in one pixel.
    I produced maps where the color was indicative how much chance you got from being killed by a disaster involving chemicals on ships. Also maps where a toxic waste distribution was colored in.
    It was relatively easy to use real coordinates, using a matrix multiplication to generate paper coordinates.
    Some maths required but no too much.

    Having some pipes to a display postscript terminal could be the easiest
    way to get graphics done in Forth.

    dislin looks attractive too. The python examples could be realitively
    easy to convert to wina using dll interface, with regexp transformation. Apparently all windows examples links to dislin.dll.
    The wina examples then directly call the dll's.

    Mnemonics tables using postscript are part of ciasdis.
    The advantage that you
    could have a mnemonic movi with hex code 8F and draw it in place
    row 8 column F with bother for the order.
    If you have double assigned mnemonics, or holes, that is apparent.

    I recently made illustrations of how to draw sine and calculate pi for
    a Forth lecture. Some time ago illustrations for continued fractions,
    where points in a grid show a rational approximation.

    Quite fond of PostScript and it has the reverse polish mindset.


    Hans Bezemer

    Groetjes Albert
    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)