Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Parametric curves
#9
(03-12-2020, 11:02 PM)Ofnuts Wrote: Trying to do a simple linear spiral with the polar curve script. So, in the GUI;

Code:
r(t)=t/10.
start=0.
end=2*N*pi

For a few turns (N<=5), the result is nice, but around N=8 things start to degrade, this is N=9:


...

TBH I'm surprised by the low number of anchors, about two anchors per turn, even at level 10.

Thanks for trying the plugin.

You are quite right. This is the problem with the simple plugin. The better plugin that I shall publish later will be able to handle such cases right away. The simple plugin needs help from the user.

The problem is explained in Example 2.5 at the end of doc.pdf, and there is also the remedy. To draw a spiral arc you had better not to try arcs longer than 90 degrees. But the simple plugin has no other way to divide the spiral than to split it in two recursively. And I put there a hard-coded limit for the recursion depth, just to avoid infinite loops. If we run your spiral with N=10 setting 'display messages' to Yes, we get in the error console a long list of strange error messages, and the last one is:

The algorithm reached maximum allowed
recursion depth (=4) 16 times
The result may be wrong!

And now the remedy. It is to input a list of custom parameter values. It is possible in the GUI, but easier is to write a file where the inputs are. As follows:
Code:
N=10

def function(t):
   #r(t)=t/10.
   return t/10.

start=0.
end=2*N*pi

interval = [start, end]

custom_params = [k*pi/2 for k in range(4*N)]

scale = 50

Then the result is the following (I try to get a picture here)

   

The idea is that when the plugin gets such a list of custom parameter values, then first, before doing anything else, it divides the curve at those points. Only then it goes to work, doing recusions etc. So when we choose the points so that the arcs between are not more than 90 degrees, the plugin manages well.

There is the field in the GUI: "Chosen values of t ... " (admittedly not very well formulated text) where you could put the list as  pi/2, pi, 3*pi/2, 2*pi, ...  but for large N that is not practical. So make a file where the inputs are. There are also the example files or doc.pdf to look at.

When you write the inputs in a file, then to use the file do: In the GUI click "Read inputs from a file" to Yes, and then use the next field to choose the file. The format of the input file is described in doc.pdf.
Reply


Messages In This Thread
Parametric curves - by Ottia Tuota - 03-12-2020, 01:21 PM
RE: Parametric curves - by Ofnuts - 03-12-2020, 03:04 PM
RE: Parametric curves - by denzjos - 03-12-2020, 03:23 PM
RE: Parametric curves - by Ofnuts - 03-12-2020, 08:52 PM
RE: Parametric curves - by Ottia Tuota - 03-12-2020, 05:00 PM
RE: Parametric curves - by Ottia Tuota - 03-12-2020, 06:38 PM
RE: Parametric curves - by Ottia Tuota - 03-13-2020, 05:03 AM
RE: Parametric curves - by Ottia Tuota - 03-13-2020, 01:25 PM
RE: Parametric curves - by Ofnuts - 03-12-2020, 11:02 PM
RE: Parametric curves - by Ottia Tuota - 03-13-2020, 06:17 AM
RE: Parametric curves - by Ofnuts - 03-13-2020, 08:37 PM
RE: Parametric curves - by Ottia Tuota - 03-14-2020, 06:38 AM
RE: Parametric curves - by Ofnuts - 03-14-2020, 08:29 AM
RE: Parametric curves - by Ottia Tuota - 03-14-2020, 03:11 PM
RE: Parametric curves - by Ottia Tuota - 03-15-2020, 12:29 PM
RE: Parametric curves - by Ottia Tuota - 03-19-2020, 06:56 AM
RE: Parametric curves - by Ottia Tuota - 03-19-2020, 07:48 PM

Forum Jump: