Software that makes placemats

Organise events to meet up and drink Port.
Andy Velebil
Quinta do Vesuvio 1994
Posts: 3084
Joined: 21:16 Mon 25 Jun 2007
Location: Los Angeles, Ca USA
Contact:

Re: Software that makes placemats

Post by Andy Velebil »

DRT wrote: 11:39 Sat 02 Sep 2017 For the purposes of testing this you could force the software to output CMYK or RGB somewhere on the sheet.
Did DRT just get all computer technical and stuff. Julian what have you done to him? :shock: :shock:
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

DRT wrote: 11:39 Sat 02 Sep 2017For the purposes of testing this you could force the software to output CMYK or RGB somewhere on the sheet.
Brilliant. Done. Old files replaced.
PhilW
Dalva Golden White Colheita 1952
Posts: 3708
Joined: 13:22 Wed 15 Dec 2010
Location: Near Cambridge, UK

Re: Software that makes placemats

Post by PhilW »

jdaw1 wrote: 11:56 Sat 02 Sep 2017
DRT wrote: 11:39 Sat 02 Sep 2017For the purposes of testing this you could force the software to output CMYK or RGB somewhere on the sheet.
Brilliant. Done. Old files replaced.
Surely the best approach would be a CMYK to RGB colour-space conversion performed in post-script? ;)
User avatar
flash_uk
Cálem Quinta da Foz 1970
Posts: 4659
Joined: 19:02 Thu 13 Feb 2014
Location: London

Re: Software that makes placemats

Post by flash_uk »

flash_uk wrote: 19:38 Fri 01 Sep 2017
jdaw1 wrote: 12:57 Fri 01 Sep 2017
flash_uk wrote: 09:54 Fri 01 Sep 2017On my HP Officejet Pro 8600 Plus at home, RGB is considerably darker and sharper. Will bring the prints to the next tasting we attend together.
Wow! That is very surprising. Thank you for testing.
Maybe I'll just check that I got them the right way round.
OK, retested with the updated pdfs. Same result, RGB darker and sharper.

Will also test on a Samsung Multi-function laser printer in the office tomorrow.
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

Glenn E. wrote: 19:43 Mon 06 Apr 2015I now have GhostScript installed and so tried it myself using the first file that I generated for this set of placemats. (I sent a different file to my friend based off a known-to-be-good version from the FTLOP 1985 Horizontal in January.)
GhostScript Bug 695906, on 16 Oct 2017 wrote:Works fine with the new scan converter.
Glenn: are you able to update your GhostScript to the latest? Please would you be willing to /InlineTitlesAttemptMinimiseNumContours true def, and test whether new GhostScript is still painfully slow? Thank you.

This is not urgent.

Edit: also /InlineTitlesMaxNumberContours 20 def.
Glenn E.
Graham’s 1977
Posts: 4422
Joined: 21:27 Wed 09 Jul 2008
Location: Seattle, WA, USA

Re: RE: Re: Software that makes placemats

Post by Glenn E. »

jdaw1 wrote:
Glenn E. wrote: 19:43 Mon 06 Apr 2015I now have GhostScript installed and so tried it myself using the first file that I generated for this set of placemats. (I sent a different file to my friend based off a known-to-be-good version from the FTLOP 1985 Horizontal in January.)
GhostScript Bug 695906, on 16 Oct 2017 wrote:Works fine with the new scan converter.
Glenn: are you able to update your GhostScript to the latest? Please would you be willing to /InlineTitlesAttemptMinimiseNumContours true def, and test whether new GhostScript is still painfully slow? Thank you.

This is not urgent.

Edit: also /InlineTitlesMaxNumberContours 20 def.
I don't believe that I have GhostScript installed on my current computer. I have gone back to using ps2pdf.com because you fixed the issue that was causing that website to fail.

Glenn
Glenn Elliott
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

Bug report re Mac Preview’s setlinewidth and clip’ping

FYI.

This is the text of a bug report re Mac Preview 10.0 (944.4) under macOS High Sierra 10.13.3. Please suggest improvements: whatever makes it more likely to be fixed.

Mac Preview mis-displays PDF files. Both setlinewidth and clip'ping regions are seriously mis-displayed, which is most inconvenient for those using macOS to produce beautiful files.

A PDF file has been made from the hand-written PostScript file at
www.jdawiseman.com/papers/bugs/201803_P ... lip_bug.ps
Because this is handwritten, it can be read and understood by a human, who can then see what it is meant to do, and compare to what actually happens.

It was distilled with Distiller XI Pro 11.0.23 (01/11/2017) to make
www.jdawiseman.com/papers/bugs/201803_P ... ip_bug.pdf

The PostScript was opened in Mac Preview 10.0 (944.4) under macOS High Sierra 10.13.3, and at 1200* screenshotted to make
Image
Observe error: red stroke of the (S) is much thinner than it should be.

The distilled PDF was opened in Mac Preview 10.0 (944.4) under macOS High Sierra 10.13.3, and at 1200* screenshotted to make
Image
Two errors: red stroke of the (S) is much thinner than it should be. Also the painting of the triangle clipped to the (S) is not correctly clipped: some green and black spills out of the S.

The same distilled was PDF opened in Adobe Acrobat Reader DC 2018.011.20038, and at 1200* screenshotted to make
Image
This shows correctly.

The text of this report is also at www.jdawiseman.com/papers/bugs/201803_P ... ip_bug.txt

Any or all files might be updated or improved to show the bug better. Check for latest.

Summary: Preview badly mis-displays the PDF, and also (though to a lesser extent) the PostScript.

Mac Bug 38317613 https://bugreport.apple.com/web/?problemID=38317613
Also at https://groups.google.com/forum/#!topic ... O_tFq3dyDM
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

In 'Table of Contents', Preview’s navigation dysfunctional

This is the text of a bug report re Mac Preview 10.0 (944.4) under macOS High Sierra 10.13.3.

Download and open
http://www.jdawiseman.com/2018/20180102_Ideally1878.pdf
View > Table of Contents (or, equivalently, command-option-3)
Click on the arrow next to “Vote recorders (pp35-39, A4)” to make visible its sub-items.

Click on “Wine of the Night? (p37, A4)”. The black focus jumps from there up a few lines. Click on “What is it? (p39, A4)”. Again focus jumps.

In a previous version of Preview (no, I don't know precisely, but about two OS's ago) one could navigate through the Table of Contents using up and down arrows. Attempt same. Observe jumping about. This user interface isn't working.

Please fix.

The text of this bug report, perhaps updated or improved, is also at
http://www.jdawiseman.com/papers/bugs/2 ... ntents.txt

I have many PDFs giving Preview this problem, including:
http://www.jdawiseman.com/2017/20171219_1977s.pdf
http://www.jdawiseman.com/2017/20171130 ... _1970s.pdf
http://www.jdawiseman.com/2017/20171129_Calem.pdf
http://www.jdawiseman.com/2017/20171102_1970s.pdf
http://www.jdawiseman.com/2017/20171019_mature.pdf
http://www.jdawiseman.com/2017/20171010 ... mpbell.pdf
http://www.jdawiseman.com/2017/20170928_Bring.pdf
http://www.jdawiseman.com/2017/20170907_SQVP_Blind.pdf
http://www.jdawiseman.com/2017/20170809_Blind.pdf
http://www.jdawiseman.com/2017/20170801_Emergency.pdf
http://www.jdawiseman.com/2017/20170713_Blind.pdf
http://www.jdawiseman.com/2017/20170621 ... yHouse.pdf
http://www.jdawiseman.com/2017/20170600_Portugal.pdf
http://www.jdawiseman.com/2017/20170608_1967s.pdf
http://www.jdawiseman.com/2017/20170524 ... mebody.pdf
http://www.jdawiseman.com/2017/20170510 ... quired.pdf
http://www.jdawiseman.com/2017/20170426_DFW.pdf
http://www.jdawiseman.com/2017/20170419_emergency.pdf
http://www.jdawiseman.com/2017/20170406_1955s.pdf
http://www.jdawiseman.com/2017/20170322_blind.pdf
http://www.jdawiseman.com/2017/20170309 ... tangle.pdf
http://www.jdawiseman.com/2017/20170301 ... uctory.pdf
http://www.jdawiseman.com/2017/20170204_CUTwC.pdf
http://www.jdawiseman.com/2017/20170204 ... rkusen.pdf
http://www.jdawiseman.com/2017/20170201 ... it_hen.pdf
http://www.jdawiseman.com/2017/20170104 ... Bottle.pdf

Mac Bug report 38358147 https://bugreport.apple.com/web/?problemID=38358147
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

Apple Preview ignores many pdfmark settings

This is the text of a bug report re Mac Preview 10.0 (944.4) under macOS High Sierra 10.13.3.

mark {Catalog} << /PageLayout /TwoPageLeft >> /PUT pdfmark
This PostScript command, which is echoed in the PDF, causes a two page layout in which the first page is not shown by itself. Two pages, without title page. Heeded by Adobe reader; ignored by Preview.


mark /Action << >> /Color [0 0 0] /F 0 /Title () /OUT pdfmark
mark /Action << >> /Color [0 0 0] /F 2 /Title (\247 Re-ordered) /OUT pdfmark

The “/F 2” sets the Outline (= Table of Contents) entry to be bold. Heeded by Adobe reader; ignored by Preview.

Code: Select all

mark
	/Rect [ ... ]
	/Subtype /Polygon
	/BS  << /Type /Border  /W 1  /S /S >>
	/Subj (A string)
	/ModDate ParametersVersionDateTimeAdobeFormat
	/F 64 128 add  % ReadOnly + Locked. PDFReference16.pdf page 574
	/Vertices [ ... ]
	/Color [ 0.6 0.6 1.0 ]
/ANN pdfmark
Adds a non-printing polygon to show the boundary of something. Heeded by Adobe reader; ignored by Preview.

The first two of these bugs can be seen by opening
http://www.jdawiseman.com/2018/20180102_Ideally1878.pdf
and the third in
http://www.jdawiseman.com/2016/20161215_White_Horse.pdf

Please could these and other settings be heeded.

This text, perhaps updated, will appear at
http://www.jdawiseman.com/papers/bugs/2 ... ttings.txt

Apple bug 38391355 https://bugreport.apple.com/web/?problemID=38391355
PhilW
Dalva Golden White Colheita 1952
Posts: 3708
Joined: 13:22 Wed 15 Dec 2010
Location: Near Cambridge, UK

Re: Software that makes placemats

Post by PhilW »

In the latest placemats, why are the "1963" over the shipper different sizes?
jdaw1 wrote: 17:44 Sat 17 Feb 2018Draft of the placemats.
Image Image
In the above, the 1963 over Ck and Mz are clearly smaller than those over G and D; perhaps some form of proportion since the Mz and Ck are in a smaller font than G and D (being maximised to fit within circles), but it would look better if all the 1963s were the same size font. I don't know how the font size decision for the over-print of the year was determined (I haven't looked, to be fair); perhaps some additional form of control might already provide the capability to enforce a common font size for the 1963s since they are all the same and in the same size area, but if not then perhaps it might be a worthwhile addition.
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: RE: Re: Software that makes placemats

Post by jdaw1 »

PhilW wrote:In the above, the 1963 over Ck and Mz are clearly smaller than those over G and D; perhaps some form of proportion since the Mz and Ck are in a smaller font than G and D (being maximised to fit within circles), but it would look better if all the 1963s were the same size font. I don't know how the font size decision for the over-print of the year was determined (I haven't looked, to be fair); perhaps some additional form of control might already provide the capability to enforce a common font size for the 1963s since they are all the same and in the same size area, but if not then perhaps it might be a worthwhile addition.
It was wrong. I will investigate whether it was a user error or a programmer failure (same person; different roles) and suggest a plan, or just effect it.
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

Instead of

Code: Select all

/OvertitleMaxFontSizeProportionTitles 0.125 def
it would have been better to do

Code: Select all

/OvertitleMaxFontSizeProportionTitles 0.166666666 def
/FontSizesRatioAboveBelowOverMin 999 def
So it could be a user error.

But I think a change of default for FontSizesRatioAboveBelowOverMin would be advisable, from

Code: Select all

/FontSizesRatioAboveBelowOverMin 2 sqrt sqrt def
to

Code: Select all

/FontSizesRatioAboveBelowOverMin 999 def
So it could be a programmer error.

A reminder: if font sizes are closer in ratio than FontSizesRatioAboveBelowOverMin (or, mutatis mutandis, FontSizesRatioTitlesMin, then they are set to be the same. It is, in ratio terms, the minimum difference in font size. These two parameters prevent there being many font sizes that differ only slightly.

Objections?
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

jdaw1 wrote: 21:00 Thu 12 Apr 2018

Code: Select all

/FontSizesRatioAboveBelowOverMin 999 def
Done.
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

Advice wanted on a technical problem, relating to the seed for PostScript’s random numbers, the seed being set with srand.

To fix some bugs and refactor code, each circle’s painting is surrounded by a rrandsrand pair, to put in the stack the current seed, and then to reset the random-number seed to that.

Discussion is happening about a forthcoming Cockburn vertical. The current draft of the placemats has the 1947 and 1967 as:

Image   Image

Observe that the layout of the stars look very similar, with a slight offset. (The eye might start at the top-right of the ‘7’s.) Indeed, relative to the centre of the circle, the stars are identically positioned. Is this:
• Perfection?
• Tolerable?
• Erroneous?

(I admit to dislike—hence this question.)

(Typo fixed.)
PhilW
Dalva Golden White Colheita 1952
Posts: 3708
Joined: 13:22 Wed 15 Dec 2010
Location: Near Cambridge, UK

Re: Software that makes placemats

Post by PhilW »

jdaw1 wrote: 21:57 Fri 20 Jul 2018Observe that the layout of the stars look very similar, with a slight offset. (The eye might start at the top-right of the ‘7’s.) Indeed, relative to the centre of the circle, the stars are identically positioned. Is this:
• Perfection?
• Tolerable?
• Erroneous?
Tolerable, though less than ideal. Why do you keep get/setting the seed, rather than simply setting it at the start of the script (presumably to a fixed value for determinism) and then just using rand throughout thereafter?
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

PhilW wrote: 07:17 Sat 21 Jul 2018Why do you keep get/setting the seed, rather than simply setting it at the start of the script (presumably to a fixed value for determinism) and then just using rand throughout thereafter?
Because sometimes multiple passes of randomness need to be aligned. E.g., in Titles and Overtitles:

Image
PhilW
Dalva Golden White Colheita 1952
Posts: 3708
Joined: 13:22 Wed 15 Dec 2010
Location: Near Cambridge, UK

Re: Software that makes placemats

Post by PhilW »

jdaw1 wrote: 11:26 Sat 21 Jul 2018
PhilW wrote: 07:17 Sat 21 Jul 2018Why do you keep get/setting the seed, rather than simply setting it at the start of the script (presumably to a fixed value for determinism) and then just using rand throughout thereafter?
Because sometimes multiple passes of randomness need to be aligned.
"need"? no. "want"? perhaps - I would likely have compromised this one, and not chosen alignment for this, unless it turned out to look poor. With your chosen method you still should only need to cache and reseed while drawing the multiple aspects of a single circle, then continue (though this would place restrictions on the order in which you need to draw elements, or increase the seed cache-ing to one per circle, and then restore to subsequent afterwards, which might be the better route, depending on the currently implemented order of drawing of elements.
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

PhilW wrote: 13:34 Sat 21 Jul 2018"need"? no. "want"? perhaps - I would likely have compromised this one, and not chosen alignment for this, unless it turned out to look poor.
Disagree: this is a need.


PhilW wrote: 13:34 Sat 21 Jul 2018With your chosen method you still should only need to cache and reseed while drawing the multiple aspects of a single circle, then continue (though this would place restrictions on the order in which you need to draw elements, or increase the seed cache-ing to one per circle, and then restore to subsequent afterwards, which might be the better route, depending on the currently implemented order of drawing of elements.
Yes. And my question was whether I should. And the answers seems to be ‘yes’.
Glenn E.
Graham’s 1977
Posts: 4422
Joined: 21:27 Wed 09 Jul 2008
Location: Seattle, WA, USA

Re: Software that makes placemats

Post by Glenn E. »

I actually noticed the non-randomness of the 47 and 67 with merely a glance before reading the rest of the original post.

That said, I don't see it as a problem.

(The overtitles example looks bad to me, and not due to alignment. I would not put the pattern in the overtitle as it makes that word too difficult to read. Especially in the busy parts in 'pe' and 'ia'.)
Glenn Elliott
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

Decision made: fixed.

That the fix has shortened the code by ten lines increases the likelihood that it was the right thing to do.
User avatar
flash_uk
Cálem Quinta da Foz 1970
Posts: 4659
Joined: 19:02 Thu 13 Feb 2014
Location: London

Re: Software that makes placemats

Post by flash_uk »

Julian - Thomas V over on FTLOP has posted that the ps to pdf converter seems to no longer function with a placemat .ps file. Any ideas what's happened? I suspect the converter is doing something different and doesn't like something in the .ps file. The converter at www.ps2pdf.com also seems to have stopped giving a log which is a bit unhelpful for figuring out the issue.
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

Link to Thomas V’s comment. I’ve asked the PS➝PDF folks for help.
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

Mike Hugo wrote:I've sold the ps2pdf.com domain and it is now being run by someone else.

I continue to keep the old service as ps2pdf.org.

I'm not even sure how your email made it to me as the new owner should be receiving email for the dot com domain but perhaps has not updated something.

When I take the document and convert it at ps2pdf.org it does produce a document.
This document also causes my security wrapper to generate a pile of output as this file includes a bunch of code in it that causes the converter to block certain transactions that the file is trying to do. It still creates a final pdf .

Feel free to link to the ps2pdf.org site.
Posted with permission.
User avatar
flash_uk
Cálem Quinta da Foz 1970
Posts: 4659
Joined: 19:02 Thu 13 Feb 2014
Location: London

Re: Software that makes placemats

Post by flash_uk »

Many thanks Julian.
User avatar
g-man
Quinta do Vesuvio 1994
Posts: 3429
Joined: 12:50 Wed 24 Oct 2007
Location: NYC
Contact:

Re: Software that makes placemats

Post by g-man »

Glenn E. wrote: 20:46 Sat 21 Jul 2018
(The overtitles example looks bad to me, and not due to alignment. I would not put the pattern in the overtitle as it makes that word too difficult to read. Especially in the busy parts in 'pe' and 'ia'.)
I agree with this, the pattern in the over label is completely distracting when placed over the vintage stars.

The vintage stars themselves I find a little too cluttered for the overall appearance that I'm distracted with the fill and not the vintage date itself.
Disclosure: Distributor of Quevedo wines and Quinta do Gomariz
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

g-man wrote: 00:13 Tue 28 Aug 2018The vintage stars themselves I find a little too cluttered for the overall appearance that I'm distracted with the fill and not the vintage date itself.
I suggest /ShapesInTitles false def as the perfect solution.
PhilW
Dalva Golden White Colheita 1952
Posts: 3708
Joined: 13:22 Wed 15 Dec 2010
Location: Near Cambridge, UK

Re: Software that makes placemats

Post by PhilW »

jdaw1 wrote: 22:14 Tue 28 Aug 2018
g-man wrote: 00:13 Tue 28 Aug 2018The vintage stars themselves I find a little too cluttered for the overall appearance that I'm distracted with the fill and not the vintage date itself.
I suggest /ShapesInTitles false def as the perfect solution.
Or just using a different shape from the options available; I think gman was saying he didn't like that particular fill, and I'm sure we all have our preferences and dislikes in that regard (and false is already the default for /ShapesInTitles in the current placemat.ps anyway, for anyone wondering).
g-man wrote: 00:13 Tue 28 Aug 2018
Glenn E. wrote: 20:46 Sat 21 Jul 2018 (The overtitles example looks bad to me, and not due to alignment. I would not put the pattern in the overtitle as it makes that word too difficult to read. Especially in the busy parts in 'pe' and 'ia'.)
I agree with this, the pattern in the over label is completely distracting when placed over the vintage stars.
In agreement with the above view, though I realise this is in disagreement with author preference.
Note that there is an equivalent /ShapesInOvertitles parameter, and indeed equivalents for /ShapesInAbovetitles, /ShapesInBelowtitles and /ShapesInPlacenames (noting the latter has missing { } brackets in the definition compared with the peer definitions). These currently all default to be the same as /ShapesInOvertitles but can be changed by the user, so those of us who prefer not to have the pattern in the overtitles can easily change this.
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

PhilW wrote: 08:11 Wed 29 Aug 2018Note that there is an equivalent /ShapesInOvertitles parameter, and indeed equivalents for /ShapesInAbovetitles, /ShapesInBelowtitles and /ShapesInPlacenames (noting the latter has missing { } brackets in the definition compared with the peer definitions).
Note ‘latter’ of two; ‘last’ of three or more.

Geek note: /ShapesInPlaceNames ShapesInTitles def works naturally if ShapesInTitles is a Boolean constant. But if ShapesInTitles is code referencing the likes of WithinTitles, that would fail if referenced in ShapesInPlaceNames. The absence of brackets causes it to fail earlier, and more traceably. So the absence of {} was deliberate.
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

As requested:

Image Image Image
DaveRL
Warre’s Otima 10 year old Tawny
Posts: 512
Joined: 14:04 Tue 18 Mar 2014
Location: London

Re: Software that makes placemats

Post by DaveRL »

Fabulous. Thank you. :D :GoldStar:
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

Anybody else?

Please specify pattern, the number of columns (so far everybody has five), and the number of rows (so far everybody has one).

From the Manual:
/Alternating
Image

/Sideways
Image

/Upright
Image
User avatar
flash_uk
Cálem Quinta da Foz 1970
Posts: 4659
Joined: 19:02 Thu 13 Feb 2014
Location: London

Re: Software that makes placemats

Post by flash_uk »

Yes please, alternating.
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

From the current code:

Code: Select all

/TastingNotesStarsNameColsRowsArrangement  % (ASCIIfied Name) NumCols NumRows /Alternating|/Sideways|/Upright
[
	(DRT)  5 1 /Upright      (Derek T.)    4 copy pop
	(WPS)  5 1 /Sideways     (Wolfgang S.) 4 copy pop
	(PW)   5 1 /Sideways     (Phil W.)     4 copy pop
	(DJ)   5 1 /Sideways     (Daniel J.)   4 copy pop
	(IDJ)  5 1 /Alternating  (Ian J.)      4 copy pop
	(DRL)  5 1 /Alternating  (Dave L.)     4 copy pop
	(TC)   5 1 /Alternating  (Tony C.)     4 copy pop
	(MPM)  5 1 /Alternating  (Mike M.)     4 copy pop
] def  % /TastingNotesStarsNameColsRowsArrangement
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

Geeks might be interested in the comp.lang.postscript thread Mathematical functions as a single Bézier cubic, as used in the Spirals feature (which, note to self, I need to document).
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

For the few who care, HeapSort has been replaced by ShellSort, with gap sequence 1 2 5 11 23 51 113 247 541 1189 2617 5761 12671 27877 61331 134933 296843 653057 1436731 3160811 6953783 15298321 33656309 74043881 162896543 358372411 788419321 1734522497, each being the nearest to 2.2× previous, subject to being coprime to all previous except 1. (Of course, as the maximum array length in most implementations of PostScript is 65535, usually only the bolded gaps are relevant.)

Code for both, and a speed comparison, is in ShellSort_HeapSort.ps. It seems that ShellSort is better for arrays of length ≤ 216−1, but the extent of the advantage diminishes with length. So it may well be that for arrays of length millions or billions, HeapSort is better. But for arrays as short as PostScript’s longest, ShellSort seems to be faster.
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

There have been few instances of old versions being printed, perhaps because of caching problems.

One solution — rejected here — would be to have many separate file names. I dislike that, because I don’t want many versions existing after, and I want a single canonical-seeming file name.

A different technique is something I don’t know how to do. In the PDF, presumably added via pdfmark, could be something like the following pseudocode:

Code: Select all

On Open
{
	If Today ≤ HardWiredDateConstantBeingDateOfTasting
	{
		MessageBoxPopUp 
			string="This version HardWiredStringConstant: check that is latest with a force-reload."
			Buttons={"OK, checked"}
	}
}
Do any readers of thread 175 know how to implement this in a PDF? Advice and guidance welcomed.

Edit, Aug 2021: also asked in github.com/jdaw1/placemat/issues/152, and on comp.lang.postscript.
akzy
Warre’s Otima 10 year old Tawny
Posts: 564
Joined: 20:42 Tue 13 Nov 2018
Location: Three Bridges

Re: Software that makes placemats

Post by akzy »

I used the placemats last night for a small tasting among a few physicists. Naturally, we decided to have field lines drawn on. I noted in the manual that Julian is displeased by these and whilst they are good for the majority of the page, some of the lines are non-physical (as circled).
e field artifact.PNG
e field artifact.PNG (234.06 KiB) Viewed 63881 times
We then went on to discuss how we would do it ourselves (and is a similar method to how I create electric field simulations for trapped ions) . We believe the best option would be to treat each circle as a point charge and then create a potential map (i.e calculate the voltage across the sheet as superposition of each charge) for the entire sheet. From this grid, we can then perform some numerical differentiation (ideally if the point like nature is interpolated with a "reasonable order" function) to create a vector field (which would correspond to the electric field lines). As for visualization, the field lines would be the back-most image and the tasting circles would terminate drawing of lines such that the point charge wouldn't been seen.

Problems i foresee. How on earth do you,
1. Interpolate in PS
2. Differentiate in PS
3. Use PS

For my work I use Mathematica and its fantastic library of simple to use mathematical functions.
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

• I dislike the whole Rays algorithm. Despite the previous discussion of it way back in summer 2013.

• You say that each circle should be a “point charge”. I suspect that aesthetically that wouldn’t work with the very strong circle motif. The lines need to leave the bounding circle, not a point charge within it. (But each circle cannot be a perfect conductor, as they touch, so would all be at the same charge.)

• Interpolate in Postscript … Differentiate in Postscript. Ans: do the work in Mathematica. Then output it in PostScript. Doh!

Code: Select all

(* PostScriptForm — this version of Jan 2019. *)
(* \
PostScriptForm[] *)
(*
	\
http://mathematica.stackexchange.com/questions/101954/postscriptform-\
or-forthform
	http://mathematica.stackexchange.com/questions/102894/multi-case-\
function-many-single-case-delayed-assignments-or-one-which
*)
Remove[PostScriptForm];
PostScriptForm[thing_Rational] := 
  If[Abs[Denominator[
        thing]/(2^IntegerExponent[Denominator[thing], 2])/(5^
        IntegerExponent[Denominator[thing], 5])] == 1, 
   ToString[N[thing, 20], InputForm, NumberMarks -> False], 
   PostScriptForm[Numerator[thing]] <> " " <> 
    PostScriptForm[Denominator[thing]] <> " div"];
PostScriptForm[thing_?AtomQ] := ToString[thing];
PostScriptForm[thing_List] := 
  StringJoin @@ Riffle[Map[PostScriptForm, thing], "\r\n"];
PostScriptForm[MatrixForm[thing_]] := PostScriptForm[thing];
PostScriptForm[Times[-1, thing_]] := 
  StringJoin[PostScriptForm[thing], " neg"];

PostScriptForm[thing_Power] := (
   	psExponent := Which[
      		# > 5 && Divisible[#, 3], 
      psExponent[#/3] <> " dup dup mul mul",
      		# >= 5 && OddQ[#], 
      "dup " <> psExponent[(# - 1)/2] <> " dup mul mul" ,
      		# >= 4 && EvenQ[#], psExponent[#/2] <> " dup mul",
      		# == 3, "dup dup mul mul",
      		# == 2, "dup mul",
      		# == 1/2, "sqrt",
      		# == 3/2, "dup sqrt mul",
      		# < 0, psExponent[-#] <> " 1 exch div",
      		(Rational === Head[#]) && (Log[2, # // Denominator] // 
         IntegerQ), psExponent[Simplify[2 #]] <> " sqrt",
      		Not[IntegerQ[#]], PostScriptForm[#] <> " exp",
      		# == 1, "",
      		True, 
      " !!!\[Bullet]\[Bullet]\[Bullet]Error with exponent = " <> 
       ToString[#] <> "\[Bullet]\[Bullet]\[Bullet]!!! "
      	] &;
   	Which[
    		thing[[2]] > 0 || Not[IntegerQ[thing[[2]]]], 
    PostScriptForm[thing[[1]]] <> " " <> psExponent[thing[[2]]],
    		thing[[2]] == -1, "1 " <> PostScriptForm[thing[[1]]] <> " div",
    		thing[[2]] == 0, "1",
    		True, 
    "1 " <> PostScriptForm[thing[[1]]] <> " " <> 
     psExponent[-thing[[2]]] <> " div"
    	]);

PostScriptForm[thing_Times] := 
  StringJoin@
   Riffle[Reap[
      If[MatchQ[thing[[1]], 
        Power[_, 
         n_Integer /; n < 0]], (Sow[
          "1 " <> PostScriptForm[thing[[1, 1]]] <> " div"];), (Sow[
          PostScriptForm[thing[[1]]]];)]; 
      Map[(If[MatchQ[#, 
           Power[_, 
            n_Integer /; n < 0]], (Sow[
             PostScriptForm[#[[1]]^(-#[[2]])] <> " div"];), (Sow[
             PostScriptForm[#] <> " mul"]; )]) &, 
       Drop[List @@ thing, 1]]][[2, 1]], " "];

PostScriptForm[thing_Plus] :=
  StringJoin @@ If[FreeQ[thing, _^n_],
    	(* Simple expression, no powers, 
    to be summed one item at a time *)
    	Module[{i},
     		i = 
      Position[thing, Except[Times[-1, _] | (_?Negative)], 1, 
       Heads -> False];
     		If[Length[i] > 0, 
      i = i[[1, 1]], (i = 
        Position[thing, Not[MatchQ[#, Times[-1, _]]] &, 1, 
         Heads -> False]; i = If[Length[i] > 0, i[[1, 1]], 1])];	
     Prepend[
      Map[(" " <> 
          Replace[#, {(n_Integer /; n < 0 :> 
              ToString[-n] <> " sub"), (Times[-1, _] :> 
              PostScriptForm[Times @@ Drop[#, 1]] <> " sub"), (Times[
               n_ /; n < 0, _] :> 
              PostScriptForm[Times @@ Drop[#, 1]] <> " " <> 
               ToString[-#[[1]]] <> " mul sub"), (Times[
               n_ /; n > 0, _] :> 
              PostScriptForm[Times @@ Drop[#, 1]] <> " " <> 
               ToString[#[[1]]] <> " mul add"), (_ :> 
              PostScriptForm[#] <> " add")}]) &, 
       Drop[List @@ thing, {i}]], 
      Replace[thing[[
        i]], {Times[-1, _] :> 
         PostScriptForm[-thing[[i]]] <> " neg", _ :> 
         PostScriptForm[thing[[i]]]}]]  ],
    	(* Polynomial *)
    	Module[{vars, exps, v, rcl, i, firstMul},
     		vars = Variables[thing];
     		exps = Exponent[thing, vars];
     		v = 
      Select[Transpose[{vars, exps}], (#[[2]] == Max @@ exps) &][[1, 
       1]];
     		rcl = Reverse[Map[Factor, CoefficientList[thing, v]]];
     		Reap[
       			i = 1; firstMul = True; 
       If[rcl[[1]] =!= 1, Sow[PostScriptForm[rcl[[1]]]]];
       Map[
        If[# === 0, 
          i++, (Sow[
            If[firstMul && rcl[[1]] === 1, PostScriptForm[v^i] <> " ",
               " " <> PostScriptForm[v^i] <> " mul "] <> 
             If[MatchQ[#, (Times[_?Negative, _] | (_?Negative))], 
              PostScriptForm[-#] <> " sub", 
              PostScriptForm[#] <> " add"]]; i = 1; 
           firstMul = False)] &, Drop[rcl, 1]];
       			
       If[i > 1, Sow[" " <> PostScriptForm[v^(i - 1)] <> " mul "]];
       		][[2, 1]]
     ]];
(Did you really think that the Temple calculations currently in lines 4918–4950 of the code were written by hand?)
akzy
Warre’s Otima 10 year old Tawny
Posts: 564
Joined: 20:42 Tue 13 Nov 2018
Location: Three Bridges

Re: Software that makes placemats

Post by akzy »

So I had a quick play (please ignore the asymmetrical crimes against mathematics) around in mathematica doing a point charge simulation, see below for results. Depending on how the circle is placed over, I think it would look ok?
pointcharge.png
pointcharge.png (118.88 KiB) Viewed 63864 times

I like the idea of doing it in Mathematica. I presume this is some sort of language converter?
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

Interesting. What charge did you give each point? By what algorithm should the charges be chosen? And please post the code that made the diagram.
akzy
Warre’s Otima 10 year old Tawny
Posts: 564
Joined: 20:42 Tue 13 Nov 2018
Location: Three Bridges

Re: Software that makes placemats

Post by akzy »

Below is the code I used. I've changed things slightly so that it can all be solved analytically. Firstly, we define a series of vectors in circlepos which correspond to x,y and charge respectively. Set these however you please (I'd suggest arranging as a n/quadrupole- only because of the work i do https://en.wikipedia.org/wiki/Quadrupole_ion_trap) . The function pot[] then calculates the potential (analytically). This is then summed over all potentials and differentiated in both x and y to produce the field in said directions. StreamPlot is then used to visualise it.

Code: Select all

circlepos = {{1, 1, 1}, {1, 2, -1}, {2, 1, 1}, {2, 2, -1}};
p1 = ListPlot[circlepos, PlotRange -> {{0, 3}, {0, 3}}];

pot[x_, y_, qx_, qy_, q_] := q/Sqrt[(x - qx)^2 + (y - qy)^2]

potgridx[x_, y_] = 
  D[Total[Table[
     pot[x, y, circlepos[[i, 1]], circlepos[[i, 2]], 
      circlepos[[i, 3]]], {i, 1, Length[circlepos]}]], x];
potgridy[x_, y_] = 
  D[Total[Table[
     pot[x, y, circlepos[[i, 1]], circlepos[[i, 2]], 
      circlepos[[i, 3]]], {i, 1, Length[circlepos]}]], y];
p2 = StreamPlot[{potgridx[x, y], potgridy[x, y]}, {x, 0, 2.5}, {y, 0, 
    2.5}];
Show[p1, p2]
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

akzy wrote: 23:32 Sun 16 Jun 2019I presume this is some sort of language converter?
Yes. Converts basic expressions to (slightly) idiomatic PostScript. Typical use case is a polynomial to be solved: it converts the CoefficientList, which is then passed to a PostScript polynomial solver.

E.g.: PostScriptForm[(a + Sqrt[b])^15]a b sqrt add dup dup mul dup mul mul dup dup mul mul


Your approach is well suited to circles in a rectangular grid. Not so much in a hexagonal grid. E.g.:

Code: Select all

circlepos = {
   	{0, 1, 1},
   	{Sqrt[3.]/2, 0.5, -1},
   	{Sqrt[3.]/2, -0.5, 1},
   	{0, -1, -1},
   	{-Sqrt[3.]/2, -0.5, 1},
   	{-Sqrt[3.]/2, 0.5, -1},
   	{0, 0, 1}
   };
What might be need is some sort of chromatic / multi-dimensional field.
akzy
Warre’s Otima 10 year old Tawny
Posts: 564
Joined: 20:42 Tue 13 Nov 2018
Location: Three Bridges

Re: Software that makes placemats

Post by akzy »

jdaw1 wrote: 20:04 Mon 17 Jun 2019 E.g.: PostScriptForm[(a + Sqrt[b])^15]a b sqrt add dup dup mul dup mul mul dup dup mul mul
Love it.
jdaw1 wrote: 20:04 Mon 17 Jun 2019
Your approach is well suited to circles in a rectangular grid. Not so much in a hexagonal grid. E.g.:

Code: Select all

circlepos = {
   	{0, 1, 1},
   	{Sqrt[3.]/2, 0.5, -1},
   	{Sqrt[3.]/2, -0.5, 1},
   	{0, -1, -1},
   	{-Sqrt[3.]/2, -0.5, 1},
   	{-Sqrt[3.]/2, 0.5, -1},
   	{0, 0, 1}
   };
Fixed.

Code: Select all

circlevec = {{0, 1, 1}, {Sqrt[3.]/2, 0.5, -1}, {Sqrt[3.]/2, -0.5, 
    1}, {0, -1, -1}, {-Sqrt[3.]/2, -0.5, 1}, {-Sqrt[3.]/2, 
    0.5, -1}, {0, 0, 1}};
circlepos = 
 Table[{circlevec[[i, 1]], circlevec[[i, 2]]}, {i, 1, 
   Length[circlevec]}];
p1 = ListPlot[circlepos, PlotRange -> {{-2.5, 2.5}, {-2.5, 2.5}}, 
   PlotMarkers -> {Automatic, Large}];

pot[x_, y_, qx_, qy_, q_] := q/Sqrt[(x - qx)^2 + (y - qy)^2]

potgridx[x_, y_] = 
  D[Total[Table[
     pot[x, y, circlevec[[i, 1]], circlevec[[i, 2]], 
      circlevec[[i, 3]]], {i, 1, Length[circlevec]}]], x];
potgridy[x_, y_] = 
  D[Total[Table[
     pot[x, y, circlevec[[i, 1]], circlevec[[i, 2]], 
      circlevec[[i, 3]]], {i, 1, Length[circlevec]}]], y];
p2 = StreamPlot[{potgridx[x, y], potgridy[x, y]}, {x, -2.5, 
    2.5}, {y, -2.5, 2.5}];
Show[p1, p2]
And for those who aren't blessed with Mathematica,
hexcharge.png
hexcharge.png (148.06 KiB) Viewed 63735 times
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

akzy wrote: 21:10 Mon 17 Jun 2019
jdaw1 wrote: 20:04 Mon 17 Jun 2019E.g.: PostScriptForm[(a + Sqrt[b])^15]a b sqrt add dup dup mul dup mul mul dup dup mul mul
Love it.
So do I, but perhaps more for its wilful stubbornness than its practicality.


akzy wrote: 21:10 Mon 17 Jun 2019Fixed.
Hmm. Bug or feature?
• The points south, east-by-north-east and west-by-north-west relate well to the central circle.
• But the points north, east-by-south-east and west-by-south-west do not connect to the central circle at all.

For my palate, this is an offence to symmetry. There’s no a priori reason for the central circle to exhibit such favouritism. You’re trying to squeeze a 2ⁿ pattern into a shape divisible by three, and I think it doesn’t fit.

Others: please take sides.

Some circle arrangements to consider (ignore the decorations): Image

Image

Image Image

Image

Image

Image

Image



I repeat:
jdaw1 wrote: 05:52 Mon 17 Jun 2019By what algorithm should the charges be chosen?

Display: inside the circles is different to outside. Perhaps it should be shown inside faded 60%; and outside at full strength? Comment and recommendation welcomed.
akzy
Warre’s Otima 10 year old Tawny
Posts: 564
Joined: 20:42 Tue 13 Nov 2018
Location: Three Bridges

Re: Software that makes placemats

Post by akzy »

Obviously a feature.

With the asymmetry, it is bothering me too. I have a suspicion that it's because we're working up against imperfect machine precision. If you plot symmetries in along one plane, you might notice there's a field preference to one side. Perhaps the numbers will have to be adjusted so that they can be positions with exact machine precision? I'll have a play and see what I can muster up.

I'll have a look at some previous placemats soon, see what can be made.

As for the algorithm, I'm really not sure. At least there is a flexibility to have any charge (or even strength of charge for that extra special something).
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

FYI, the only floating-point precision in PostScript is single: 23-bit mantissa ≈ one part in eight million; 8 bits exponent so maximum value ≈ ±10³⁸.
akzy
Warre’s Otima 10 year old Tawny
Posts: 564
Joined: 20:42 Tue 13 Nov 2018
Location: Three Bridges

Re: Software that makes placemats

Post by akzy »

jdaw1 wrote: 22:35 Mon 17 Jun 2019 FYI, the only floating-point precision in PostScript is single: 23-bit mantissa ≈ one part in eight million; 8 bits exponent so maximum value ≈ ±10³⁸.
Ok, I will try zeroing at 2^-23.

I also had a little play with some other fun field related plots (whilst trying to diagnose). Whilst just a first attempt, and numbers will have to be fudged to make it look better,
contourpot.png
contourpot.png (72.51 KiB) Viewed 63683 times
Plotted using

Code: Select all

ContourPlot[
 Log[Total[
   Table[pot[x, y, circlevec[[i, 1]], circlevec[[i, 2]], 
     circlevec[[i, 3]]], {i, 1, Length[circlevec]}]]], {x, -2.5, 
  2.5}, {y, -2.5, 2.5}, Contours -> 20]
PhilW
Dalva Golden White Colheita 1952
Posts: 3708
Joined: 13:22 Wed 15 Dec 2010
Location: Near Cambridge, UK

Re: Software that makes placemats

Post by PhilW »

jdaw1 wrote: 21:45 Mon 17 Jun 2019Hmm. Bug or feature?
• The points south, east-by-north-east and west-by-north-west relate well to the central circle.
• But the points north, east-by-south-east and west-by-south-west do not connect to the central circle at all.
From the imagery, would I be correct in thinking that each point represents a certain positive or negative charge, and therefore that the reason some points connect to others while others pairs to not is that essentially we are only seeing lines between points of opposite (or different) charge? If so, some variation from binary charge setting would enable alternate maps with all points connecting, though would be potentially difficult to keep regular and symmetrical for all designs without specific rules.

Based on the above, but varying slightly, would making the centre of all circles could be a positive charge, and then placing negative charges between (either in the spaces or the mid-point between adjacent circles) might provide a more fully-connected and symmetric output, though I can't picture whether that might become too linear.
akzy
Warre’s Otima 10 year old Tawny
Posts: 564
Joined: 20:42 Tue 13 Nov 2018
Location: Three Bridges

Re: Software that makes placemats

Post by akzy »

PhilW wrote: 07:20 Tue 18 Jun 2019 From the imagery, would I be correct in thinking that each point represents a certain positive or negative charge, and therefore that the reason some points connect to others while others pairs to not is that essentially we are only seeing lines between points of opposite (or different) charge? If so, some variation from binary charge setting would enable alternate maps with all points connecting, though would be potentially difficult to keep regular and symmetrical for all designs without specific rules.

Based on the above, but varying slightly, would making the centre of all circles could be a positive charge, and then placing negative charges between (either in the spaces or the mid-point between adjacent circles) might provide a more fully-connected and symmetric output, though I can't picture whether that might become too linear.
Good idea. I also changed circlepos to a different hexagonal lattice..

Code: Select all

{{0, 2 Sqrt[2], -1}, {Sqrt[2], Sqrt[2], -1}, {-Sqrt[2], 
  Sqrt[2], -1}, {0, -2 Sqrt[2], -1}, {-Sqrt[2], -Sqrt[2], -1}, {Sqrt[
   2], -Sqrt[2], -1}, {0, 0, 1}}
Attachments
hexclosepacked.png
hexclosepacked.png (152.29 KiB) Viewed 63627 times
User avatar
jdaw1
Dow 1896
Posts: 24574
Joined: 14:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Software that makes placemats

Post by jdaw1 »

akzy wrote: 11:01 Tue 18 Jun 2019Good idea. I also changed circlepos to a different hexagonal lattice.
Charges good. Because circles touch, hexagonal was better.

How to generalise the charges it to fit
jdaw1 wrote: 21:45 Mon 17 Jun 2019Image
For this type of layout, might a triangle tesselation with charges {⅓,⅔,1} be correct?

Code: Select all

circlevec = {
	{0, 1, 1},
	{Sqrt[3.]/2, 0.5, 1/3},
	{Sqrt[3.]/2, -0.5, 1},
	{0, -1, 1/3}, 
	{-Sqrt[3.]/2, -0.5, 1},
	{-Sqrt[3.]/2, 0.5, 1/3},
	{0, 0, 2/3}
};
p1 = Map[Graphics[{Red, Thick, Circle[{#[[1]], #[[2]]}, 0.5]}] &, circlevec[[All, 1 ;; 2]]];
pot[x_, y_, qx_, qy_, q_] := q/Sqrt[(x - qx)^2 + (y - qy)^2];
potgridx[x_, y_] = 
  D[Total[Table[
     pot[x, y, circlevec[[i, 1]], circlevec[[i, 2]], 
      circlevec[[i, 3]]], {i, 1, Length[circlevec]}]], x];
potgridy[x_, y_] = 
  D[Total[Table[
     pot[x, y, circlevec[[i, 1]], circlevec[[i, 2]], 
      circlevec[[i, 3]]], {i, 1, Length[circlevec]}]], y];
p2 = StreamPlot[{potgridx[x, y], potgridy[x, y]}, {x, -1.6, 
    1.6}, {y, -1.6, 1.6}];
Show[p1, p2, AspectRatio -> 1]
Image
(Alas my Mathematica v9 can’t specify StreamMarkers -> "Segment".)
Post Reply