From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/116112 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 11:49:32 +0200 Message-ID: References: <18131ab4-f5c7-b5d0-e331-a1f7ddeac221@freedom.nl> <4cb4b1b3-da2c-6783-df4a-c38d486b29b2@klankschap.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3071422840670536006==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="714"; 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 11:51:19 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 1oevd0-000AYx-T0 for gctc-ntg-context-518@m.gmane-mx.org; Sun, 02 Oct 2022 11:51:18 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 844D42A3643; Sun, 2 Oct 2022 11:50:55 +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 X4FdYoTz5HeD; Sun, 2 Oct 2022 11:50:53 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 89E8C2A3F76; Sun, 2 Oct 2022 11:50:53 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 1872E2A3682 for ; Sun, 2 Oct 2022 11:50:52 +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 9KevZDmoXh7v for ; Sun, 2 Oct 2022 11:50:50 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.215.176; helo=mail-pg1-f176.google.com; envelope-from=fabrice1.couvreur@gmail.com; receiver= Original-Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) (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 A50602A3643 for ; Sun, 2 Oct 2022 11:50:50 +0200 (CEST) Original-Received: by mail-pg1-f176.google.com with SMTP id f193so7564354pgc.0 for ; Sun, 02 Oct 2022 02:50:50 -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=MeoTMo8oSdTRywqDFk4zQFy7biC7U/tesWO/o1z07ek=; b=JFZ4q2B8Uh2V1R68pMeIFnM7GfnSDK5p4pJYSm60mKlmhZGb9NeN+57/wIi7LjApJc 32oKY7ZAVxu9QA6kqblebD5BQ49mjtYKAp2bWieZxjJVC8kKXPm7VPtB9UjbZnQDhZ2d w8gUWbHrwCLdsn4wH+vHDCFQGmSO8WgQy9gY0IE3xonYwi+7shwhNuIZktijtsy+Prut w5gXIkZj3LsVyVJPyf+SAtFrEpwYxSi6BM6H4NGYoXu0hHHRxeDgIxHL16eIlIsrcvuA QYplLEI+WNZ5ckrIKDa1nr2//ErioWLbDAUKb6WkCzDTUsblmf0IxPDV5pFJPKQzmWRJ Vp+A== 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=MeoTMo8oSdTRywqDFk4zQFy7biC7U/tesWO/o1z07ek=; b=m2sThUHvs0v+LDycH+7EsNs2ngrl7OO5OYyIc7sbhK42/E3h4o++afeY2kH9CKNsBj 0FY87GhBe0L0G/l+gd1Iy+AuwWRNhB+5TyTZ1hKKvebeQGglQb3nBGGq2Hi3yiLwRMcI yfhDNEQsJIasLrFva1vzeZeEubxIei+gVFJ5evXa2pKD6aYnXJ0VDCzv1pK8Hxx9OjUl UlZUsLc+rRQ5m1WpYd1TTHhwJBxLb5SqmlFuVBcTaRM0JhgSfIcs85OlmKz4hIQHe6ZW lzs59z5X8SLVX8M+/MBhdczDorKnGhI+zdL0WTK/0gnfkx4Bd8oBzy05z1GJ4/tcpWQp sFqQ== X-Gm-Message-State: ACrzQf1faYDtVf5d6z6wSkhTbe33Jg7iIJCVG/Gx74ZU7xV9HL+pTrdc v1tciAh1W39DaYhhkbQR4h7tWh5M0bcTMj4o+CuJGJtuN0M= X-Google-Smtp-Source: AMsMyM7YMs0BleC4YIynadyburJk4SzPKnmaBUE8zwomR2YXW7Pu8Emcu4BSi/e5cYt7NhlkODneWLFNUElMzbEn16U= X-Received: by 2002:a05:6a00:22c7:b0:544:bbf0:8780 with SMTP id f7-20020a056a0022c700b00544bbf08780mr17156391pfj.80.1664704248550; Sun, 02 Oct 2022 02:50:48 -0700 (PDT) In-Reply-To: <4cb4b1b3-da2c-6783-df4a-c38d486b29b2@klankschap.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:116112 Archived-At: --===============3071422840670536006== Content-Type: multipart/alternative; boundary="000000000000641a4005ea0a298b" --000000000000641a4005ea0a298b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Not only, it is also true with the code below : \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 anglestriped (1,45,2) withcolor green; draw b anglestriped (1,45,2) withcolor green; draw b withcolor darkgreen; draw r 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:21, Floris van Manen via ntg-context < ntg-context@ntg.nl> a =C3=A9crit : > > > 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 th= e > > 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 > > _________________________________________________________________________= __________ > 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 > > _________________________________________________________________________= __________ > --000000000000641a4005ea0a298b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Not only, it is also true with the code below :

<= div class=3D"gmail_default" style=3D"font-family:verdana,sans-serif">\start= MPcode
=C2=A0 =C2=A0 path p, q, r, b ;
=C2=A0 =C2=A0 p =C2=A0:=3D uni= tsquare 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 draw r anglestriped (1,45,2) withcolor green;
=C2=A0 =C2=A0 draw = b anglestriped (1,45,2) withcolor green;
=C2=A0 =C2=A0
=C2=A0 =C2=A0 = draw b withcolor darkgreen;
=C2=A0 =C2=A0 draw r withcolor darkgreen;=C2=A0 =C2=A0 draw p;
=C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0 =C2=A0 labe= l.llft("B", p) ;
=C2=A0 =C2=A0 label.lrt("C", p) ;=C2=A0 =C2=A0 label.ulft("A", p) ;
=C2=A0 =C2=A0 label.urt(&= quot;D", p) ;
=C2=A0 =C2=A0 label.urt("F", lrcorner r) ;<= br>=C2=A0 =C2=A0 label.lft("E", llcorner r) ;
=C2=A0 =C2=A0 la= bel.top("G", urcorner r) ;
=C2=A0
=C2=A0 \stopMPcode

Le=C2=A0dim. 2 oct. 2022 =C3=A0=C2=A011:21, Floris van Manen via ntg-co= ntext <ntg-context@ntg.nl> = a =C3=A9crit=C2=A0:


On 02/10/2022 10:55, Fabrice Couvreur via ntg-context wrote:
> Initially, there was a bug with maro numberstriped() and Hans suggeste= d
> 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=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
___________________________________________________________________________= ________
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
___________________________________________________________________________= ________
--000000000000641a4005ea0a298b-- --===============3071422840670536006== 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== --===============3071422840670536006==--