Re: [NTG-context] MP: problem connecting paths.

2021-12-20 Thread Fabrice L via ntg-context
Dear Mikael,

> Le 20 déc. 2021 à 12:14, Mikael Sundqvist  a écrit :
> 
> Hi,
> 
> I will try again. What if you do
> 
> newcircleA := newcircleA scrutinized 2;
> 
> after your definition of newcircleA?

Once I understood I had to compile with LMTX, this works like magic ! I spent 
hours to find a solution… but here is a solution ! 
Thanks a lot ! 
> 
> /Mikael

Fabrice.
> 
> 
> On Mon, Dec 20, 2021 at 3:45 PM Fabrice L  wrote:
>> 
>> Thanks Mikael,
>> 
>> Le 20 déc. 2021 à 02:21, Mikael Sundqvist via ntg-context 
>>  a écrit :
>> 
>> Hi,
>> 
>> would it be an option for you to do
>> 
>> newcircleA := circleA cutbefore P1 cutafter P2 -- cycle ;
>> 
>> In that case you avoid extra points.
>> 
>> 
>> You are right, in this simple case, your solution avoid the problem, and is 
>> applicable in some of my cases (I have to rethink the code). Thanks for the 
>> proposition !
>> But in others cases this is not possible (I think). Imagine I wish to do a « 
>> partial moon » from the two circles in my minimal example (see bottom right 
>> of the attached pdf):
>> 
>> 
>> newcircleA := circleA cutbefore P1 cutafter P2 .. reverse(circleB cutbefore 
>> P1 cutafter P2)  .. cycle;
>> 
>> I need 10 points to define the shape, but as my connections are duplicated, 
>> I have 12 points.
>> 
>> The solution (I thought) would be to use the « & » operator :
>> newcircleA := circleA cutbefore P1 cutafter P2 & reverse(circleB cutbefore 
>> P1 cutafter P2) & cycle ;
>> 
>> But this does not work (same reason as before: "! Paths don't touch; `&' 
>> will be changed to `..'.").
>> 
>> The compete minimal code (if somebody wants to plus with it) is here :
>> 
>> % ———
>> \startMPpage
>> path circleA , circleB ;
>> pair P[];
>> defaultscale := 0.4 ;
>> 
>> circleA := fullcircle scaled 1in randomized 3 ;
>> circleB := fullcircle scaled 1in randomized 3 shifted(0.3in,0.3in) ;
>> 
>> draw circleA withcolor blue ;
>> draw circleB withcolor red ;
>> 
>> P[1] := circleA intersectionpoint circleB ;
>> dotlabel.lft("$P_1$",P[1]) ;
>> dotlabel.rt("$\blue\tfx P_0^A$",point 0 of circleA) ;
>> P[2] := reverse(circleA) intersectionpoint circleB ;
>> dotlabel.rt("$P_2$",P[2]) ;
>> dotlabel.rt("$\red\tfx P_0^B$",point 0 of circleB) ;
>> 
>> path newcircleA , newcircleB ;
>> % newcircleA := (circleA cutbefore P1 cutafter P2 ) & (P2 -- P1) & cycle  ;
>> % previous line gives an error :
>> % "! Paths don't touch; `&' will be changed to `..'."
>> newcircleA := circleA cutbefore P1 cutafter P2 -- (P2 -- P1) -- cycle  ;
>> newcircleA := newcircleA xshifted 2in ;
>> draw newcircleA  withcolor darkgreen ;
>> 
>> newcircleB := (circleB cutafter P1)  -- (P1 -- P2) -- (circleB cutbefore P2 
>> ) & cycle ;
>> newcircleB := newcircleB xshifted 2in ;
>> draw newcircleB withcolor black ;
>> drawpoints newcircleA ; drawpointlabels newcircleA ;
>> 
>> % Mikael solution
>> newcircleA := circleA cutbefore P1 cutafter P2 -- cycle ;
>> newcircleA := newcircleA yshifted -1.5in ;
>> draw newcircleA  withcolor darkgreen ;
>> drawpoints newcircleA ; drawpointlabels newcircleA ;
>> 
>> % partial moon
>> newcircleA := circleA cutbefore P1 cutafter P2
>> .. reverse(circleB cutbefore P1 cutafter P2) .. cycle;
>> % & (reverse(circleB) cutbefore P2 cutafter P1) & cycle;
>> newcircleA := newcircleA shifted(2in,-1.5in) ;
>> draw newcircleA  withcolor magenta ;
>> drawpoints newcircleA ; drawpointlabels newcircleA ;
>> 
>> \stopMPpage
>> % ———
>> 
>> Thanks for any help !
>> Fabrice.
>> 
>> 
>> /Mikael
>> 
>> On Mon, Dec 20, 2021 at 5:30 AM Fabrice L via ntg-context
>>  wrote:
>> 
>> 
>> Dear list,
>> 
>> I have a problem connecting path with the operator « & » (page 16 Metafun 
>> manual). The problem is illustrated by the code (and the joined PDF) which 
>> follows.
>> 
>> I draw random cycled  forms (left part of the figure) and when they 
>> interact, they are modified to « fit together » (right part of the figure) . 
>> When building these new forms, I connect paths (usually two or three 
>> depending on position 0 of the path); the last point a path is the same as 
>> the first point of the next path ; for exemple, to modify the blue circle, 
>> named « circleA », I take the circle A from P1 to P2, then a segment from P2 
>> to P1 and cycle to have a closed path. So I should be able to do :
>> 
>> newcircleA := circleA cutbefore P1 cutafter P2 & (P2 -- P1) & cycle  ;
>> 
>> The « & » operator is supposed to work (if I understand correctly) in this 
>> case, but I have this error message :
>> 
>> "! Paths don't touch; `&' will be changed to `..’."
>> 
>> Which I do not understand since the paths « touch ». There was a similar 
>> question last year, without a clear answer («
>> METAPOST subpath rounding issue 
>> »https://www.mail-archive.com/ntg-context@ntg.nl/msg94294.html).
>> 
>> A solution is to ignore the repeating points :
>> newcircleA := circleA cutbefore P1 cutafter P2 -- (P2 -- P1) -- cycle  ;
>> but this new shape has 9 

Re: [NTG-context] MP: problem connecting paths.

2021-12-20 Thread Mikael Sundqvist via ntg-context
Hi,

I will try again. What if you do

newcircleA := newcircleA scrutinized 2;

after your definition of newcircleA?

/Mikael


On Mon, Dec 20, 2021 at 3:45 PM Fabrice L  wrote:
>
> Thanks Mikael,
>
> Le 20 déc. 2021 à 02:21, Mikael Sundqvist via ntg-context 
>  a écrit :
>
> Hi,
>
> would it be an option for you to do
>
> newcircleA := circleA cutbefore P1 cutafter P2 -- cycle ;
>
> In that case you avoid extra points.
>
>
> You are right, in this simple case, your solution avoid the problem, and is 
> applicable in some of my cases (I have to rethink the code). Thanks for the 
> proposition !
> But in others cases this is not possible (I think). Imagine I wish to do a « 
> partial moon » from the two circles in my minimal example (see bottom right 
> of the attached pdf):
>
>
> newcircleA := circleA cutbefore P1 cutafter P2 .. reverse(circleB cutbefore 
> P1 cutafter P2)  .. cycle;
>
> I need 10 points to define the shape, but as my connections are duplicated, I 
> have 12 points.
>
> The solution (I thought) would be to use the « & » operator :
> newcircleA := circleA cutbefore P1 cutafter P2 & reverse(circleB cutbefore P1 
> cutafter P2) & cycle ;
>
> But this does not work (same reason as before: "! Paths don't touch; `&' will 
> be changed to `..'.").
>
> The compete minimal code (if somebody wants to plus with it) is here :
>
> % ———
> \startMPpage
> path circleA , circleB ;
> pair P[];
> defaultscale := 0.4 ;
>
> circleA := fullcircle scaled 1in randomized 3 ;
> circleB := fullcircle scaled 1in randomized 3 shifted(0.3in,0.3in) ;
>
> draw circleA withcolor blue ;
> draw circleB withcolor red ;
>
> P[1] := circleA intersectionpoint circleB ;
> dotlabel.lft("$P_1$",P[1]) ;
> dotlabel.rt("$\blue\tfx P_0^A$",point 0 of circleA) ;
> P[2] := reverse(circleA) intersectionpoint circleB ;
> dotlabel.rt("$P_2$",P[2]) ;
> dotlabel.rt("$\red\tfx P_0^B$",point 0 of circleB) ;
>
> path newcircleA , newcircleB ;
> % newcircleA := (circleA cutbefore P1 cutafter P2 ) & (P2 -- P1) & cycle  ;
> % previous line gives an error :
> % "! Paths don't touch; `&' will be changed to `..'."
> newcircleA := circleA cutbefore P1 cutafter P2 -- (P2 -- P1) -- cycle  ;
> newcircleA := newcircleA xshifted 2in ;
> draw newcircleA  withcolor darkgreen ;
>
> newcircleB := (circleB cutafter P1)  -- (P1 -- P2) -- (circleB cutbefore P2 ) 
> & cycle ;
> newcircleB := newcircleB xshifted 2in ;
> draw newcircleB withcolor black ;
> drawpoints newcircleA ; drawpointlabels newcircleA ;
>
> % Mikael solution
> newcircleA := circleA cutbefore P1 cutafter P2 -- cycle ;
> newcircleA := newcircleA yshifted -1.5in ;
> draw newcircleA  withcolor darkgreen ;
> drawpoints newcircleA ; drawpointlabels newcircleA ;
>
> % partial moon
> newcircleA := circleA cutbefore P1 cutafter P2
> .. reverse(circleB cutbefore P1 cutafter P2) .. cycle;
> % & (reverse(circleB) cutbefore P2 cutafter P1) & cycle;
> newcircleA := newcircleA shifted(2in,-1.5in) ;
> draw newcircleA  withcolor magenta ;
> drawpoints newcircleA ; drawpointlabels newcircleA ;
>
> \stopMPpage
> % ———
>
> Thanks for any help !
> Fabrice.
>
>
> /Mikael
>
> On Mon, Dec 20, 2021 at 5:30 AM Fabrice L via ntg-context
>  wrote:
>
>
> Dear list,
>
> I have a problem connecting path with the operator « & » (page 16 Metafun 
> manual). The problem is illustrated by the code (and the joined PDF) which 
> follows.
>
> I draw random cycled  forms (left part of the figure) and when they interact, 
> they are modified to « fit together » (right part of the figure) . When 
> building these new forms, I connect paths (usually two or three depending on 
> position 0 of the path); the last point a path is the same as the first point 
> of the next path ; for exemple, to modify the blue circle, named « circleA », 
> I take the circle A from P1 to P2, then a segment from P2 to P1 and cycle to 
> have a closed path. So I should be able to do :
>
> newcircleA := circleA cutbefore P1 cutafter P2 & (P2 -- P1) & cycle  ;
>
> The « & » operator is supposed to work (if I understand correctly) in this 
> case, but I have this error message :
>
> "! Paths don't touch; `&' will be changed to `..’."
>
> Which I do not understand since the paths « touch ». There was a similar 
> question last year, without a clear answer («
> METAPOST subpath rounding issue 
> »https://www.mail-archive.com/ntg-context@ntg.nl/msg94294.html).
>
> A solution is to ignore the repeating points :
> newcircleA := circleA cutbefore P1 cutafter P2 -- (P2 -- P1) -- cycle  ;
> but this new shape has 9 points instead of 7. The problem is that I do these 
> operations a number of times, and the length of a path (in the number of 
> points) is increasing and cause trouble when I look for intersections with 
> others shapes.
>
> Here is the MWE:
>
> \startMPpage
> path circleA , circleB ;
> pair P[];
>
> circleA := fullcircle scaled 1in randomized 3 ;
> circleB := fullcircle scaled 1in randomized 3 

Re: [NTG-context] MP: problem connecting paths.

2021-12-20 Thread Fabrice L via ntg-context
Thanks Mikael,Le 20 déc. 2021 à 02:21, Mikael Sundqvist via ntg-context  a écrit :Hi,would it be an option for you to donewcircleA := circleA cutbefore P1 cutafter P2 -- cycle ;In that case you avoid extra points.You are right, in this simple case, your solution avoid the problem, and is applicable in some of my cases (I have to rethink the code). Thanks for the proposition ! But in others cases this is not possible (I think). Imagine I wish to do a « partial moon » from the two circles in my minimal example (see bottom right of the attached pdf): 

test.pdf
Description: Adobe PDF document
newcircleA := circleA cutbefore P1 cutafter P2 .. reverse(circleB cutbefore P1 cutafter P2)  .. cycle; I need 10 points to define the shape, but as my connections are duplicated, I have 12 points. The solution (I thought) would be to use the « & » operator :newcircleA := circleA cutbefore P1 cutafter P2 & reverse(circleB cutbefore P1 cutafter P2) & cycle ; But this does not work (same reason as before: "! Paths don't touch; `&' will be changed to `..'."). The compete minimal code (if somebody wants to plus with it) is here :% ———\startMPpagepath circleA , circleB ;pair P[];defaultscale := 0.4 ;circleA := fullcircle scaled 1in randomized 3 ;circleB := fullcircle scaled 1in randomized 3 shifted(0.3in,0.3in) ;draw circleA withcolor blue ;draw circleB withcolor red ;P[1] := circleA intersectionpoint circleB ;dotlabel.lft("$P_1$",P[1]) ;dotlabel.rt("$\blue\tfx P_0^A$",point 0 of circleA) ;P[2] := reverse(circleA) intersectionpoint circleB ;dotlabel.rt("$P_2$",P[2]) ;dotlabel.rt("$\red\tfx P_0^B$",point 0 of circleB) ;path newcircleA , newcircleB ;% newcircleA := (circleA cutbefore P1 cutafter P2 ) & (P2 -- P1) & cycle  ;% previous line gives an error :% "! Paths don't touch; `&' will be changed to `..'."newcircleA := circleA cutbefore P1 cutafter P2 -- (P2 -- P1) -- cycle  ;newcircleA := newcircleA xshifted 2in ;draw newcircleA  withcolor darkgreen ;newcircleB := (circleB cutafter P1)  -- (P1 -- P2) -- (circleB cutbefore P2 ) & cycle ; newcircleB := newcircleB xshifted 2in ;draw newcircleB withcolor black ;drawpoints newcircleA ; drawpointlabels newcircleA ;% Mikael solution newcircleA := circleA cutbefore P1 cutafter P2 -- cycle ;newcircleA := newcircleA yshifted -1.5in ;draw newcircleA  withcolor darkgreen ;drawpoints newcircleA ; drawpointlabels newcircleA ;% partial moon newcircleA := circleA cutbefore P1 cutafter P2 	.. reverse(circleB cutbefore P1 cutafter P2) .. cycle; %	& (reverse(circleB) cutbefore P2 cutafter P1) & cycle; newcircleA := newcircleA shifted(2in,-1.5in) ;draw newcircleA  withcolor magenta ;drawpoints newcircleA ; drawpointlabels newcircleA ;\stopMPpage% ———Thanks for any help ! Fabrice./MikaelOn Mon, Dec 20, 2021 at 5:30 AM Fabrice L via ntg-context wrote:Dear list,I have a problem connecting path with the operator « & » (page 16 Metafun manual). The problem is illustrated by the code (and the joined PDF) which follows.I draw random cycled  forms (left part of the figure) and when they interact, they are modified to « fit together » (right part of the figure) . When building these new forms, I connect paths (usually two or three depending on position 0 of the path); the last point a path is the same as the first point of the next path ; for exemple, to modify the blue circle, named « circleA », I take the circle A from P1 to P2, then a segment from P2 to P1 and cycle to have a closed path. So I should be able to do :newcircleA := circleA cutbefore P1 cutafter P2 & (P2 -- P1) & cycle  ;The « & » operator is supposed to work (if I understand correctly) in this case, but I have this error message :"! Paths don't touch; `&' will be changed to `..’."Which I do not understand since the paths « touch ». There was a similar question last year, without a clear answer («METAPOST subpath rounding issue »https://www.mail-archive.com/ntg-context@ntg.nl/msg94294.html).A solution is to ignore the repeating points :newcircleA := circleA cutbefore P1 cutafter P2 -- (P2 -- P1) -- cycle  ;but this new shape has 9 points instead of 7. The problem is that I do these operations a number of times, and the length of a path (in the number of points) is increasing and cause trouble when I look for intersections with others shapes.Here is the MWE:\startMPpagepath circleA , circleB ;pair P[];circleA := fullcircle scaled 1in randomized 3 ;circleB := fullcircle scaled 1in randomized 3 shifted(0.3in,0.3in) ;draw circleA withcolor blue ;draw circleB withcolor red ;P[1] := circleA intersectionpoint circleB ;dotlabel.lft("$P_1$",P[1]) ;dotlabel.rt("$\blue\tfx P_0^A$",point 0 of circleA) ;P[2] := reverse(circleA) intersectionpoint circleB ;dotlabel.rt("$P_2$",P[2]) ;dotlabel.rt("$\red\tfx P_0^B$",point 0 of circleB) ;path newcircleA , newcircleB ;% newcircleA := circleA cutbefore P1 cutafter P2 & (P2 -- P1) & cycle  ;% previous line gives an error :% "! 

Re: [NTG-context] definedfont vs switchtobodyfont (was "shrink inter-line space")

2021-12-20 Thread Hans Hagen via ntg-context

On 12/20/2021 12:06 PM, mf via ntg-context wrote:

Il 18/12/21 13:00, Wolfgang Schuster ha scritto:

\definefontfeature [tightlines] [dimensions={*,0,0}]

\starttext

\samplefile{ward}\par

\blank

\start
 \setupinterlinespace[line=5pt]
 \definedfont[Normal*default,tightlines]
 \samplefile{ward}\par
\stop

\stoptext



Thanks Wolfgang.

I tried this:

\definefontfeature [tightlines] [dimensions={*,0,0}]

\starttext

\samplefile{ward}\par

\blank

\start
     \setupinterlinespace[line=5pt]
     \feature[+][tightlines]
     \samplefile{ward}\par
\stop

\stoptext

but it doesn't add the feature to the current font.
I understand I need a font switch.
Usually I use \switchtobodyfont. How is \definedfont different?
it's a 'permanent' one ... so when the font is loaded the dimensions are 
adapted so you need a new font definition


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] definedfont vs switchtobodyfont (was "shrink inter-line space")

2021-12-20 Thread mf via ntg-context

Il 18/12/21 13:00, Wolfgang Schuster ha scritto:

\definefontfeature [tightlines] [dimensions={*,0,0}]

\starttext

\samplefile{ward}\par

\blank

\start
     \setupinterlinespace[line=5pt]
     \definedfont[Normal*default,tightlines]
     \samplefile{ward}\par
\stop

\stoptext



Thanks Wolfgang.

I tried this:

\definefontfeature [tightlines] [dimensions={*,0,0}]

\starttext

\samplefile{ward}\par

\blank

\start
\setupinterlinespace[line=5pt]
\feature[+][tightlines]
\samplefile{ward}\par
\stop

\stoptext

but it doesn't add the feature to the current font.
I understand I need a font switch.
Usually I use \switchtobodyfont. How is \definedfont different?

Massi
___
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] Gap in rows if tabulate includes a startitemize

2021-12-20 Thread Hans Hagen via ntg-context

On 12/20/2021 10:04 AM, Jorge Manuel via ntg-context wrote:

Good morning to all.

this seems to solve it:

\startitemize[before=]



-
  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] Gap in rows if tabulate includes a startitemize

2021-12-20 Thread Jorge Manuel via ntg-context
Good morning to all.

A new and best example.
On 19 Dec 2021, 12:18 +, Hans Hagen via ntg-context , 
wrote:
> On 12/19/2021 9:39 AM, Jorge Manuel via ntg-context wrote:
> > The attach.
>
> yout example works ok here but it's not the same as in the picture so we
> need a better test to see the issue
>
> > Jorge Magalhães
> >
> > On 19 Dec 2021, 08:18 +, Jorge Manuel , wrote:
> > > Dear Sirs
> > >
> > > I try to tabulate information in two columns: in the first a have a
> > > text sentence in the second I need to include a list of itens. My
> > > approach is like this:
> > >
> > > \starttabulate[|p(4cm)|p|]
> > >  \FL
> > >  \NC Objetivos \NC Estratégias \NC\NR
> > >  \LL
> > >  \NC Melhorar a qualidade do sucesso educativo \NC
> > >  \startitemize
> > > \item one
> > > \item two
> > > \stopitemize
> > > \NC\NR
> > > \HL
> > > \stoptabulate
> > >
> > > On some cases the text and the list are correctly confined to the
> > > limits (\LL and \HL). But, in other cases, in the second column is
> > > inserted a gap (see the attach). How can I fix this.
> > >
> > > Thanks in advance.
> > >
> > > Jorge Magalhães
> > >
> > > Jorge Magalhães
> > >
> >
> > ___
> > 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
> ___


exter.pdf
Description: Binary data


exter.tex
Description: Binary data
___
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
___