Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: "Shortest Vector setting" - zero isnt short enough for me
kongorilla
Pro
Posts: 362
Permalink
kongorilla
Post "Shortest Vector setting" - zero isnt short enough for me
on: June 28, 2015, 11:45
Quote

Hey Sandy -
I'm trying to do a stipple drawing. Unlike the circle stipples you get out of Stipplegen, I'm trying to draw stipples that are made of short line segments -- many of them are very short (the end points are never coincident, though). Even though I have "Shortest Vector" set to "0," and I can see the vectors in the controller preview window, many of the shorter stipple segments aren't being drawn.

I'm guessing that after a certain number of decimal points, "very very short" becomes "zero." Is that a sound theory?

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: "Shortest Vector setting" - zero isnt short enough for me
on: June 28, 2015, 12:15
Quote

Pretty much, but I think it's just anything less-than-one becomes zero. I've just looked back over this code, and it's actually not as stupid as I expected it to be, but it's still inclined to discard points rather than keep them. The offending block is here:

    for (int j = 1; j<scaled.size(); j++)
    {
      // and even then, only bother drawing if it's a move of over "x" steps
      int diffx = int(p.x) - int(result.get(result.size()-1).x);
      int diffy = int(p.y) - int(result.get(result.size()-1).y);

      if (abs(diffx) > filterParam || abs(diffy) > filterParam)
      {
        //println("Adding point " + p + ", last: " + result.get(result.size()-1));
        result.add(p);
      }
     }

( The code above comes out as junk, but it's pretty here: https://github.com/euphy/polargraphcontroller/blob/master/drawing.pde#L913-L925)

The above is essentially cycling through all the points in the line and measuring the distance from the current point to the next one, and only adding the point to the queue if the distance is greater than filterParam (which is equal to minimumVectorLength).

I think the problem here is that these calculations are all done using integer maths, so they naturally round down, and in these edge cases, round down to 0.

You can cut out this filter completely, and it might build points, but they still might not be expressible by the machine (because it's sub-step resolution), but worth a try. Change that block of code above to

    for (int j = 1; j<scaled.size(); j++)
    {
      result.add(scaled.get(j));
    }

(Or rather comment the old block out, and put the new block in - in case you want to go back.)

The internal resolution of the polargraph is 8x the external addressable resolution, so that might work actually - depends how the numbers get rounded when building the actual queue.

hey let us know!
sn

kongorilla
Pro
Posts: 362
Permalink
kongorilla
Post Re: "Shortest Vector setting" - zero isnt short enough for me
on: June 28, 2015, 22:20
Quote

Thank you, my friend! It's too early in the drawing for me to be absolutely sure, but it appears all the wee dots are being added to the queue.

My poor servo. (Note to self: buy a backup servo).

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: "Shortest Vector setting" - zero isnt short enough for me
on: June 28, 2015, 23:40
Quote

Huzzah! To die drawing stipples, is a servo's bold dream.

alpal
Newbie
Posts: 19
Permalink
Post Re: "Shortest Vector setting" - zero isnt short enough for me
on: March 21, 2016, 18:57
Quote

Hi Sandy, kong,
i have the same issue. I would like to Change the Minimum vector Setting. With shortest vector set to 0 it still skips a number of control Points. The code tweeking Needs to be done in processing i assume..and ist here were my Problems Begins. I installed the necessary libraries and coplied them in the necessary Folders as described in numerous Posts. I see a common Problem is also Java 32vs64bit. I am able to run polargraphcontroller.exe so therefore dont think thats the issue. When i run polargraphcontroller in processing it tells me "the size of the sketch could not be determined" and gives me numerous Problems. i was wondering if there is way to Change the Minimum vector lenght without having to Change it in processing?

thanks in advance
Alpal

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: "Shortest Vector setting" - zero isnt short enough for me
on: March 21, 2016, 20:12
Quote

Any chance you're using Processing v3?

https://github.com/euphy/polargraph/wiki/Running-the-controller-from-source-code

Pages: [1]
Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.028 seconds.