6 Pict Finders

▼ |  | Pict: Functional Pictures

1 | Pict Datatype
2 | Basic Pict Constructors
3 | Pict Combiners
4 | Pict Drawing Adjusters
5 | Bounding Box Adjusters
6 | Pict Finders
7 | More Pict Constructors
8 | Animation Helpers
9 | Color Helpers
10 | Shadows
11 | Conditional Combinations
12 | Tree Layout
13 | Miscellaneous
14 | Rendering
15 | Conversion to Picts

On this page:

lt-find
ltl-find
lc-find
lbl-find
lb-find
ct-find
ctl-find
cc-find
cbl-find
cb-find
rt-find
rtl-find
rc-find
rbl-find
rb-find
pict-path?
launder

top contents ← prev up next →

## 6 Pict Finders🔗ℹ

> > procedure
> > (lt-find pict find [#:nth nth]) |  | → |  |
> > real? |  | real?
> pict : pict-convertible?
> find : pict-path?
> nth : (or/c exact-nonnegative-integer? 'unique) = 0
> (ltl-find pict find [#:nth nth]) |  | → |  |
> real? |  | real?
> pict : pict-convertible?
> find : pict-path?
> nth : (or/c exact-nonnegative-integer? 'unique) = 0
> (lc-find pict find [#:nth nth]) |  | → |  |
> real? |  | real?
> pict : pict-convertible?
> find : pict-path?
> nth : (or/c exact-nonnegative-integer? 'unique) = 0
> (lbl-find pict find [#:nth nth]) |  | → |  |
> real? |  | real?
> pict : pict-convertible?
> find : pict-path?
> nth : (or/c exact-nonnegative-integer? 'unique) = 0
> (lb-find pict find [#:nth nth]) |  | → |  |
> real? |  | real?
> pict : pict-convertible?
> find : pict-path?
> nth : (or/c exact-nonnegative-integer? 'unique) = 0
> (ct-find pict find [#:nth nth]) |  | → |  |
> real? |  | real?
> pict : pict-convertible?
> find : pict-path?
> nth : (or/c exact-nonnegative-integer? 'unique) = 0
> (ctl-find pict find [#:nth nth]) |  | → |  |
> real? |  | real?
> pict : pict-convertible?
> find : pict-path?
> nth : (or/c exact-nonnegative-integer? 'unique) = 0
> (cc-find pict find [#:nth nth]) |  | → |  |
> real? |  | real?
> pict : pict-convertible?
> find : pict-path?
> nth : (or/c exact-nonnegative-integer? 'unique) = 0
> (cbl-find pict find [#:nth nth]) |  | → |  |
> real? |  | real?
> pict : pict-convertible?
> find : pict-path?
> nth : (or/c exact-nonnegative-integer? 'unique) = 0
> (cb-find pict find [#:nth nth]) |  | → |  |
> real? |  | real?
> pict : pict-convertible?
> find : pict-path?
> nth : (or/c exact-nonnegative-integer? 'unique) = 0
> (rt-find pict find [#:nth nth]) |  | → |  |
> real? |  | real?
> pict : pict-convertible?
> find : pict-path?
> nth : (or/c exact-nonnegative-integer? 'unique) = 0
> (rtl-find pict find [#:nth nth]) |  | → |  |
> real? |  | real?
> pict : pict-convertible?
> find : pict-path?
> nth : (or/c exact-nonnegative-integer? 'unique) = 0
> (rc-find pict find [#:nth nth]) |  | → |  |
> real? |  | real?
> pict : pict-convertible?
> find : pict-path?
> nth : (or/c exact-nonnegative-integer? 'unique) = 0
> (rbl-find pict find [#:nth nth]) |  | → |  |
> real? |  | real?
> pict : pict-convertible?
> find : pict-path?
> nth : (or/c exact-nonnegative-integer? 'unique) = 0
> (rb-find pict find [#:nth nth]) |  | → |  |
> real? |  | real?
> pict : pict-convertible?
> find : pict-path?
> nth : (or/c exact-nonnegative-integer? 'unique) = 0

Locates a pict designated by find within pict. If find is a pict, then the pict must have been created as some combination involving find.

If find is a list, then the first element of find must be within pict, the second element of find must be within the first element, and so on. In general, the i+1st element must be within the ith element, so the list can provide a path to some specific pict, in case there is more than one occurrence of the pict that’s being searched for within pict.

If the last pict in find exists multiple times in the enclosing pict (either pict or the next-to-last element of find), then the location for the first found occurrence is returned by default. If nth is a larger number, then then first nth found locations are skipped. If nth is 'unique, then all instances are found, and an error is reported if multiple instances are found at different locations.

Examples:

> > (define p1 (disk 60))
> > (define p2 (rectangle 60 60))
> > (define p3 (hc-append p1 p2))
> > (define p4 (hc-append p3 (arrow 60 0)))
> > (lt-find p4 p1)
> 0
> 0
> > (cb-find p4 p2)
> 90
> 60
> > (rb-find p3 p1)
> 60
> 60
> > (lt-find p4 (list p1))
> 0
> 0
> > (lt-find p4 (list p2 p1))
> lt-find: sub-pict not found
> sub-pict: #<pict>
> in: #<pict>
> > (lt-find p4 (list p2))
> 60
> 0
> > (lt-find p4 (list p3 p2))
> 60
> 0
> > (pin-over p4 p2 lt-find
> (colorize (text "lt-find") "darkgreen"))
> > (panorama
> (pin-over p4 p2 rb-find
> (colorize (text "rb-find") "darkgreen")))

Changed in version 1.11 of package pict-lib: Removed implicit truncation of some centered coordinates to integers.
Changed in version 1.16: Added the nth argument.

> procedure (pict-path? v) → boolean?
> v : any/c

Returns #t if v is a pict-convertible? or a non-empty list of pict-convertible?s.

Examples:

> > (pict-path? null)
> #f
> > (pict-path? (disk 30))
> #t
> > (pict-path? (list (disk 30) (rectangle 10 10)))
> #t

> procedure (launder pict) → pict?
> pict : pict-convertible?

Creates a pict that has the same drawing and bounding box of pict, but which hides all of its sub-picts so that they cannot be found with functions like lt-find. If pict has a last-line pict, then the laundered pict has a fresh last-line pict with the same shape and location.

Examples:

> > (define p1 (disk 60))
> > (define p2 (rectangle 60 60))
> > (define p3 (hc-append p1 p2))
> > (lt-find (launder p4) p3)
> lt-find: sub-pict not found
> sub-pict: #<pict>
> in: #<pict>

top contents ← prev up next →