ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* question for metapost experts
@ 2017-08-10 12:07 Schmitz Thomas A.
  2017-08-10 12:18 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Schmitz Thomas A. @ 2017-08-10 12:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,

this one is for all the metapos/metafun experts out there (Alan, are you there?). For a counter in one of my slide backgrounds, I have to calculate an intersectionpoint, given in percentage of the difference between current page and last page. I have always had some difficulties on the first run, when the value of the last page isn’t known yet and hence not written to the tuc file, but the error 

> ! The paths don't intersect.
> <to be read again>


used to disappear in subsequent runs. Now, ConTeXt doesn’t compile the file at all and stops on this error. There is an error message I haven’t seen before:

> intersectionpoint->...The paths don't intersect");
> origin.else:0.5[point.x_.o...
> <to be read again>
> ;
> <*> ... ;z13 = (z11 -- z12) intersectionpoint qw ;
> draw z13 withcolor (0.1,0....
> This error message was generated by an `errmessage'
> command, so I can't give any explicit help.
> Pretend that you're Miss Marple: Examine all clues,
> and deduce the truth by inspired guesses.

Is there a way to make this conditional, such as (pseudocode)

if q intersects p:
 z = q intersectionpoint p ;
else:
 z = (0,0) ;
fi ; 

I hope that this would allow ConTeXt to proceed and calculate the point correctly on the second run.

Thanks, and all best

Thomas
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: question for metapost experts
  2017-08-10 12:07 question for metapost experts Schmitz Thomas A.
@ 2017-08-10 12:18 ` Hans Hagen
  2017-08-10 12:39   ` Schmitz Thomas A.
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2017-08-10 12:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Schmitz Thomas A.

On 8/10/2017 2:07 PM, Schmitz Thomas A. wrote:
> Hi all,
> 
> this one is for all the metapos/metafun experts out there (Alan, are you there?). For a counter in one of my slide backgrounds, I have to calculate an intersectionpoint, given in percentage of the difference between current page and last page. I have always had some difficulties on the first run, when the value of the last page isn’t known yet and hence not written to the tuc file, but the error
> 
>> ! The paths don't intersect.
>> <to be read again>
> 
> 
> used to disappear in subsequent runs. Now, ConTeXt doesn’t compile the file at all and stops on this error. There is an error message I haven’t seen before:
> 
>> intersectionpoint->...The paths don't intersect");
>> origin.else:0.5[point.x_.o...
>> <to be read again>
>> ;
>> <*> ... ;z13 = (z11 -- z12) intersectionpoint qw ;
>> draw z13 withcolor (0.1,0....
>> This error message was generated by an `errmessage'
>> command, so I can't give any explicit help.
>> Pretend that you're Miss Marple: Examine all clues,
>> and deduce the truth by inspired guesses.
> 
> Is there a way to make this conditional, such as (pseudocode)

p intersection_point q

(also sets intersection_found)

> if q intersects p:
>   z = q intersectionpoint p ;
> else:
>   z = (0,0) ;
> fi ;
> 
> I hope that this would allow ConTeXt to proceed and calculate the point correctly on the second run.
> 
> Thanks, and all best
> 
> Thomas
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
> 


-- 

-----------------------------------------------------------------
                                           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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: question for metapost experts
  2017-08-10 12:18 ` Hans Hagen
@ 2017-08-10 12:39   ` Schmitz Thomas A.
  0 siblings, 0 replies; 3+ messages in thread
From: Schmitz Thomas A. @ 2017-08-10 12:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> On 10. Aug 2017, at 14:18, Hans Hagen <pragma@wxs.nl> wrote:
> 
> p intersection_point q
> 
> (also sets intersection_found)

Boy, impressive and wonderful, thanks a lot!!! It also made me see why I the error stopped the compilation: I had a naming conflict between the slide background and one of included metapost graphics, so now I can correct this!

All best

Thomas
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-10 12:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-10 12:07 question for metapost experts Schmitz Thomas A.
2017-08-10 12:18 ` Hans Hagen
2017-08-10 12:39   ` Schmitz Thomas A.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).