Re: [NTG-context] Variable instance identifiers exhausted

2018-09-18 Thread Fabrice L
Le 18 septembre 2018 à 03:11:40, Taco Hoekwater (t...@elvenkind.com) a
écrit:

> On 17 Sep 2018, at 21:17, Fabrice L  wrote:
>
> Dear List,
>
> I’m running into a problem in Metapost (using Context of course!)
> creating (I think) too many objects; I got this error message:
>
> variable instance identifiers exhausted

The max value for that is 2^31, or about 2 billion (and some change).
Are you sure you do not have an eternal loop in your source?

The number of objects I have is clearly less than 2^31, so my problem is
elsewhere then.

I do not think this a loop problem, because the same code runs ok for 15
000 objects, but give an error for 18 000 objects. I’m working to build a
minimal example.

Thanks a lot for the help ! Much appreciated.

Fabrice.



Best wishes,
Taco





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

maillist : ntg-context@ntg.nl /
http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Variable instance identifiers exhausted

2018-09-18 Thread Fabrice L
Le 18 septembre 2018 à 01:15:36, luigi scarso (luigi.sca...@gmail.com) a
écrit:



On Mon, Sep 17, 2018 at 9:18 PM Fabrice L  wrote:

> Dear List,
>
> I’m running into a problem in Metapost (using Context of course!)
> creating (I think) too many objects; I got this error message:
>
> variable instance identifiers exhausted
>
> I have tried without success to find information and a solution.
> Does somebody has a hint to solve this ?
>

Do you have  minimal example ?

I have worked on a minimal example today with no success ! What I mean is
that I have rebuilt the same algorithm from scratch in order to show
something minimal to the list, and I do not seem to encounter the problem
anymore ! The problem is that the process take hours of compilations, and
tests are not easy to do. Anyway, I will enrich my « minimal » code to my
« full » code in order to find the difference… and the problem. I will
update the thread as soon as can.

Thanks a lot for helping.

Fabrice.



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

maillist : ntg-context@ntg.nl /
http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaFun: How to draw bent paths?

2018-09-18 Thread Henri Menke


On 18/09/18 21:23, Henri Menke wrote:
> On 9/18/18 7:57 PM, Hans Hagen wrote:
>> On 9/16/2018 10:28 AM, Henri Menke wrote:
>>> Dear list,
>>>
>>> I want to draw paths between points which are bent by a certain angle.
>>> The code in the MWE below works well but I was thinking that the expert
>>> here can surely improve it and suggest a nicer syntax.
>> looks like a challenge for Alan ... isn't it also a bit 3d (2.5d)?
> 
> I wasn't thinking about a 3D application here, just a little bend on the
> path to go around other elements in my drawing without having to think
> about explicit control points (like the second example in my original
> post).  In the meantime I have improved the defintion of the macro to
> avoid double computation of the angle:
> 
> vardef bend(expr a,b,phi) =
> save x ;
> x := angle(b-a) ;
> a{dir(x+phi)} .. {dir(x-phi)}b
> enddef ;
> 
> So currently the applied syntax is
> 
> drawarrow bend(z1, z2, 30) ;
> 
> However, I would prefer something like
> 
> drawarrow z1 bend(30) z2 ;
> 
> I'm not sure whether this is possible though.  Actually I'm reading the
> MetaPost manual right know because my MP skills are rather poor.

I think I got it now.  Not sure whether “bend” should be primary or
something else.

\startMPdefinitions
primarydef a bend phi =
do_bend(a,phi)
enddef ;

vardef do_bend(expr a, phi) expr b =
save x ;
x := angle(b-a) ;
a{dir(x+phi)} .. {dir(x-phi)}b
enddef ;
\stopMPdefinitions

\starttext

\startMPpage
z1 = (-.5cm,1cm) ;
z2 = (1cm,3cm) ;

for phi = 0 step 5 until 360:
draw z1 bend(phi) z2 withcolor (phi/360)[red,blue] ;
endfor ;
\stopMPpage

% Possible use case:

\startMPpage[offset=1cm]
z1 = (-.5cm,1cm) ;
z2 = (1cm,3cm) ;
draw z1 -- z2 ;
dotlabel.lft("$-$", z1) ;
dotlabel.lft("$+$", z2) ;

path p; p := z1 bend(-30) z2 ;
drawdblarrow p withcolor blue ;
label.lrt(textext("$\Delta$"),point .5 along p)  withcolor blue ;
\stopMPpage

\stoptext


> 
>>
>> -
>>   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 /
>> http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>> ___
> 

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] interaction

2018-09-18 Thread Hans Hagen

Hi,

At the recent meeting Tomas Hala triggered a discussion about 
interaction and as a side effect I promissed to update the 'widgets' 
manual (mkii) which now will be 'interactions' (mkiv). In the process 
I'll check and clean up some of the code so if there are issues / wishes 
... the usual struggle with making different viewers happy.


(Or course Tomas is going to check everything discussed.)

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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaFun: How to draw bent paths?

2018-09-18 Thread Henri Menke
On 9/18/18 7:57 PM, Hans Hagen wrote:
> On 9/16/2018 10:28 AM, Henri Menke wrote:
>> Dear list,
>>
>> I want to draw paths between points which are bent by a certain angle.
>> The code in the MWE below works well but I was thinking that the expert
>> here can surely improve it and suggest a nicer syntax.
> looks like a challenge for Alan ... isn't it also a bit 3d (2.5d)?

I wasn't thinking about a 3D application here, just a little bend on the
path to go around other elements in my drawing without having to think
about explicit control points (like the second example in my original
post).  In the meantime I have improved the defintion of the macro to
avoid double computation of the angle:

vardef bend(expr a,b,phi) =
save x ;
x := angle(b-a) ;
a{dir(x+phi)} .. {dir(x-phi)}b
enddef ;

So currently the applied syntax is

drawarrow bend(z1, z2, 30) ;

However, I would prefer something like

drawarrow z1 bend(30) z2 ;

I'm not sure whether this is possible though.  Actually I'm reading the
MetaPost manual right know because my MP skills are rather poor.

> 
> -
>   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 /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] xmlstrippednolines

2018-09-18 Thread Taco Hoekwater


> On 17 Sep 2018, at 21:12, Hans van der Meer  wrote:
> 
> This completely escapes me: \xmlstrippednolines behaves differently for:
> (1) no embedded nodes - just the node content
> (2) embedded nodes - outer node encloses node content
> See the minimal example.
> 
> For me this works out a disaster, because in the second case the outer node 
> is added, throwing my program completely off track.
> 
> Questions:
> Is this the defined behaviour? Then what other means can be used to get the 
> node content and nothing but the node content in both cases?

\startxmlsetups xml:text
tex: \xmlflush{#1}\crlf
xmlstrippednolines: \xmlstripnolines{#1}{.}\xmlflush{#1}\crlf
\stopxmlsetups

> Why does \xmlstrippednolines behaves in this manner?

No idea about that.

Best wishes,
Taco

Taco Hoekwater
Elvenkind BV




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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] MetaFun: How to draw bent paths?

2018-09-18 Thread Hans Hagen

On 9/16/2018 10:28 AM, Henri Menke wrote:

Dear list,

I want to draw paths between points which are bent by a certain angle.
The code in the MWE below works well but I was thinking that the expert
here can surely improve it and suggest a nicer syntax.

looks like a challenge for Alan ... isn't it also a bit 3d (2.5d)?

-
  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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Variable instance identifiers exhausted

2018-09-18 Thread Taco Hoekwater


> On 17 Sep 2018, at 21:17, Fabrice L  wrote:
> 
> Dear List,
> 
> I’m running into a problem in Metapost (using Context of course!)
> creating (I think) too many objects; I got this error message:
> 
> variable instance identifiers exhausted

The max value for that is 2^31, or about 2 billion (and some change).
Are you sure you do not have an eternal loop in your source?

Best wishes,
Taco





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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___