Page 1 of 1

drawing curve based on mathematical equation

Posted: Mon Apr 15, 2019 3:21 am
by Charles Dyer
QCAD Pro 3.21.3.15 on Ubuntu 16.04

Is it possible to draw a curve based on mathematical equations?

As a simple example, I need to draw a family of hyperbolas with the same asymptotes. Similarly, I need to draw some ellipses.

The equations can be given in parametric form for x and y coordinates, for example.

Is it possible to do this in qcad?

Thanks, and cheers,

- charles

Re: drawing curve based on mathematical equation

Posted: Mon Apr 15, 2019 10:45 am
by andrew
Yes, using the script interface. Please have a look at this example:
https://qcad.org/en/tutorial-running-sc ... rom-a-file

Re: drawing curve based on mathematical equation

Posted: Wed Apr 17, 2019 4:21 am
by Charles Dyer
Thanks for the help and suggestion.

In some cases it would be useful to be able to pass arguments to such a function in some way. I am new to this area, and I have not yet come across the way to do this. Where is the best place to look further for such functionality.

While the capability of writing such functions in C is very good, given the rapid expansion of Python into so many areas, is there any plan to add Python as a language in which one can write such functions?

Thanks very much for you help with this.

Cheers,

- charles

Re: drawing curve based on mathematical equation

Posted: Wed Apr 17, 2019 9:22 am
by andrew
As soon as you want the user to be able to input something (enter values, click coordinates, etc.) you're looking at an interactive script:
https://qcad.org/en/tutorial-interactive-script-actions

This is all ECMAScript (JavaScript) by the way, not C.

No plans for Python (or Ruby, Haskell, LISP, etc.)