From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/116119 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 18:15:26 +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> <3d410695-f1a4-19b4-fa89-c8b465ee8e9d@freedom.nl> <8fe891ac-ceb0-4ecb-bd3b-0b7c8246a900@freedom.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0832162172483226234==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="595"; 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 18:17:26 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 1of1eg-000AWb-Fp for gctc-ntg-context-518@m.gmane-mx.org; Sun, 02 Oct 2022 18:17:26 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 9E7A028A1EC; Sun, 2 Oct 2022 18:16:50 +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 JXG790fHGaQb; Sun, 2 Oct 2022 18:16:48 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 52CDA289E7F; Sun, 2 Oct 2022 18:16:48 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A6EE6289E7F for ; Sun, 2 Oct 2022 18:16:46 +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 3V1gdreyowdk for ; Sun, 2 Oct 2022 18:16:45 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.214.175; helo=mail-pl1-f175.google.com; envelope-from=fabrice1.couvreur@gmail.com; receiver= Original-Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (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 42C27289E7A for ; Sun, 2 Oct 2022 18:16:45 +0200 (CEST) Original-Received: by mail-pl1-f175.google.com with SMTP id jo24so7253881plb.13 for ; Sun, 02 Oct 2022 09:16:45 -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=5/4gEAB//TZHelAv/6/Xp+lTrP8mALCIHpqSk2CVGqA=; b=EmnYsNI6Umz5uSvwcwG6HbB9CR0emLWNcPCnCwh8NK/6upV3ly8OMQaJwQaoc42zVZ PrO+bhBKdH581BdaFTl64sRU0oXvId8T5B1Tw8Ht2dnNkpzf2j8BoauS9k+kZ2ThaX1E QB1GLWDC8lV93x064TAC/7b9z9YYxAQfZJ18Ww0qqTyNMUXFvGU6Fcysd7B+8VZYuyW0 cbF8jnJXFYDhBv2E8B5jfR0gkaODlZ5u/p+NzH+r9obtMbPZRbEq/EBN36viBjlrKYbF LKSXVUGFSdTb7ISx9gkxoXDKULZRmn9ro3bvM+QZgUu5QwPh//0HCxJtTU8Y4asW5Cs/ FmoQ== 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=5/4gEAB//TZHelAv/6/Xp+lTrP8mALCIHpqSk2CVGqA=; b=KO/LusxfJnki+td9HPz3nTY9Xkvgqs2SSxrq+D1Y3irNVQLoPVgzmFmXx5jdQiXrrO MuGQq4Nk7DMank94LVZEUlcqer6cnNJpiALrltt/08PIlm9BSUQMGxl8dUngAjmiRXGC QfhGOckY1YM47/5UWF16p+zxY0v0XObMvg4sUmakJoPdqBZzcr6msj5/q/f5k1IzniZA FwcZ453rF1fXIis5u4Hi2XKgCqbUow4+TJWGnnZRZg9dXL6w7igV+4PNvrfRS+iUOH1z VumPp2eZGSNjlBMbBmAbnHYJunMJy6Bf1E9DVdnkUjAVKdMVyVeHbR7OPLd4onXPgu0i /mgQ== X-Gm-Message-State: ACrzQf2MVWTx23Z8KTyt4x3LFB1XbkSrQ4FJLB21Ad7XPkVUBooY+7ki iJL6esHWfOedkhawvUEMZjAIEMsdrqisdqmwakrdMRznFBQ= X-Google-Smtp-Source: AMsMyM6kIn/YhTQFqjAVjmNGp/LRyd0vvdHeLFK1gajmUM5tIR+lqteg8S6NYPC6DredSz0khejI8ajF4lU4sSMtWco= X-Received: by 2002:a17:902:f708:b0:178:9b70:310b with SMTP id h8-20020a170902f70800b001789b70310bmr17923990plo.65.1664727402635; Sun, 02 Oct 2022 09:16:42 -0700 (PDT) In-Reply-To: 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:116119 Archived-At: --===============0832162172483226234== Content-Type: multipart/alternative; boundary="0000000000007b665b05ea0f8d31" --0000000000007b665b05ea0f8d31 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Mikael, Great job ! Thanks Fabrice Le dim. 2 oct. 2022 =C3=A0 15:37, Mikael Sundqvist via ntg-context < ntg-context@ntg.nl> a =C3=A9crit : > Hi, > > On Sun, Oct 2, 2022 at 3:26 PM Hans Hagen via ntg-context > wrote: > > > > On 10/2/2022 3:13 PM, Fabrice Couvreur via ntg-context wrote: > > > Ok, it works very well. Without wanting to insist, how to have the sa= me > > > hatching with two different figures ? > > see upcoming mail from Mikael > > Oh, OK, here it goes. Hans will probably rename things if he adds this. > > \startMPpage[offset=3D1dk] > > vardef Stripe(expr p, a, d) =3D > save thestripe ; picture thestripe ; thestripe :=3D nullpicture ; > save diag ; numeric diag ; diag :=3D 0.55*( abs((urcorner boundingbox p) > - (llcorner boundingbox p)) ) ; > thestripe :=3D image ( > draw (-diag,0) -- (diag, 0) && > for i =3D d step d until diag: > (-diag, i) -- (diag, i) && > (-diag,-i) -- (diag,-i) && > endfor nocycle > withpen currentpen ; > ) ; > thestripe :=3D thestripe shifted center boundingbox p ; > thestripe :=3D thestripe rotatedaround(center boundingbox p, a) ; > clip thestripe to p ; > thestripe > enddef ; > > > path p ; p :=3D fullcircle scaled 3cm && (unitsquare scaled 2cm shifted > (4cm,4cm)) && cycle ; > fill p withcolor darkred ; > draw Stripe(p,30,.2cm) withcolor darkgreen ; > > path q ; q :=3D fullsquare randomized 0.3 scaled 3cm yshifted 5cm ; > fill q withcolor yellow ; > draw Stripe(q,70,.3cm) withcolor red ; > > draw Stripe(p && q && cycle, -20, .5cm) withcolor "orange" ; > > draw p ; > draw q ; > > \stopMPpage > > /Mikael > > _________________________________________________________________________= __________ > 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 > > _________________________________________________________________________= __________ > --0000000000007b665b05ea0f8d31 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi=C2=A0= Mikael,
Great job !
Thanks
Fabrice

Le=C2=A0dim. 2 oct. = 2022 =C3=A0=C2=A015:37, Mikael Sundqvist via ntg-context <ntg-context@ntg.nl> a =C3=A9crit=C2=A0:
<= /div>
Hi,

On Sun, Oct 2, 2022 at 3:26 PM Hans Hagen via ntg-context
<ntg-context@ntg= .nl> wrote:
>
> On 10/2/2022 3:13 PM, Fabrice Couvreur via ntg-context wrote:
> > Ok, it works very well. Without wanting to insist, how to have th= e same
> > hatching with two different figures ?
> see upcoming mail from Mikael

Oh, OK, here it goes. Hans will probably rename things if he adds this.

\startMPpage[offset=3D1dk]

vardef Stripe(expr p, a, d) =3D
save thestripe ; picture thestripe ; thestripe :=3D nullpicture ;
save diag ; numeric diag ; diag :=3D 0.55*( abs((urcorner boundingbox p) - (llcorner boundingbox p)) ) ;
thestripe :=3D image (
draw (-diag,0) -- (diag, 0) &&
for i =3D d step d until diag:
(-diag, i) -- (diag, i) &&
(-diag,-i) -- (diag,-i) &&
endfor nocycle
withpen currentpen ;
) ;
thestripe :=3D thestripe shifted center boundingbox p ;
thestripe :=3D thestripe rotatedaround(center boundingbox p, a) ;
clip thestripe to p ;
thestripe
enddef ;


path p ; p :=3D fullcircle scaled 3cm && (unitsquare scaled 2cm shi= fted
(4cm,4cm)) && cycle ;
fill p withcolor darkred ;
draw Stripe(p,30,.2cm) withcolor darkgreen ;

path q ; q :=3D fullsquare randomized 0.3 scaled 3cm yshifted 5cm ;
fill q withcolor yellow ;
draw Stripe(q,70,.3cm) withcolor red ;

draw Stripe(p && q && cycle, -20, .5cm) withcolor "ora= nge" ;

draw p ;
draw q ;

\stopMPpage

/Mikael
___________________________________________________________________________= ________
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
___________________________________________________________________________= ________
--0000000000007b665b05ea0f8d31-- --===============0832162172483226234== 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== --===============0832162172483226234==--