~ubuntu-branches/ubuntu/trusty/pyx/trusty

« back to all changes in this revision

Viewing changes to examples/path/at.txt

  • Committer: Bazaar Package Importer
  • Author(s): Stuart Prescott
  • Date: 2011-05-20 00:13:52 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110520001352-7jfc1unuvduxji05
Tags: 0.11.1-1
* New upstream release.
* Change documentation build system to sphinx in line with new upstream docs.
* Rebuild lfs files as part of build process.
* Refresh patchs for new version:
  - drop manual-latex-define.patch no longer needed with sphinx.
  - drop siteconfig-static.patch: not needed with new build system
  - drop pyx-text-warnings26.patch: warnings fixed upstream
* Add patch sphinx-mathjax.patch to use pngmath in sphinx rather than mathjax
  which is not yet in Debian.
* Add patch createlfs-no-foiltex.patch to skip generation of foiltex-based
  lfs files that would require non-free components.
* Switch to dpkg-source 3.0 (quilt) format.
* Switch from python-support to dh_python2 as build helper.
* Update copyright format to newer DEP-5 specification.
* Add new files to copyright file.
* Bump standards version to 3.9.2 (no changes required).
* Set DM-Upload-Allowed: yes

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Positions along a path
 
2
 
 
3
There are several methods to access certain positions at a path. At first there
 
4
are `atbegin` and `atend` methods, which return a coordinate tuple. ...
 
5
 
 
6
! In this example, we have defined a small helper function `mark` to which we
 
7
can pass the return value of the `at...` methods. We do this by transforming
 
8
the sequence in to positional argument of the function call. This Python
 
9
language feature is available by the `*` syntax in the call.
 
10
 
 
11
! The coordinates returned by the `at...` methods are PyX lengths in the
 
12
unscaleable true units similar to the return value of the `arclen` method.
 
13
 
 
14
For the left path `p1`, we also show how to use the `at` method,
 
15
which can be used to get the coordinates of a certain point of the path
 
16
depending on the arc length along the path.
 
17
 
 
18
A different use of the `at` function is shown for the right path `p2`: It is
 
19
also possible to pass parametrization instances of the path to the `at` method.
 
20
In the shown case we first fetch such parametrization instances for the
 
21
beginning and the end of the path by the `begin` and `end` methods. Note that
 
22
the `atbegin` method is equal to call `at` with the result value of the `begin`
 
23
method (except for optimizations: atbegin is faster than the two calls).
 
24
Similar `atend` could be rewritten using the result value of `end`. As shown in
 
25
the example you can use the parametrization instances to add and substract arc
 
26
lengths from selected point.
 
27
 
 
28
! The `at` method of a path instance can not only handle a single value, in
 
29
which case it returns a single result tuple. You can also pass a list to the
 
30
method and the return value will contain a list of coordinate tuples. You
 
31
should bear in mind that passing a list is much more efficient than multiple
 
32
calls of the method performing single conversions at each time.