03-13-2020, 06:17 AM
(This post was last modified: 03-13-2020, 06:41 AM by Ottia Tuota.)
(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.