[NTG-context] Re: MetaFun path joiners && and &&&& do not like single point paths

2023-12-31 Thread Gavin via ntg-context
Hi Hans and Mikael,

Thanks for your solutions. I’m happy to discard paths that have no area, so I 
used:

q = for i = 1 upto 3 :
  if (length(p[i]) > 1): p[i] && fi
endfor
cycle ;

This worked in the MWE, but it didn’t solve my problem in the globes module. 
Something else must be happening there. I’ll keep looking.

Gavin
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: MetaFun path joiners && and &&&& do not like single point paths

2023-12-31 Thread Hans Hagen via ntg-context

On 12/31/2023 8:06 AM, Mikael Sundqvist wrote:

\startMPpage
path p[], q ;
p1 = fullcircle scaled 3cm ;
p2 = fullcircle scaled 2cm shifted (3cm,0) ;
p3 = (3cm,2cm) ;
p4 = fullcircle ;
q = p[1] for i = 2 upto 3:
if (length(p[i]) == 0): &&& else: && fi p[i]
endfor
&& cycle ;
eofill q withcolor 0.9 ;
draw p1 withpen pencircle scaled 2pt withcolor .7 ;
draw p2 withpen pencircle scaled 2pt withcolor .7 ;
draw p3 withpen pencircle scaled 2pt withcolor .7 ;
draw q withcolor red ;
draw fullcircle scaled 6cm shifted (1.25cm,0) ;
\stopMPpage

maybe this is a bit more beautiful then

 q = for i = 1 upto 3 :
if length(p[i]) == 0 : % todo: a fast nolength
(p[i] -- p[i] shifted 5(eps,eps))
else:
p[i]
fi &&
 endfor cycle ;

(i'm not sure if we should change the implementation, probably not 
unless we have & -- actually we could have proper keywords which 
makes it less clumsy. Or 'recycle' that does the ugly eps job when we 
have a zero length path but we can move that over the year boundary.)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: MetaFun path joiners && and &&&& do not like single point paths

2023-12-30 Thread Mikael Sundqvist
Hi

On Sun, Dec 31, 2023 at 3:33 AM Gavin via ntg-context
 wrote:
>
> Hi MetaFun fans,
>
> Following a suggestion of Hans, I experimented with && and &&& and  for 
> joining paths in MetaFun. The joiner &&& produces one long path, but && and 
>  seem to produce a disconnected path which includes all the original 
> paths. However, if one of the paths is a single point, then it connects it. 
> MWE below.
>
> I spotted this on my globes module, where we saw an extra line appear for a 
> very specific orientation of the globe. I guessed that this orientation had 
> an island right on the horizon, so that only one boundary point was visible, 
> creating a singe point path for that island. I should probably fix my module 
> so it doesn’t do that. However, it might be nice to have && and  deal 
> with this situation gracefully.
>
> Gavin
>
>
> \startMPpage
>  path p[], q ;
>  p1 = fullcircle scaled 3cm ;
>  p2 = fullcircle scaled 2cm shifted (3cm,0) ;
>  p3 = (3cm,2cm) ;
>  q = for i = 1 upto 3 :
> p[i] &&
>  endfor
>  cycle ;
>  draw p1 withpen pencircle scaled 2pt withcolor .7 ;
>  draw p2 withpen pencircle scaled 2pt withcolor .7 ;
>  draw p3 withpen pencircle scaled 2pt withcolor .7 ;
>  draw q withcolor red ;
>  eofill q withcolor 0.9 ;
>  draw fullcircle scaled 6cm shifted (1.25cm,0) ;
> \stopMPpage

Not beautiful, but this seems to do what you want in this particular case:

\startMPpage
path p[], q ;
p1 = fullcircle scaled 3cm ;
p2 = fullcircle scaled 2cm shifted (3cm,0) ;
p3 = (3cm,2cm) ;
p4 = fullcircle ;
q = p[1] for i = 2 upto 3:
if (length(p[i]) == 0): &&& else: && fi p[i]
endfor
&& cycle ;
eofill q withcolor 0.9 ;
draw p1 withpen pencircle scaled 2pt withcolor .7 ;
draw p2 withpen pencircle scaled 2pt withcolor .7 ;
draw p3 withpen pencircle scaled 2pt withcolor .7 ;
draw q withcolor red ;
draw fullcircle scaled 6cm shifted (1.25cm,0) ;
\stopMPpage

This gives

q = p1 && p2 &&& p3 && cycle ;

/Mikael
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: metafun not working

2005-06-29 Thread Mojca Miklavec
luigi.scarso wrote:

 hmm, try on ctan:
 
 ctan/support/pstoedit/windows
 
 It should be an older (3.31) but good version .

cited from the webpage:

New or changed in 3.32:
...
workaround to cope with a change introduced since ghostscript 7.04.
Some new operators were added to ghostscript's internal array of
operators without increasing the maximum size of the array. This led
to the problem, that pstoedit couldn't add further operators.
...

I tried it out before reading that paragraph and I can approve: unless
you have an ancient GS, it doesn't work at all. 3.40 at least does
something even though it crashes.

Mojca
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Re: metafun not working

2005-06-29 Thread Hans Hagen

Mojca Miklavec wrote:


I tried it out before reading that paragraph and I can approve: unless
you have an ancient GS, it doesn't work at all. 3.40 at least does
something even though it crashes.


but i have no problems here with gs 8.51 (all 8 versions worked ok) and pstoedit 
3.33, so how recent is your gs?


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: metafun not working

2005-06-29 Thread Mojca Miklavec
luigi.scarso wrote:
 Hans Hagen wrote:
  Mojca Miklavec wrote:
 
  I tried it out before reading that paragraph and I can approve: unless
  you have an ancient GS, it doesn't work at all. 3.40 at least does
  something even though it crashes.
 
 
  but i have no problems here with gs 8.51 (all 8 versions worked ok) 
  and pstoedit 3.33, so how recent is your gs?
 
 Confirm : under linux MP.tex works with pstoedit 3.33 , gs 8.51 and even 
 ESP Ghostscript 7.07;
 pstoedit 3.40 does not works correctly with gs 8.51 and 7.07
 
 luigi

I believe that the version 3.33 works, but I can't find it anywhere.
Even 3.40 is difficult to download. Usually only some polite
bandwidth exceeded message appears. I don't know if the development
of the program is stil in progress, but they could switch to
sourceforge.

The version on CTAN is 3.31 - this is the one which doesn't work even
for simple conversions outside ConTeXt. The paragraph I posted to the
list was taken from New or changed in 3.32. This means that version
3.31 can't cope with the old GS.

pstoedit 3.40 seems to work as well. I can make conversions from
postscript to metapost outside ConTeXt without any problem. Also the
posted example with metafun trickery works somehow. It crashes the
pstoedit program, but obviously pstoedit manages to produce the proper
output before crashing.

I sent a short email to the email mentioned on the webpage - I hope
they will answer.

Mojca
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Re: metafun not working

2005-06-29 Thread Hans Hagen

Mojca Miklavec wrote:


I believe that the version 3.33 works, but I can't find it anywhere.


i mailed you a copy yesterday (1 meg attachment) but you rmail agent may be to 
picky on zip files


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Re: metafun manual

2004-08-31 Thread Hans Hagen
Jojo wrote:

Would you plan to release a Chinese version? I am glad to be a volunteer translate 
for that.
  

could be a challenge, remind me later (once the source code of the manual is stable 
translation should be no problem) 

Hans 


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: metafun manual

2004-08-31 Thread Jojo
+++ Hans Hagen [31/08/04 10:25 +0200]:
 Jojo wrote:
 
 Would you plan to release a Chinese version? I am glad to be a volunteer translate 
 for that.
   
 
 could be a challenge, remind me later (once the source code of the manual is stable 
 translation should be no problem) 

Best wishes! Waiting for good news!  


Rgds,


Jojo
2004/09/01
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: metafun manual

2004-08-30 Thread Jojo
+++ Brooks Moses [30/08/04 12:37 -0700]:
 On Mon, Aug 30, 2004 at 09:21:29PM +0200, Floris van Manen wrote:
   I'm going to 'finish' the metafun manual, so if you have topics that
   need to be covered ...

That's Great !!

 
 If you'd like volunteers to proofread the finished version, I'd be glad
 to help with that.

Would you plan to release a Chinese version? I am glad to be a volunteer translate for 
that.

 
 My main request is the addition of an index, but I presume that was
 already on the to-do list.
  
  the topic as how to define and use user defined functions / macros / procedure
  could have some more explanation / samples.
 
 This might indeed be helpful, if the metafun manual is intended as a
 complete guide to both metapost and metafun (replacing the old metapost
 manual).  My recollection is that the manual has very little (if any) on
 how to use suffix variables, and it would be nice to have a good
 overview of that somewhere other than the metafont (!) manual.
 
  also a suggested way as how to handle and use the definition of
  multiple (different) graphics within a single file could be helpful.
  e.g. where to put the graphics definitions. how to re-use pieces of
  graphics for other images (like axis frames).
 
 Agreed, although that's actually fairly simple (which is probably an
 argument _for_ including it, rather than against).
 
 - Brooks
 ___
 ntg-context mailing list
 [EMAIL PROTECTED]
 http://www.ntg.nl/mailman/listinfo/ntg-context
 


Best Rgds,


Jojo
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: metafun

2004-06-23 Thread Patrick Gundlach
Hi,

try texexec --alone --make metafun

and your texexec is (as far as I can judge) far out of date.

 TeXExec 4.3 - ConTeXt / PRAGMA ADE 1997-2004

is current

Patrick
-- 
texshow-web:  http://members.ping.de:8061
ConTeXt wiki: http://members.ping.de:8062
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Re: metafun

2004-06-23 Thread jimarin
you are right...mine is 3.1

but I don't understand...I downloaded cont-tmf.zip yesterday from
pragma-ade downloading page...

is it not the right place/version?

where should I get the lattest?

thanks again !

Jose


 Hi,

 try texexec --alone --make metafun

 and your texexec is (as far as I can judge) far out of date.

  TeXExec 4.3 - ConTeXt / PRAGMA ADE 1997-2004

 is current

 Patrick
 --
 texshow-web:  http://members.ping.de:8061
 ConTeXt wiki: http://members.ping.de:8062
 ___
 ntg-context mailing list
 [EMAIL PROTECTED]
 http://www.ntg.nl/mailman/listinfo/ntg-context



___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: metafun

2004-06-23 Thread Patrick Gundlach
Hi,

 but I don't understand...I downloaded cont-tmf.zip yesterday from
 pragma-ade downloading page...

 is it not the right place/version?

that is the only authorative(spelling?) place to download... There
are mirrors, but I don't know how uptodate they are.

The output you have sent me (private mail) showed that you use the
latest ConTeXt texfiles, but the perl progam texexec was not
updated.

Did texexec --make --alone metafun work?

Patrick

-- 
texshow-web:  http://members.ping.de:8061
ConTeXt wiki: http://members.ping.de:8062
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Re: metafun

2004-06-23 Thread jimarin
yep, it seems to work...it generates metafun.mem in the same directory it
was invoked...

do I have to invoke

texexec --make --alone

in a specific directory to perform correct installation of ConTeXt ?

I have not seen anything like that mentioned in install document...

is lattest version of TexExec in cont-tfm.zip ?

Jose

 Hi,

 but I don't understand...I downloaded cont-tmf.zip yesterday from
 pragma-ade downloading page...

 is it not the right place/version?

 that is the only authorative(spelling?) place to download... There
 are mirrors, but I don't know how uptodate they are.

 The output you have sent me (private mail) showed that you use the
 latest ConTeXt texfiles, but the perl progam texexec was not
 updated.

 Did texexec --make --alone metafun work?

 Patrick

 --
 texshow-web:  http://members.ping.de:8061
 ConTeXt wiki: http://members.ping.de:8062
 ___
 ntg-context mailing list
 [EMAIL PROTECTED]
 http://www.ntg.nl/mailman/listinfo/ntg-context



___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: metafun

2004-06-23 Thread Patrick Gundlach
Hi Jose,

 do I have to invoke

 texexec --make --alone

 in a specific directory to perform correct installation of ConTeXt ?

texexec --make --alone bypasses your distribution's way of installing
format files (fmtutil in your case I guess).

Put the resulting format files (*.fmt, *efmt, *mem) in texmf/web2c
and rerun texhash.

 I have not seen anything like that mentioned in install document...

I guess it is hidden...

 is lattest version of TexExec in cont-tfm.zip ?

Yes.

Patrick
-- 
texshow-web:  http://members.ping.de:8061
ConTeXt wiki: http://members.ping.de:8062
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Re: metafun

2004-06-23 Thread Hans Hagen
Patrick Gundlach wrote:
Hi,
 

but I don't understand...I downloaded cont-tmf.zip yesterday from
pragma-ade downloading page...
is it not the right place/version?
   

that is the only authorative(spelling?) place to download... There
are mirrors, but I don't know how uptodate they are.
The output you have sent me (private mail) showed that you use the
latest ConTeXt texfiles, but the perl progam texexec was not
updated.
Did texexec --make --alone metafun work?
 

watch out: scripts are now under ../texmf*/scripts/context and no longer under ../texmf/context/ ; normally this should make no difference but ... 

Hans  

-
 Hans Hagen | PRAGMA ADE
 Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Re: metafun

2004-06-23 Thread Hans Hagen
[EMAIL PROTECTED] wrote:
yep, it seems to work...it generates metafun.mem in the same directory it
was invoked...
do I have to invoke
texexec --make --alone
in a specific directory to perform correct installation of ConTeXt ?
I have not seen anything like that mentioned in install document...
 

the problem is that that should be a writable web2c path (maybe i should extend texexec a bit) 

$TEXFORMATS=path-to-web2c 

could be set is needed (then you know for sure where things end up) 

Hans 

-
 Hans Hagen | PRAGMA ADE
 Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context