From: Henning Hraban Ramm via ntg-context <ntg-context@ntg.nl>
To: ntg-context@ntg.nl
Cc: Henning Hraban Ramm <texml@fiee.net>
Subject: Re: Iterating over MP paths (was: Fuzzy lines)
Date: Fri, 21 Jan 2022 19:00:45 +0100 [thread overview]
Message-ID: <1ea8bf41-6845-d4b5-3be5-7bdc76736ab2@fiee.net> (raw)
In-Reply-To: <D47272DD-83D4-4153-A928-3300BE7610AA@fiee.net>
Am 03.09.21 um 18:04 schrieb Henning Hraban Ramm via ntg-context:
> Would it make sense to check if a point is an edge point (without curve controls)?
In a private reply to my old message, Hans explained to me why this was
not possible like I thought (check if the point has control points),
since every point has control points.
But I didn’t keep at it last fall, and the MP foo is still weak in this
one, so, let’s try again:
If I iterate over the points of a path like in
beginfig(1);
path p;
p = (0,0) .. (2cm,4cm) -- (4cm,5cm) .. (5cm,6cm) .. (8cm,7cm);
draw p withpen pencircle scaled 2pt withcolor .7 white;
for t=0 upto length p:
drawdot point t of p withpen pencircle scaled 4pt withcolor red;
endfor
endfig;
[2]
How can I check if the point is an edge?
(I want to randomize only the non-edge points.)
1. First or last point: if t=0 or t=length p.
... if the path is not closed: if not cycle p.
OK
2. Would it make sense to check curl or tension?
Can I check if the connection is specified as -- ?
??
[2]
Other question on the examples from
https://tex.stackexchange.com/questions/288259/how-to-draw-dots-equally-spaced-along-a-path,
in the answer by Thruston:
I want to split the path between (edge) points in segments of the same
length. So disregarding the "edge" issue for now, how do I get at the
path segment between points (in the for loop above) so that I can use it
as a new path q in:
for t=0 step s until arclength q:
drawdot point arctime t of q of q withpen pencircle scaled 4pt
withcolor red;
endfor
Hraban
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2022-01-21 18:00 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-11 10:58 Fuzzy lines Henning Hraban Ramm
2021-05-11 11:30 ` Mikael Sundqvist
2021-05-11 12:33 ` Henning Hraban Ramm
2021-05-11 12:56 ` Jairo A. del Rio
2021-05-11 16:02 ` Aditya Mahajan
2021-05-12 18:07 ` Henning Hraban Ramm
2021-05-13 13:08 ` Henning Hraban Ramm
2021-05-13 16:36 ` Aditya Mahajan
2021-05-13 16:55 ` Henning Hraban Ramm
2021-05-13 17:17 ` Aditya Mahajan
2021-05-13 18:02 ` Henning Hraban Ramm
2021-05-13 18:26 ` Thomas A. Schmitz
2021-05-13 19:42 ` Henning Hraban Ramm
2021-05-14 15:08 ` Thomas A. Schmitz
2021-05-13 22:39 ` Aditya Mahajan
2021-05-14 9:43 ` Hans Hagen
2021-05-14 20:33 ` Henning Hraban Ramm
2021-09-03 16:04 ` Henning Hraban Ramm via ntg-context
2022-01-21 18:00 ` Henning Hraban Ramm via ntg-context [this message]
2021-05-14 10:05 ` Hans Hagen
2021-05-12 17:55 ` Henning Hraban Ramm
[not found] ` <CAKyqqaaosis=BjOD_mArY5VM+bzcj-ar4uMtnt8SRJ2WLL9ykw@mail.gmail.com>
2021-05-12 21:21 ` Fwd: " Jairo A. del Rio
2021-05-13 13:23 ` Henning Hraban Ramm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1ea8bf41-6845-d4b5-3be5-7bdc76736ab2@fiee.net \
--to=ntg-context@ntg.nl \
--cc=texml@fiee.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).