Software that makes placemats

Organise events to meet up and drink Port. You may, of course, forego the drinking and just meet, but we're sure that drinking would be more fun.

Re: Software that makes placemats

Postby AHB » 21:25 Thu 20 Oct 2011

AHB wrote:
jdaw1 wrote:You should delight that, at no effort to yourself, TPF’s finest minds are keeping me in check. Express joy.

This is true. I apologise for my earlier, churlish comment. My thanks and appreciation go to those able to contribute meaningfully to this thread and keep Julian challenged and in check.


I raise a glass of port to the good health of you all. Cheers!
2013 Vintage Port of the year (so far) - Quinta do Noval 1931
2012 Vintage Port of the year - 1927 Graham and 1922 Warre
User avatar
AHB
Dow 1970
 
Posts: 6309
Joined: 12:41 Mon 25 Jun 2007
Location: Berkshire, UK

Re: Software that makes placemats

Postby jdaw1 » 18:24 Sun 23 Oct 2011

In a sheet for displaying corks, what should be the default minimum space required per cork? Three inches across? And how much vertical space? (The algorithm will be efficient about space usage, but the minima are important.)
User avatar
jdaw1
Quinta do Noval Nacional 1962
 
Posts: 11323
Joined: 14:03 Thu 21 Jun 2007
Location: London

Re: Software that makes placemats

Postby jdaw1 » 22:08 Sun 23 Oct 2011

RAYC wrote:if it's ready in time, i can try next month for the GC-SW-QH tasting. But i appreciate this is non-essential!
In the GC/SW/QH triple vertical thread, jdaw1 wrote:Updated draft of the placemats.
The manual has not yet been updated, but will be soon.

I hope that people appreciate that this functionality diminished my cellar by a very fine bottle of T77. The sacrifices one makes.
User avatar
jdaw1
Quinta do Noval Nacional 1962
 
Posts: 11323
Joined: 14:03 Thu 21 Jun 2007
Location: London

Re: Software that makes placemats

Postby jdaw1 » 20:21 Mon 24 Oct 2011

jdaw1 wrote:The manual has not yet been updated, but will be soon.
Some minor fixes to the new code, and manual updated. Please use the latest code.
User avatar
jdaw1
Quinta do Noval Nacional 1962
 
Posts: 11323
Joined: 14:03 Thu 21 Jun 2007
Location: London

Re: Software that makes placemats

Postby RAYC » 22:40 Mon 24 Oct 2011

jdaw1 wrote:I hope that people appreciate that this functionality diminished my cellar by a very fine bottle of T77. The sacrifices one makes.


Probably not as much as you appreciated it!
Rob C.
User avatar
RAYC
Martinez 1985
 
Posts: 1429
Joined: 22:50 Tue 04 May 2010
Location: London

Re: Software that makes placemats

Postby jdaw1 » 22:22 Tue 25 Oct 2011

I have an algorithm problem.

We need a known number of cork-display rectangles, this being computed using CorkDisplayNumCopies and CorkDisplaySpaceForNumExtras. We need to compute how many rows and columns go on each page, subject to CorkDisplayMinWidth and CorkDisplayMinHeight.

So the code loops over /Portrait and /Landscape, computing available space, and loop over numbers of rows and columns:
• Preferring possibilities that meet the CorkDisplayMinWidth and CorkDisplayMinHeight constraints.
• Within those, preferring those requiring as few pages as possible.
• Within those, preferring those for which each rectangle has maximal area.

It’s not bad, but the area preference is wrong, because it has no bias towards rectangles being of the ratio implied by the minima (tall and thin being unhelpful, for example). So, relabelling the minima as H and W, both positive, I want to maximise over positive h and w a function f[h,w,H,W] satisfying:
• f[h,w,H,W] = f[w,h,W,H];
• ∂f[h,w,H,W]/∂h > 0;
• ∂f[h,w,H,W]/∂w > 0;
w/W > h/H ⇔ ∂f[h,w,H,W]/∂h > ∂f[h,w,H,W]/∂w, equality implying equality.
What should be f[…]? I’m stumped. Suggestions please.
User avatar
jdaw1
Quinta do Noval Nacional 1962
 
Posts: 11323
Joined: 14:03 Thu 21 Jun 2007
Location: London

Re: Software that makes placemats

Postby RAYC » 22:47 Tue 25 Oct 2011

jdaw1 wrote:I have an algorithm problem.

We need a known number of cork-display rectangles, this being computed using CorkDisplayNumCopies and CorkDisplaySpaceForNumExtras. We need to compute how many rows and columns go on each page, subject to CorkDisplayMinWidth and CorkDisplayMinHeight.

So the code loops over /Portrait and /Landscape, computing available space, and loop over numbers of rows and columns:
• Preferring possibilities that meet the CorkDisplayMinWidth and CorkDisplayMinHeight constraints.
• Within those, preferring those requiring as few pages as possible.
• Within those, preferring those for which each rectangle has maximal area.

It’s not bad, but the area preference is wrong, because it has no bias towards rectangles being of the ratio implied by the minima (tall and thin being unhelpful, for example). So, relabelling the minima as H and W, both positive, I want to maximise over positive h and w a function f[h,w,H,W] satisfying:
• f[h,w,H,W] = f[w,h,W,H];
• ∂f[h,w,H,W]/∂h > 0;
• ∂f[h,w,H,W]/∂w > 0;
w/W > h/H ⇔ ∂f[h,w,H,W]/∂h > ∂f[h,w,H,W]/∂w, equality implying equality.
What should be f[…]? I’m stumped. Suggestions please.


I suggest the formation of a working group chaired by AHB :D
Rob C.
User avatar
RAYC
Martinez 1985
 
Posts: 1429
Joined: 22:50 Tue 04 May 2010
Location: London

Re: Software that makes placemats

Postby PhilW » 09:34 Wed 26 Oct 2011

jdaw1 wrote:What should be f[…]? I’m stumped. Suggestions please.

Perhaps:
f(h,w)=wh/(ah+bw) for all h>=H,w>=W else 0 (invalid)
where a,b are positive constants essentially defining the ideal ratio; a>b, perhaps a=kb where k>1.0, likely ~2.
231307/130501 - it's almost exactly the square root of pi
PhilW
Graham’s The Tawny
 
Posts: 440
Joined: 13:22 Wed 15 Dec 2010
Location: Near Cambridge, UK

Re: Software that makes placemats

Postby AHB » 05:55 Thu 27 Oct 2011

RAYC wrote:I suggest the formation of a working group chaired by AHB :D

I would be delighted to chair such a group, hereby known as the Taylor '77 Working Group.
2013 Vintage Port of the year (so far) - Quinta do Noval 1931
2012 Vintage Port of the year - 1927 Graham and 1922 Warre
User avatar
AHB
Dow 1970
 
Posts: 6309
Joined: 12:41 Mon 25 Jun 2007
Location: Berkshire, UK

Re: Software that makes placemats

Postby jdaw1 » 06:03 Thu 27 Oct 2011

An opening question for the Taylor 1977 Working Group (‘T77WG’?):
jdaw1 wrote:In a sheet for displaying corks, what should be the default minimum space required per cork? Three inches across? And how much vertical space? (The algorithm will be efficient about space usage, but the minima are important.)
We need the help of somebody who is expert in the handling of broken corks.
User avatar
jdaw1
Quinta do Noval Nacional 1962
 
Posts: 11323
Joined: 14:03 Thu 21 Jun 2007
Location: London

Re: Software that makes placemats

Postby AHB » 06:41 Thu 27 Oct 2011

My suggestion would be to use a minimum length of 3 inches and a minimum width of 2 inches. These dimensions should allow all pieces of a fragmented cork to be reasonably contained in the rectangle.
2013 Vintage Port of the year (so far) - Quinta do Noval 1931
2012 Vintage Port of the year - 1927 Graham and 1922 Warre
User avatar
AHB
Dow 1970
 
Posts: 6309
Joined: 12:41 Mon 25 Jun 2007
Location: Berkshire, UK

Re: Software that makes placemats

Postby jdaw1 » 06:52 Thu 27 Oct 2011

So you prefer a portrait display to landscape? I am surprised.
User avatar
jdaw1
Quinta do Noval Nacional 1962
 
Posts: 11323
Joined: 14:03 Thu 21 Jun 2007
Location: London

Re: Software that makes placemats

Postby jdaw1 » 06:58 Thu 27 Oct 2011

PhilW wrote:f(h,w)=wh/(ah+bw)
An excellent form. It doesn’t quote solve the problem as asked, but if one is instead differentiating with respect to Ln[h] and Ln[w], so considering proportionate increases, it works well.

f[h,w,H,W] = h w /( W h + H w ), or –1 if the denominator is ≤0.

This is increasing in both h and w. It can be rearranged to be a constant times a function of (h/H) and (w/W), and is faster increasing in the smaller of these.

Thank you. To be implemented at the next opportunity.
User avatar
jdaw1
Quinta do Noval Nacional 1962
 
Posts: 11323
Joined: 14:03 Thu 21 Jun 2007
Location: London

Re: Software that makes placemats

Postby AHB » 10:31 Thu 27 Oct 2011

jdaw1 wrote:So you prefer a portrait display to landscape? I am surprised.

I've mentally tried both layouts and while I don't feel very strongly one way or the other, I did find myself naturally holding a sheet of A4 in portrait form as the more natural form. However, i do accept that others may feel more strongly inclined to the landscape format.
2013 Vintage Port of the year (so far) - Quinta do Noval 1931
2012 Vintage Port of the year - 1927 Graham and 1922 Warre
User avatar
AHB
Dow 1970
 
Posts: 6309
Joined: 12:41 Mon 25 Jun 2007
Location: Berkshire, UK

Re: Software that makes placemats

Postby jdaw1 » 10:38 Thu 27 Oct 2011

Think not of the paper, but of the rectangle to hold the cork or cork pieces. That rectangle could be landscape, even on a portrait page (e.g., two columns and four rows). Should the rectangle be portrait or landscape?
User avatar
jdaw1
Quinta do Noval Nacional 1962
 
Posts: 11323
Joined: 14:03 Thu 21 Jun 2007
Location: London

Re: Software that makes placemats

Postby PhilW » 16:32 Thu 27 Oct 2011

jdaw1 wrote:
PhilW wrote:f(h,w)=wh/(ah+bw)
An excellent form. It doesn’t quote solve the problem as asked, but if one is instead differentiating with respect to Ln[h] and Ln[w], so considering proportionate increases, it works well.

f[h,w,H,W] = h w /( W h + H w ), or –1 if the denominator is ≤0.

This is increasing in both h and w. It can be rearranged to be a constant times a function of (h/H) and (w/W), and is faster increasing in the smaller of these.

Thank you. To be implemented at the next opportunity.

Minor note
f[h,w,H,W] = h w /( W h + aH w )
where a>0 (or scaled by rearrangement) would allow for the optimum proportion being potentially different from the ratio of the minimum values.
jdaw1 wrote:Think not of the paper, but of the rectangle to hold the cork or cork pieces. That rectangle could be landscape, even on a portrait page (e.g., two columns and four rows). Should the rectangle be portrait or landscape?

I'd suggest landscape rectangles for preference, whether page is landscape or portrait.
231307/130501 - it's almost exactly the square root of pi
PhilW
Graham’s The Tawny
 
Posts: 440
Joined: 13:22 Wed 15 Dec 2010
Location: Near Cambridge, UK

Re: Software that makes placemats

Postby jdaw1 » 23:14 Fri 28 Oct 2011

jdaw1 wrote:To be implemented at the next opportunity.
Done.
Code: Select all
/CDSizeScore  % http://www.ThePortForum.com/viewtopic.php?t=175&start=205
   CDHeightOneCork CDWidthOneCork mul
   CorkDisplayMinWidth 0 gt  CorkDisplayMinHeight 0 gt  and
   {
      CorkDisplayMinWidth CDHeightOneCork mul  CorkDisplayMinHeight CDWidthOneCork mul  add  dup 0 gt {div} {pop pop -1} ifelse
   } if  % positive minima
def  % /CDSizeScore
User avatar
jdaw1
Quinta do Noval Nacional 1962
 
Posts: 11323
Joined: 14:03 Thu 21 Jun 2007
Location: London

Re: Software that makes placemats

Postby PhilW » 09:53 Sun 30 Oct 2011

@Julian - ty for making the placemat postscript freely available online; used to great effect last night for non-TPF session.

Also discovered another possible bug, as follows:
- first define all the /Belowtitles as ( ) (i.e. a brackets with two spaces between; defining one member of the array this way and all others as () is also sufficient)
- then set /DecanterLabelsNumCopies to 1
- then convert to pdf (using ps2pdf.com)
- this causes the distiller to crash due to overflow (probably something to do with assessing font size based on only space characters?).

The reason this occurred was that I previously had values in all the /Belowtitles fields, all with start and end spaces, such as "( Magnum )" and simply removed all the words, but not the additional start/end spaces.

You might perfectly validly say "don't set values in the /Belowtitles aarray to a pair brackets with two spaces between"; Alternatively, setting a minimum value for BelowtitleFontSizes or similar might be worthwhile to prevent the crash.
231307/130501 - it's almost exactly the square root of pi
PhilW
Graham’s The Tawny
 
Posts: 440
Joined: 13:22 Wed 15 Dec 2010
Location: Near Cambridge, UK

Re: Software that makes placemats

Postby jdaw1 » 11:29 Sun 30 Oct 2011

PhilW wrote:You might perfectly validly say "don't set values …"
I would not say any such thing. It should work.

It was a minor problem. In outputting to the log, a number was being cvsed into a string that was one character too small. Fixed.

Thank you for the clear bug report. Please re-test.
User avatar
jdaw1
Quinta do Noval Nacional 1962
 
Posts: 11323
Joined: 14:03 Thu 21 Jun 2007
Location: London

Re: Software that makes placemats

Postby PhilW » 09:47 Mon 31 Oct 2011

jdaw1 wrote:Thank you for the clear bug report. Please re-test.

Fix verified.
231307/130501 - it's almost exactly the square root of pi
PhilW
Graham’s The Tawny
 
Posts: 440
Joined: 13:22 Wed 15 Dec 2010
Location: Near Cambridge, UK

Re: Software that makes placemats

Postby jdaw1 » 20:10 Mon 31 Oct 2011

New version. The code did some checks for errors. Over time this had grown into a disorganised and incomplete part of the code. Now improved.
User avatar
jdaw1
Quinta do Noval Nacional 1962
 
Posts: 11323
Joined: 14:03 Thu 21 Jun 2007
Location: London

Re: Software that makes placemats

Postby jdaw1 » 22:23 Thu 03 Nov 2011

I acknowledge the bug apparent on page 139 (pre-pour, CáF80 aus Portugal) of the draft of the placemats for the 1980 Horizontal in Leverkusen. Page 142 (pre-pour, SW) has a similar problem.

Expect repair within a few weeks.
User avatar
jdaw1
Quinta do Noval Nacional 1962
 
Posts: 11323
Joined: 14:03 Thu 21 Jun 2007
Location: London

Re: Software that makes placemats

Postby jdaw1 » 23:07 Thu 03 Nov 2011

The joy of a post-whisky shower: the problem was a factor of two, and I realised just where. Fixed.
User avatar
jdaw1
Quinta do Noval Nacional 1962
 
Posts: 11323
Joined: 14:03 Thu 21 Jun 2007
Location: London

Re: Software that makes placemats

Postby jdaw1 » 15:02 Sat 19 Nov 2011

After the GC + SW + QH triple vertical on Thu 17 Nov 2011, DRT asked that there be extra paper between tasters’ sets. He then suggested that this could be my placename page. So JDAW placename, JDAW glasses, JDAW TNs, then the next person’s same.

My thinking is as follows.

• I could add an extra page, marked with my name, with no other function. The wastage rankles.

• Or it could be the placename, as DRT suggested. But RAYC prints the placenames to card, so having them non-consecutive would complicate his printing.

• Or alternate sets (alternate people, so to speak) could be rotated by 180°. But would that be sufficiently different for the task at hand?

What do others think?
User avatar
jdaw1
Quinta do Noval Nacional 1962
 
Posts: 11323
Joined: 14:03 Thu 21 Jun 2007
Location: London

Re: Software that makes placemats

Postby jdaw1 » 15:40 Sat 19 Nov 2011

For the GC + SW + QH triple vertical on Thu 17 Nov 2011, RAYC made several similar versions of the placemats, and then overlapped the printouts to simulate the following A3 arrangement.
Image
Of course this overlapping of multiple copies is unacceptable.

Currently the array parameter PermittedPackingStyles may contain any of (and must contain at least one of) /PseudoHexagonal, /SquareGrid, /RectangularDislocation, /RectangularDislocationV, /TwoRowsOrTwoColumns, /GaiaElegant, /Gaia, or /Irregular or one of its variants. None of these do quite what RAYC required.

The proposal is to allow PermittedPackingStyles to contain an array, at least as long as the number of glasses on the page. That array would contain sub-arrays of locations, [ x y ]. My code would then choose the radius and separately scale the x and y directions such that things fit as snugly as possible, obviously subject to the other upper bounds on the radius. That gives the technical user a lot of control over the rare complicated cases, whilst the usual name parameters still cope with the vast majority of arrangements that could be wanted.

In the particular case of the GC+SW+QH tasting, the element of PermittedPackingStyles could have been [ [0 2] [2 2] [4 2] [6 2] [0 1] [3 1] [6 1] [0 0] [3 0] [6 0] ]. Observe that this example assumes that positive y points north. This echoes the usual PostScript convention; but conflicts with the usual page arrangements in which glasses with a small WithinPage are at the top.

Thoughts? Comments? Views on which direction positive y should be? Bottle of Taylor 1977?

(This post the last on this page. Please could the first to reply to it quote it, except this line.)
User avatar
jdaw1
Quinta do Noval Nacional 1962
 
Posts: 11323
Joined: 14:03 Thu 21 Jun 2007
Location: London

PreviousNext

Return to Organising Tastings and Get-togethers

Who is online

Users browsing this forum: No registered users and 0 guests