Notices
928 Forum 1978-1995
Sponsored by:
Sponsored by: 928 Specialists

Pasha pattered algorithm.

Thread Tools
 
Search this Thread
 
Old 06-30-2019, 01:03 PM
  #1  
drwhosc
Pro
Thread Starter
 
drwhosc's Avatar
 
Join Date: Dec 2007
Location: Spartanburg SC
Posts: 648
Likes: 0
Received 7 Likes on 3 Posts
Default Pasha pattered algorithm.

Was great to see folks at the rendezvous this weekend. As noted., I saw the pasha pattern on the cars and was able to write an algorithm to generate the pattern. I used Visual basic and excel because it was just the most convent way to do things. Basically this process sets a size and a decay percentage. It will run several iterations and use the prior value to either decay or grow. the pattern runs along both the X and Y axis by moving the cell selection one row and one column. the last part is just for coloring the squares. Feel free to experiment and use this how you want. Hope folks find some use.

below is the code you can pop into excel and run visual basic (the copy and paste did not work very well). followed by a screenshot of the output

code -------

Sub pasha()
Dim Seed
Dim Ratio

'this is the size of the initial square. pattern is uneffeted by size, but does deteremin the size of the document.
Seed = 10

'this is the decay and growth ratio. can play around. found things less than 80% not all that great.
Ratio = 0.87

Range("A1").Select

'run 20 itterations. this can set the size of the overlall document
For s = 1 To 20

'this is the diminishing pattern this has to equal the growing pattern and visa versa. 'Found 12 works well. may not be the actual porsche pattern.
For i = 1 To 12

Selection.ColumnWidth = Seed Selection.RowHeight = Seed * 5.33 'the 5.33 ratio is just to overcome excel funkiness Makes the cell square
ActiveCell.Offset(1, 1).Select

'had to fine tune the pattern. you can play with the numbers. but has to equal the grow pattern and visa versa
Select Case i
Case Is < 2 Seed = Seed * Ratio
Case Is < 6 Seed = Seed * (Ratio / 0.99)
Case Is >= 6 Seed = Seed * (Ratio / 0.97)
End Select
Next i

'same as above, but this is the growth sequence
For i = 1 To 12
Selection.ColumnWidth = Seed Selection.RowHeight = Seed * 5.33
ActiveCell.Offset(1, 1).Select
Select Case i
Case Is < 2 Seed = Seed / (Ratio / 0.97)
Case Is < 6 Seed = Seed / (Ratio / 0.99)
Case Is >= 6 Seed = Seed / (Ratio)
End Select

Next i
Seed = 10 'have to reset seed if you change it
Next s

'this will color in the boxes
Range("A1").Select
For s = 1 To 50
For i = 1 To 60
ActiveCell.Interior.Color = black
ActiveCell.Offset(0, 2).Select
Next i
ActiveCell.Offset(2, 0).Select Range(ActiveCell.EntireRow.Address)(1, 1).Select
Next s
Range("A1").Select ActiveCell.Offset(1, 0).Select

For s = 1 To 50 ActiveCell.Offset(0, 1).Select
For i = 1 To 60 ActiveCell.Interior.Color = black
ActiveCell.Offset(0, 2).Select
Next i
ActiveCell.Offset(2, 0).Select Range(ActiveCell.EntireRow.Address)(1, 1).Select
Next s

End Sub

that is it.

Enjoy



this is the pasha pattern output from the code.
The following 5 users liked this post by drwhosc:
checkmate1996 (10-22-2019), Daniel5691 (06-30-2019), fatmanontwowheels (10-23-2019), Hey_Allen (06-30-2019), slate blue (06-30-2019)
Old 06-30-2019, 01:12 PM
  #2  
rexpontius
Burning Brakes
 
rexpontius's Avatar
 
Join Date: Apr 2010
Location: The Netherlands
Posts: 835
Received 49 Likes on 25 Posts
Default

Very cool!
Old 06-30-2019, 01:26 PM
  #3  
Shawn Stanford
Rennlist Member
 
Shawn Stanford's Avatar
 
Join Date: Jun 2010
Location: The Poconos
Posts: 5,254
Received 847 Likes on 466 Posts
Default

Nicely done! There was a long thread in the not-too-distant past that attempted to figure out the Pasha algorithm.
Old 06-30-2019, 01:49 PM
  #4  
linderpat
Rennlist Member
 
linderpat's Avatar
 
Join Date: Nov 2006
Location: Pittsburgh, PA
Posts: 14,467
Received 2,375 Likes on 1,288 Posts
Default

Originally Posted by Shawn Stanford
Nicely done! There was a long thread in the not-too-distant past that attempted to figure out the Pasha algorithm.
Yes, I remember that thread too. This one needs to be combined into that one so that we have this outstanding and important material in one place. That is some amazing program right here
Old 06-30-2019, 01:58 PM
  #5  
GT6ixer
Race Car
 
GT6ixer's Avatar
 
Join Date: Mar 2016
Location: Gig Harbor. WA
Posts: 4,144
Received 783 Likes on 383 Posts
Default

Very Cool! Thanks for putting this together. However there is a small issue with your copy-pasted code above. It combined two lines of code into one line in some cases which causes an error when compiling. I had to manually separate those lines in VB. Here is a copy/paste friendly version of the code with that corrected. Also I changed the "s" run iteration value from 20 to 5 because at 20 I was running out of sheet space. Now it works great! Below is a screen shot of my pasha.

Sub pasha()
Dim Seed
Dim Ratio

'this is the size of the initial square. pattern is unaffected by size, but does determine the size of the document.
Seed = 10

'this is the decay and growth ratio. can play around. found things less than 80% not all that great.
Ratio = 0.87

Range("A1").Select

'run 5 iterations. this can set the size of the overall document
For s = 1 To 5

'this is the diminishing pattern this has to equal the growing pattern and visa versa. 'Found 12 works well. may not be the actual Porsche pattern.
For i = 1 To 12

Selection.ColumnWidth = Seed
Selection.RowHeight = Seed * 5.33 'the 5.33 ratio is just to overcome excel funkiness Makes the cell square
ActiveCell.Offset(1, 1).Select

'had to fine tune the pattern. you can play with the numbers. but has to equal the grow pattern and visa versa
Select Case i
Case Is < 2
Seed = Seed * Ratio
Case Is < 6
Seed = Seed * (Ratio / 0.99)
Case Is >= 6
Seed = Seed * (Ratio / 0.97)
End Select
Next i

'same as above, but this is the growth sequence
For i = 1 To 12
Selection.ColumnWidth = Seed
Selection.RowHeight = Seed * 5.33
ActiveCell.Offset(1, 1).Select
Select Case i
Case Is < 2
Seed = Seed / (Ratio / 0.97)
Case Is < 6
Seed = Seed / (Ratio / 0.99)
Case Is >= 6
Seed = Seed / (Ratio)
End Select

Next i
Seed = 10 'have to reset seed if you change it
Next s

'this will color in the boxes
Range("A1").Select
For s = 1 To 50
For i = 1 To 60
ActiveCell.Interior.Color = black
ActiveCell.Offset(0, 2).Select
Next i
ActiveCell.Offset(2, 0).Select
Range(ActiveCell.EntireRow.Address)(1, 1).Select
Next s
Range("A1").Select
ActiveCell.Offset(1, 0).Select

For s = 1 To 50
ActiveCell.Offset(0, 1).Select
For i = 1 To 60
ActiveCell.Interior.Color = black
ActiveCell.Offset(0, 2).Select

Next i
ActiveCell.Offset(2, 0).Select
Range(ActiveCell.EntireRow.Address)(1, 1).Select
Next s

End Sub



Old 06-30-2019, 02:35 PM
  #6  
GT6ixer
Race Car
 
GT6ixer's Avatar
 
Join Date: Mar 2016
Location: Gig Harbor. WA
Posts: 4,144
Received 783 Likes on 383 Posts
Default

For those at home that have Excel but might not be as familiar with Visual Basic (VB) here is a step-by-step procedure to add DrWho's pasha code to an Excel spreadsheet.

First open Excel and press alt plus F11. This will open up the VB window seen below.



Second right click on "VBAProject (Book1)" and and mouse over "Insert" and then click on "Module" as seen below.



A module window to the right will now be active.



Now go and copy the code from post #5 and paste it in the Module window as seen below.



You can now close the VB window and go back to your spreadsheet. Once there, click on the "View" tab in the ribbon and select "View Macros" from the "Macros" button. If you don't see a Macros button you can alternatively press alt plus F8.



After selecting "View Macros" (or pressing alt plus F8) the Macro dialog box shown below will appear. You will see the "pasha" macro listed. Now just click "Run" and watch the magic happen!

The following 2 users liked this post by GT6ixer:
checkmate1996 (10-22-2019), uraniummetallurgist (07-16-2019)
Old 06-30-2019, 02:41 PM
  #7  
77tony
Rennlist Member
 
77tony's Avatar
 
Join Date: Aug 2010
Location: USA
Posts: 8,428
Received 156 Likes on 118 Posts
Default

Will this^^translate printing out onto black/brown material thats NLA ?
Old 06-30-2019, 03:42 PM
  #8  
Shawn Stanford
Rennlist Member
 
Shawn Stanford's Avatar
 
Join Date: Jun 2010
Location: The Poconos
Posts: 5,254
Received 847 Likes on 466 Posts
Default

Originally Posted by 77tony
Will this^^translate printing out onto black/brown material thats NLA ?
Yeah, it will. What's going on here is that the cells are being resized and, in some cases, recolored to black, leaving the white cells as they are. To get black/brown, select your entire spreadsheet and set the background color to the brown you want and then run the program.
Old 06-30-2019, 06:03 PM
  #9  
drwhosc
Pro
Thread Starter
 
drwhosc's Avatar
 
Join Date: Dec 2007
Location: Spartanburg SC
Posts: 648
Likes: 0
Received 7 Likes on 3 Posts
Default

GT 6ixer. thanks for the proofing. I was very disappointed that the paste function took out all there returns. I tried as best as I could to to get it right, but thought there would be a bug or two, there always is. I am sure some folks on the board will know more about printing on fabric. I personally want to etch this in leather like Paul used to do. Need to recover my septs in a year or so. I am, pretty sure you can size up the pattern in any thing you want my changing some of the variables, and get that to a printer.
Old 06-30-2019, 09:34 PM
  #10  
Bigfoot928
Drifting
 
Bigfoot928's Avatar
 
Join Date: Mar 2013
Posts: 3,290
Received 294 Likes on 185 Posts
Default

Kind of makes you wonder how they came up with something so complex mathematically in the 70's. Especially for a cloth pattern.
Old 07-04-2019, 12:57 AM
  #11  
928 GT R
Rennlist Member
 
928 GT R's Avatar
 
Join Date: Sep 2006
Location: Back 0 Beyond
Posts: 6,072
Received 5,365 Likes on 2,062 Posts
Default

Originally Posted by drwhosc
Was great to see folks at the rendezvous this weekend. As noted., I saw the pasha pattern on the cars and was able to write an algorithm to generate the pattern. I used Visual basic and excel because it was just the most convent way to do things. Basically this process sets a size and a decay percentage. It will run several iterations and use the prior value to either decay or grow. the pattern runs along both the X and Y axis by moving the cell selection one row and one column. the last part is just for coloring the squares. Feel free to experiment and use this how you want. Hope folks find some use.

below is the code you can pop into excel and run visual basic (the copy and paste did not work very well). followed by a screenshot of the output

code -------

Sub pasha()
Dim Seed
Dim Ratio

'this is the size of the initial square. pattern is uneffeted by size, but does deteremin the size of the document.
Seed = 10

'this is the decay and growth ratio. can play around. found things less than 80% not all that great.
Ratio = 0.87

Range("A1").Select

'run 20 itterations. this can set the size of the overlall document
For s = 1 To 20

'this is the diminishing pattern this has to equal the growing pattern and visa versa. 'Found 12 works well. may not be the actual porsche pattern.
For i = 1 To 12

Selection.ColumnWidth = Seed Selection.RowHeight = Seed * 5.33 'the 5.33 ratio is just to overcome excel funkiness Makes the cell square
ActiveCell.Offset(1, 1).Select

'had to fine tune the pattern. you can play with the numbers. but has to equal the grow pattern and visa versa
Select Case i
Case Is < 2 Seed = Seed * Ratio
Case Is < 6 Seed = Seed * (Ratio / 0.99)
Case Is >= 6 Seed = Seed * (Ratio / 0.97)
End Select
Next i

'same as above, but this is the growth sequence
For i = 1 To 12
Selection.ColumnWidth = Seed Selection.RowHeight = Seed * 5.33
ActiveCell.Offset(1, 1).Select
Select Case i
Case Is < 2 Seed = Seed / (Ratio / 0.97)
Case Is < 6 Seed = Seed / (Ratio / 0.99)
Case Is >= 6 Seed = Seed / (Ratio)
End Select

Next i
Seed = 10 'have to reset seed if you change it
Next s

'this will color in the boxes
Range("A1").Select
For s = 1 To 50
For i = 1 To 60
ActiveCell.Interior.Color = black
ActiveCell.Offset(0, 2).Select
Next i
ActiveCell.Offset(2, 0).Select Range(ActiveCell.EntireRow.Address)(1, 1).Select
Next s
Range("A1").Select ActiveCell.Offset(1, 0).Select

For s = 1 To 50 ActiveCell.Offset(0, 1).Select
For i = 1 To 60 ActiveCell.Interior.Color = black
ActiveCell.Offset(0, 2).Select
Next i
ActiveCell.Offset(2, 0).Select Range(ActiveCell.EntireRow.Address)(1, 1).Select
Next s

End Sub

that is it.

Enjoy



this is the pasha pattern output from the code.
Fantastic! I'm not an expert on how to do this but can someone put/paste this post/thread onto the Pasha thread?

>
Old 07-04-2019, 01:29 AM
  #12  
RSMartin
Burning Brakes
 
RSMartin's Avatar
 
Join Date: Mar 2016
Location: Marietta,Ga
Posts: 996
Received 557 Likes on 264 Posts
Default I see................. SMART people

Now that this has been converted for those of less or depleted brain matter, we will see it's rebirth in everything.
Old 07-04-2019, 02:03 AM
  #13  
NoVector
Rennlist Member
 
NoVector's Avatar
 
Join Date: Oct 2004
Location: K-town, Germany
Posts: 2,897
Likes: 0
Received 301 Likes on 152 Posts
Default

A lot of possibilities... Happy 4th of July.

Old 07-04-2019, 01:03 PM
  #14  
SeanR
Rennlist Member
 
SeanR's Avatar
 
Join Date: Apr 2006
Posts: 35,700
Received 500 Likes on 267 Posts
Default

When you opened your computer to show me that as we were sitting at the table, I thought it was a good thing I didn't suffer from vertigo. Neat stuff man.
Old 07-04-2019, 10:54 PM
  #15  
drwhosc
Pro
Thread Starter
 
drwhosc's Avatar
 
Join Date: Dec 2007
Location: Spartanburg SC
Posts: 648
Likes: 0
Received 7 Likes on 3 Posts
Default

good job... hope the code was easy to follow. i like the palette...


Quick Reply: Pasha pattered algorithm.



All times are GMT -3. The time now is 10:25 PM.