drawing curve based on mathematical equation

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules
Always indicate Operating system, QCAD version
Attach Drawing files, Screenshots
Post one question per topic.
Post Reply
Charles Dyer
Junior Member
Posts: 14
Joined: Wed Nov 28, 2018 9:17 pm

drawing curve based on mathematical equation

Post by Charles Dyer » Mon Apr 15, 2019 3:21 am

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

User avatar
andrew
Site Admin
Posts: 6406
Joined: Fri Mar 30, 2007 6:07 am

Re: drawing curve based on mathematical equation

Post by andrew » Mon Apr 15, 2019 10:45 am

Yes, using the script interface. Please have a look at this example:
https://qcad.org/en/tutorial-running-sc ... rom-a-file

Charles Dyer
Junior Member
Posts: 14
Joined: Wed Nov 28, 2018 9:17 pm

Re: drawing curve based on mathematical equation

Post by Charles Dyer » Wed Apr 17, 2019 4:21 am

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

User avatar
andrew
Site Admin
Posts: 6406
Joined: Fri Mar 30, 2007 6:07 am

Re: drawing curve based on mathematical equation

Post by andrew » Wed Apr 17, 2019 9:22 am

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.)

Post Reply

Return to “QCAD 'How Do I' Questions”