From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/116114 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Fabrice Couvreur via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: About macro numberstriped () Date: Sun, 2 Oct 2022 13:02:59 +0200 Message-ID: References: <18131ab4-f5c7-b5d0-e331-a1f7ddeac221@freedom.nl> <4cb4b1b3-da2c-6783-df4a-c38d486b29b2@klankschap.nl> <288c9ae0-cbfb-1cfb-ad4c-2ef3dcf3b0b9@freedom.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9151617279088880634==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23401"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Fabrice Couvreur To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Oct 02 13:04:59 2022 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oewmJ-0005pu-FK for gctc-ntg-context-518@m.gmane-mx.org; Sun, 02 Oct 2022 13:04:59 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 35ADB2A3682; Sun, 2 Oct 2022 13:04:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RMxAnKNMtWiO; Sun, 2 Oct 2022 13:04:21 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 35ADD2A4093; Sun, 2 Oct 2022 13:04:21 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E0E5B2A3F76 for ; Sun, 2 Oct 2022 13:04:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9MlnTMAhUGJl for ; Sun, 2 Oct 2022 13:04:18 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.216.46; helo=mail-pj1-f46.google.com; envelope-from=fabrice1.couvreur@gmail.com; receiver= Original-Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id EB37B2A3682 for ; Sun, 2 Oct 2022 13:04:17 +0200 (CEST) Original-Received: by mail-pj1-f46.google.com with SMTP id l12so7549929pjh.2 for ; Sun, 02 Oct 2022 04:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date; bh=uL52C2EwsebbBa6Ol9edIJyDxxVp8tRVrb53fp31dpM=; b=O6ZX0aAp6zCjBFoIB8f4cJTAWlfJbd7DJsO6w6Du3cLy4617CVE9sZzNfzBfs5NUrv tFnfa0WYeJinLJkih5xfEw/i5+NDzfGQ4tqdxaTrypYrOy2bJGp0hQeWKkO+f7yIDh/5 V1EXGLIDflqBKZfIpHQ+nTu9+nvZdyPo7tosQTUAld1DcRo4UkBLitf2BXENj9VpFfB/ SznDZyTZ6xbq2eOlbTD9I/WobGSrt8Mh9KvgaV0LQ5ajQo1nu3QF+qSHQ6RPxC5ezvMw gLgwOQ3dXue+1vyOG4UMDIvKOH5wEXIwKxY/1o1QdLrRkBUbtnwCOTTGlmNJBDMG6IBv j2Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date; bh=uL52C2EwsebbBa6Ol9edIJyDxxVp8tRVrb53fp31dpM=; b=y7CFVhUqPn4XNIKzXvyH9P8C6D1RJnxeIH7J4T0b3MMG78gkr4P/xwmklbo3WCYgA8 bGuGwXVRMW5tfoLQ9WIUQBSjN2sacn+2RfrZ0sCr62KPSYDcO7R7fK+Ss+dgliMqfHJD 9VTYIs9gQ8HUhtzkGYvYMm6JKPE0R55NhnO65jK3mXgsQjNpu1a4wWaCFovhW8sjupee YlcKh6n201ctkV1i4tWACE+QEdmBu0TVQY/CXKHZQ7VyYnYiuSXrM+0Llniw3GjJTxab k1bwISBzF7Y5bryqnaMvUpoJVh5vSlvHHeFhikJDVmEibMfgXXzcI+QI758yX+po2KYK vAeQ== X-Gm-Message-State: ACrzQf1gUasKJah73yYt1jVoRcsqlLkfA9jTTNoRC6R1+UxLYAWvhq/a tcla9tg3sCbLsaRF6DnyzS0W5hOtsYCCdPbU4U/Etj6JaG8= X-Google-Smtp-Source: AMsMyM4e3Ytz89UryW1NRwb4dfLeWAPgmYZVIpNnYL7JxQ5Lqzd2H60yHmGNNWuI3ZGQoT1VYzs4C0hhWitF/rzdQLo= X-Received: by 2002:a17:90a:a788:b0:20a:20f5:4f15 with SMTP id f8-20020a17090aa78800b0020a20f54f15mr7088789pjq.91.1664708655624; Sun, 02 Oct 2022 04:04:15 -0700 (PDT) In-Reply-To: <288c9ae0-cbfb-1cfb-ad4c-2ef3dcf3b0b9@freedom.nl> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:116114 Archived-At: --===============9151617279088880634== Content-Type: multipart/alternative; boundary="00000000000012b65105ea0b300d" --00000000000012b65105ea0b300d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I just tried but I got an empty file... Do we agree that I have to replace the two lines with the other two ? Regarding what you proposed, how to get the same type of hatching in both figures ? \startMPcode path p, q, r, b ; p :=3D unitsquare xyscaled (4cm,4cm) ; z[0] =3D (2cm,0cm) ; z[1] =3D (2cm,4cm) ; z[2] =3D (0cm,2cm) ; q :=3D llcorner p--z[0]--z[1]--z[2]--cycle ; r :=3D unitsquare xyscaled (1cm,1cm) shifted(0,3cm) ; b :=3D (0cm,0cm) -- lrcorner r -- lrcorner p -- cycle; draw r withpattern image ( draw (llcorner unitsquare -- urcorner unitsquare) scaled 5mm ; % how to get the corner dots ) withpatternscale 1/4 withpen pencircle scaled 1bp withcolor green ; draw b withpattern image ( draw (llcorner unitsquare -- urcorner unitsquare) scaled 5mm ; % how to get the corner dots ) withpatternscale 1/16 withpen pencircle scaled 1bp withcolor green ; draw b withpen pencircle scaled 1bp withcolor darkgreen; draw r withpen pencircle scaled 1bp withcolor darkgreen; draw p; label.llft("B", p) ; label.lrt("C", p) ; label.ulft("A", p) ; label.urt("D", p) ; label.urt("F", lrcorner r) ; label.lft("E", llcorner r) ; label.top("G", urcorner r) ; \stopMPcode Le dim. 2 oct. 2022 =C3=A0 11:52, Hans Hagen via ntg-context a =C3=A9crit : > On 10/2/2022 11:20 AM, Floris van Manen via ntg-context wrote: > > > > > > On 02/10/2022 10:55, Fabrice Couvreur via ntg-context wrote: > >> Initially, there was a bug with maro numberstriped() and Hans > >> suggested another sensible approach to me, but you don't get the same > >> shape of the hatches depending on the dimensions of the squares. > > > > some unexpected side effect show up when the unitsquare is xyscaled to = a > > rectangle like (2.5cm,1cm) > > it seems related to the angle chosen > > > > e.g. > > > > > > > > \startMPcode > > > > path p, q, r, b ; > > p :=3D unitsquare xyscaled (4cm,4cm) ; > > q :=3D unitsquare xyscaled (1cm,1cm) shifted(0,3cm) ; > > r :=3D unitsquare xyscaled (2.5cm,1cm) shifted(1cm,3cm) ; > > b :=3D unitsquare xyscaled (3cm,3cm) shifted(1cm,0) ; > > > > draw r anglestriped (1,35,2) withcolor red; > > draw q anglestriped (1,35,2) withcolor green; > > draw b anglestriped (1,35,2) withcolor cyan; > > draw p; > > draw q; > > draw b; > > draw r; > > > > label.llft("D", p) ; > > label.lrt("C", p) ; > > label.ulft("A", p) ; > > label.urt("B", p) ; > > label.urt("P", lrcorner r) ; > > label.lft("Q", llcorner r) ; > > label.top("M", urcorner r) ; > > > > \stopMPcode > > for that you can patch mp-tool.mpxl (l 676): > > maximum :=3D max (xpart llcorner mask, xpart urcorner mask, ypar= t > llcorner mask, ypart urcorner mask) ; > minimum :=3D min (xpart llcorner mask, xpart urcorner mask, ypar= t > llcorner mask, ypart urcorner mask) ; > % a hack: > maximum :=3D maximum + max(xpart urcorner shape, ypart urcorner shape); > minimum :=3D minimum - max(xpart urcorner shape, ypart urcorner shape); > > a bit overkill but it seems to work > > 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://www.ntg.nl/mailman/listinfo/ntg-context > webpage : https://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : https://contextgarden.net > > _________________________________________________________________________= __________ > --00000000000012b65105ea0b300d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I just tried but I got an empty file...
Do we agree that I h= ave to replace the two lines with the other two ?
Regarding what you pro= posed, how to get the same type of hatching in both figures ?

=C2= =A0\startMPcode
=C2=A0 =C2=A0 path p, q, r, b ;
=C2=A0 =C2=A0 p =C2= =A0:=3D unitsquare xyscaled (4cm,4cm) ;
=C2=A0 =C2=A0 z[0] =3D (2cm,0cm)= ;
=C2=A0 =C2=A0 z[1] =3D (2cm,4cm) ;
=C2=A0 =C2=A0 z[2] =3D (0cm,2cm= ) ;
=C2=A0 =C2=A0 q :=3D llcorner p--z[0]--z[1]--z[2]--cycle ;
=C2=A0= =C2=A0 r :=3D unitsquare xyscaled (1cm,1cm) shifted(0,3cm) ;
=C2=A0 =C2= =A0 b :=3D (0cm,0cm) -- lrcorner r -- lrcorner p -- cycle;
=C2=A0
= =C2=A0 =C2=A0 =C2=A0draw r
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0withpattern= image (
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0draw (llcorner = unitsquare -- urcorner unitsquare) scaled 5mm ;
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0% how to get the corner dots
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0withpatternscale 1/= 4
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0withpen pencircle scaled 1bp
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0withcolor green
=C2=A0 =C2=A0 =C2=A0;
= =C2=A0 =C2=A0 draw b
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0withpattern image= (
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0draw (llcorner unitsq= uare -- urcorner unitsquare) scaled 5mm ;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0% how to get the corner dots
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0withpatternscale 1/16=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0withpen pencircle scaled 1bp
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0withcolor green
=C2=A0 =C2=A0 =C2=A0;
=C2= =A0 =C2=A0
=C2=A0 =C2=A0
=C2=A0 =C2=A0 draw b =C2=A0withpen pencircle= scaled 1bp =C2=A0withcolor darkgreen;
=C2=A0 =C2=A0 draw r =C2=A0withpe= n pencircle scaled 1bp =C2=A0withcolor darkgreen;
=C2=A0 =C2=A0 draw p;<= br>=C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0 =C2=A0 label.llft("B", p= ) ;
=C2=A0 =C2=A0 label.lrt("C", p) ;
=C2=A0 =C2=A0 label.u= lft("A", p) ;
=C2=A0 =C2=A0 label.urt("D", p) ;
= =C2=A0 =C2=A0 label.urt("F", lrcorner r) ;
=C2=A0 =C2=A0 label= .lft("E", llcorner r) ;
=C2=A0 =C2=A0 label.top("G",= urcorner r) ;
=C2=A0
=C2=A0 \stopMPcode

Le=C2=A0dim. 2 oct= . 2022 =C3=A0=C2=A011:52, Hans Hagen via ntg-context <ntg-context@ntg.nl> a =C3=A9crit=C2=A0:
On 10/2/2022 11:20 AM, F= loris van Manen via ntg-context wrote:
>
>
> On 02/10/2022 10:55, Fabrice Couvreur via ntg-context wrote:
>> Initially, there was a bug with maro numberstriped() and Hans
>> suggested another sensible approach to me, but you don't get t= he same
>> shape of the hatches depending on the dimensions of the squares. >
> some unexpected side effect show up when the unitsquare is xyscaled to= a
> rectangle like (2.5cm,1cm)
> it seems related to the angle chosen
>
> e.g.
>
>
>
> \startMPcode
>
> path p, q, r, b ;
> p=C2=A0 :=3D unitsquare xyscaled (4cm,4cm) ;
> q :=3D unitsquare xyscaled (1cm,1cm) shifted(0,3cm) ;
> r :=3D unitsquare xyscaled (2.5cm,1cm) shifted(1cm,3cm) ;
> b :=3D unitsquare xyscaled (3cm,3cm) shifted(1cm,0) ;
>
> draw r anglestriped (1,35,2) withcolor red;
> draw q anglestriped (1,35,2) withcolor green;
> draw b anglestriped (1,35,2) withcolor cyan;
> draw p;
> draw q;
> draw b;
> draw r;
>
> label.llft("D", p) ;
> label.lrt("C", p) ;
> label.ulft("A", p) ;
> label.urt("B", p) ;
> label.urt("P", lrcorner r) ;
> label.lft("Q", llcorner r) ;
> label.top("M", urcorner r) ;
>
> \stopMPcode

for that you can patch mp-tool.mpxl (l 676):

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0maximum :=3D max (xpart llcorner mask, xp= art urcorner mask, ypart
llcorner mask, ypart urcorner mask) ;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0minimum :=3D min (xpart llcorner mask, xp= art urcorner mask, ypart
llcorner mask, ypart urcorner mask) ;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0% a hack:
maximum :=3D maximum + max(xpart urcorner shape, ypart urcorner shape);
minimum :=3D minimum - max(xpart urcorner shape, ypart urcorner shape);

a bit overkill but it seems to work

Hans

-----------------------------------------------------------------
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0Hans Hagen | PRAGMA ADE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Ridderstraat 27 | 80= 61 GH Hasselt | The Netherlands
=C2=A0 =C2=A0 =C2=A0 =C2=A0 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 t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / https://www.ntg.nl/mailman/listinfo/= ntg-context
webpage=C2=A0 : https://www.pragma-ade.nl / http://context.aanhet.net
archive=C2=A0 :
https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: https://contextgarden.net
___________________________________________________________________________= ________
--00000000000012b65105ea0b300d-- --===============9151617279088880634== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cHM6Ly93d3cubnRnLm5sL21haWxtYW4v bGlzdGluZm8vbnRnLWNvbnRleHQKd2VicGFnZSAgOiBodHRwczovL3d3dy5wcmFnbWEtYWRlLm5s IC8gaHR0cDovL2NvbnRleHQuYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHBzOi8vYml0YnVja2V0 Lm9yZy9waGcvY29udGV4dC1taXJyb3IvY29tbWl0cy8Kd2lraSAgICAgOiBodHRwczovL2NvbnRl eHRnYXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============9151617279088880634==--