From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/111362 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Henning Hraban Ramm Newsgroups: gmane.comp.tex.context Subject: Re: Fuzzy lines Date: Thu, 13 May 2021 20:02:14 +0200 Message-ID: References: <5CD0C6B2-D23C-45A4-A04F-B0809EBBF501@fiee.net> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.20\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_660AF168-0D4C-462D-B2EB-07C56FBA594C" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11335"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu May 13 20:02:40 2021 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 1lhFfU-0002pa-4I for gctc-ntg-context-518@m.gmane-mx.org; Thu, 13 May 2021 20:02:40 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 73CDC2837C9; Thu, 13 May 2021 20:02:22 +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 Y57OaDOCt-wN; Thu, 13 May 2021 20:02:21 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7879C2837CB; Thu, 13 May 2021 20:02:21 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 0204F2837C9 for ; Thu, 13 May 2021 20:02: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 NcvAcGFBWSaO for ; Thu, 13 May 2021 20:02:17 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=188.68.63.98; helo=relay.yourmailgateway.de; envelope-from=texml@fiee.net; receiver= Original-Received: from relay.yourmailgateway.de (relay.yourmailgateway.de [188.68.63.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 6E7FE280356 for ; Thu, 13 May 2021 20:02:17 +0200 (CEST) Original-Received: from mors-relay-2501.netcup.net (localhost [127.0.0.1]) by mors-relay-2501.netcup.net (Postfix) with ESMTPS id 4FgzyJ68J3z6WBC for ; Thu, 13 May 2021 20:02:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiee.net; s=key2; t=1620928936; bh=BriO+vKzFdi3CQMwdXPz85rzyra0U193Lu4wQmUY3/8=; h=From:Subject:Date:References:To:In-Reply-To:From; b=V0WY5j4OIYGbHYtJUJW8CdAGPnXC4Hi6jIvKT9+TFbxWfI3AFImHFUZsG1u0AMW1E 6r+Lc+lb3Z3kXMLDVBuwXTTnDZJCi6HlTahTA16nVQFqsl3ftodrj11pqEeo3rLvpC mpAUmGQDbOuIOKmWvoagy57qUeOdX9XMwOB2B1osJlFBS4xZqZxHuxW1/S/CdIV9Yp M0jvHy6qKoAby5HPWi/WdNp7FLFgJU8LPh+DFl36riubagteFIXvUsdBea245HkPc6 6K6GDcYrg4dzwJBDwy4I6DFceiUg7/3WNxck7B+WnY/2vIC6n+7pg1NvuN8vsOFqoI 6H2sk4tuUk9Eg== Original-Received: from policy01-mors.netcup.net (unknown [46.38.225.35]) by mors-relay-2501.netcup.net (Postfix) with ESMTPS id 4FgzyJ5k0zz5LMX for ; Thu, 13 May 2021 20:02:16 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at policy01-mors.netcup.net Original-Received: from mxf9ac.netcup.net (unknown [10.243.12.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by policy01-mors.netcup.net (Postfix) with ESMTPS id 4FgzyH6RSSz8tGG for ; Thu, 13 May 2021 20:02:15 +0200 (CEST) Original-Received: from [192.168.43.208] (dynamic-046-114-007-093.46.114.pool.telefonica.de [46.114.7.93]) by mxf9ac.netcup.net (Postfix) with ESMTPSA id 311BB120029 for ; Thu, 13 May 2021 20:02:15 +0200 (CEST) Authentication-Results: mxf9ac; spf=pass (sender IP is 46.114.7.93) smtp.mailfrom=texml@fiee.net smtp.helo=[192.168.43.208] Received-SPF: pass (mxf9ac: connection is authenticated) In-Reply-To: X-Mailer: Apple Mail (2.3445.104.20) X-PPP-Message-ID: <162092893552.6011.10309286187246240857@mxf9ac.netcup.net> X-PPP-Vhost: fiee.net X-NC-CID: N/bbZ6VHT3Uf5H0kIB89YS1uCymMk+tOBn4yz1PD 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:111362 Archived-At: --Apple-Mail=_660AF168-0D4C-462D-B2EB-07C56FBA594C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Am 13.05.2021 um 19:17 schrieb Aditya Mahajan : >=20 > On Thu, 13 May 2021, Henning Hraban Ramm wrote: >=20 >>=20 >>> Am 13.05.2021 um 18:36 schrieb Aditya Mahajan : >>>=20 >>>> Now I want to draw that path several times. >>>>=20 >>>> If I understand it right, I can=E2=80=99t put that into = "sketchdraw" because that leaves the end open for path additions like = "withcolor". >>>=20 >>> A slightly different approach is needed. See attached. I also added = a bit a error protection in case someone sets sketch_passes to be = negative by mistake.=20 >>=20 >> Thank you so much! >=20 > Here is a different effect ... more of a trembling hand drawing than a = sketch. You can play around with sketch_amount to see some variation.=20 >=20 > In this, rather than using the default randomized path (which = randomizes the points of a path), I split the path into 20 segments, and = randomize each segment.=20 Thank you, that is what I was asking for! Unfortunately, the deviation of edge points is too big =E2=80=93 try my = attached test file. Strangely, if I include the MP code in a ConTeXt document, the = transparency doesn=E2=80=99t work (it multiplies, but at 100%); I must = add "withtransparency ("multiply", 0.2)" to my draw command. I=E2=80=99ll = try to come up with a MWE. (Transparency of an image also doesn=E2=80=99t = work in that document.) My test file also includes the noise overlay after Jairo=E2=80=99s = suggestions. Maybe you want to implement that, too? At the moment it still doesn=E2=80=99t respect the pen size, and the = number of patterns per path is fixed. Hraban --Apple-Mail=_660AF168-0D4C-462D-B2EB-07C56FBA594C Content-Disposition: attachment; filename=sketchtest.mp Content-Type: application/octet-stream; x-unix-mode=0644; name="sketchtest.mp" Content-Transfer-Encoding: 7bit input mp-sketch; beginfig(1) color darkblue ; darkblue := (40/255,67/255,117/255) ; color beige ; beige := (248/255,245/255,236/255) ; %pickup pensquare xyscaled 4bp rotated 30 ; % bleed box, paper shading fill (-3mm,-3mm)--(-3mm,300mm)--(213mm,300mm)--(213mm,-3mm)--cycle withcolor beige; pen pillpen ; pillpen := makepen ((-1.5bp,-0.5bp)--(1.5bp,-0.5bp)..(1.5bp,0.5bp)--(-1.5bp,0.5bp)..cycle) ; pickup pillpen xyscaled 3bp ; sketchypaths; sketch_amount := 5bp; sketch_passes := 5; sketch_segments := 5; path one ; one := (-3mm,249mm) -- (185mm,249mm) -- (185mm,300mm) ; % links-oben path two ; two := (25.5mm,-3mm) -- (25.5mm,130mm) -- (213mm,130mm) ; % unten-rechts draw one withcolor darkblue; draw two withcolor darkblue; picture NoisePattern; NoisePattern := image( pickup pencircle xyscaled 0.5bp; numeric pmax ; pmax := 7 ; for i = 1 upto pmax: for j = 1 upto pmax: draw (i - (pmax/2), j - (pmax/2)) withcolor darkblue withtransparency ("normal", (uniformdeviate 0.33)); endfor endfor ); def noisify(expr p) = for i = 0 step 1/100 until length p: draw NoisePattern randomized 1 shifted point i of p ; endfor enddef; noisify(one); noisify(two); naturalizepaths; % Restore the value of draw and fill % draw crop box (paper size) pickup pencircle xyscaled 0.5bp; draw (0,0)--(0,297mm)--(210mm,297mm)--(210mm,0)--cycle withcolor magenta; % begingroup; % save Rnd; let Rnd = uniformdeviate; % % numeric u; u := 3mm; % picture PlumaToo; % PlumaToo := image( % for i = 1 upto pmax: % for j = 1 upto pmax: % fill fullcircle shifted (i - (pmax/2), j - (pmax/2)); %try fulltriangle or another shape % endfor % endfor % ); % % for i = 0 step 1/20 until length one: % draw image( % for x within PlumaToo: % fill pathpart x %Assuming our image only contains cyclic paths % scaled (1+Rnd 1) % shifted (1/2dir Rnd 360) % withcolor hsvtorgb(6round(Rnd 60),9/10,1) %Colors just because they look cute % withtransparency ("normal", Rnd 1); % endfor % ) rotated (90 + angle direction i of one) % shifted point i of one; % endfor % endgroup; endfig --Apple-Mail=_660AF168-0D4C-462D-B2EB-07C56FBA594C Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --Apple-Mail=_660AF168-0D4C-462D-B2EB-07C56FBA594C--