/usr/share/doc/python-pyx-doc/html/box.html is in python-pyx-doc 0.11.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Module box: Convex box handling — PyX v0.11.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '0.11.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="PyX v0.11.1 documentation" href="index.html" />
<link rel="next" title="Module connector" href="connector.html" />
<link rel="prev" title="Axes" href="axis.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="connector.html" title="Module connector"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="axis.html" title="Axes"
accesskey="P">previous</a> |</li>
<li><a href="manual.html">PyX v0.11.1 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<span class="target" id="module-box"></span><div class="section" id="module-box-convex-box-handling">
<h1>Module <a class="reference internal" href="#module-box" title="box"><tt class="xref py py-mod docutils literal"><span class="pre">box</span></tt></a>: Convex box handling<a class="headerlink" href="#module-box-convex-box-handling" title="Permalink to this headline">¶</a></h1>
<p>This module has a quite internal character, but might still be useful from the
users point of view. It might also get further enhanced to cover a broader range
of standard arranging problems.</p>
<p>In the context of this module a box is a convex polygon having optionally a
center coordinate, which plays an important role for the box alignment. The
center might not at all be central, but it should be within the box. The
convexity is necessary in order to keep the problems to be solved by this module
quite a bit easier and unambiguous.</p>
<p>Directions (for the alignment etc.) are usually provided as pairs (dx, dy)
within this module. It is required, that at least one of these two numbers is
unequal to zero. No further assumptions are taken.</p>
<div class="section" id="polygon">
<h2>Polygon<a class="headerlink" href="#polygon" title="Permalink to this headline">¶</a></h2>
<p>A polygon is the most general case of a box. It is an instance of the class
<tt class="docutils literal"><span class="pre">polygon</span></tt>. The constructor takes a list of points (which are (x, y) tuples) in
the keyword argument <tt class="docutils literal"><span class="pre">corners</span></tt> and optionally another (x, y) tuple as the
keyword argument <tt class="docutils literal"><span class="pre">center</span></tt>. The corners have to be ordered counterclockwise. In
the following list some methods of this <tt class="docutils literal"><span class="pre">polygon</span></tt> class are explained:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">path(centerradius=None,</span> <span class="pre">bezierradius=None,</span> <span class="pre">beziersoftness=1)</span></tt>:</dt>
<dd>returns a path of the box; the center might be marked by a small circle of
radius <tt class="docutils literal"><span class="pre">centerradius</span></tt>; the corners might be rounded using the parameters
<tt class="docutils literal"><span class="pre">bezierradius</span></tt> and <tt class="docutils literal"><span class="pre">beziersoftness</span></tt>. For each corner of the box there may be
one value for beziersoftness and two bezierradii. For convenience, it is not
necessary to specify the whole list (for beziersoftness) and the whole list of
lists (bezierradius) here. You may give a single value and/or a 2-tuple instead.</dd>
<dt><tt class="docutils literal"><span class="pre">transform(*trafos)</span></tt>:</dt>
<dd>performs a list of transformations to the box</dd>
<dt><tt class="docutils literal"><span class="pre">reltransform(*trafos)</span></tt>:</dt>
<dd>performs a list of transformations to the box relative to the box center</dd>
</dl>
<div class="figure align-center" id="fig-boxalign">
<img alt="_images/boxalign.png" src="_images/boxalign.png" />
<p class="caption">circle and line alignment examples (equal direction and distance)</p>
</div>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">circlealignvector(a,</span> <span class="pre">dx,</span> <span class="pre">dy)</span></tt>:</dt>
<dd>returns a vector (a tuple (x, y)) to align the box at a circle with radius <tt class="docutils literal"><span class="pre">a</span></tt>
in the direction (<tt class="docutils literal"><span class="pre">dx</span></tt>, <tt class="docutils literal"><span class="pre">dy</span></tt>); see figure <a class="reference internal" href="#fig-boxalign"><em>circle and line alignment examples (equal direction and distance)</em></a></dd>
<dt><tt class="docutils literal"><span class="pre">linealignvector(a,</span> <span class="pre">dx,</span> <span class="pre">dy)</span></tt>:</dt>
<dd>as above, but align at a line with distance <tt class="docutils literal"><span class="pre">a</span></tt></dd>
<dt><tt class="docutils literal"><span class="pre">circlealign(a,</span> <span class="pre">dx,</span> <span class="pre">dy)</span></tt>:</dt>
<dd>as circlealignvector, but perform the alignment instead of returning the vector</dd>
<dt><tt class="docutils literal"><span class="pre">linealign(a,</span> <span class="pre">dx,</span> <span class="pre">dy)</span></tt>:</dt>
<dd>as linealignvector, but perform the alignment instead of returning the vector</dd>
<dt><tt class="docutils literal"><span class="pre">extent(dx,</span> <span class="pre">dy)</span></tt>:</dt>
<dd>extent of the box in the direction (<tt class="docutils literal"><span class="pre">dx</span></tt>, <tt class="docutils literal"><span class="pre">dy</span></tt>)</dd>
<dt><tt class="docutils literal"><span class="pre">pointdistance(x,</span> <span class="pre">y)</span></tt>:</dt>
<dd>distance of the point (<tt class="docutils literal"><span class="pre">x</span></tt>, <tt class="docutils literal"><span class="pre">y</span></tt>) to the box; the point must be outside of
the box</dd>
<dt><tt class="docutils literal"><span class="pre">boxdistance(other)</span></tt>:</dt>
<dd>distance of the box to the box <tt class="docutils literal"><span class="pre">other</span></tt>; when the boxes are overlapping,
<tt class="docutils literal"><span class="pre">BoxCrossError</span></tt> is raised</dd>
<dt><tt class="docutils literal"><span class="pre">bbox()</span></tt>:</dt>
<dd>returns a bounding box instance appropriate to the box</dd>
</dl>
</div>
<div class="section" id="functions-working-on-a-box-list">
<h2>Functions working on a box list<a class="headerlink" href="#functions-working-on-a-box-list" title="Permalink to this headline">¶</a></h2>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">circlealignequal(boxes,</span> <span class="pre">a,</span> <span class="pre">dx,</span> <span class="pre">dy)</span></tt>:</dt>
<dd>Performs a circle alignment of the boxes <tt class="docutils literal"><span class="pre">boxes</span></tt> using the parameters <tt class="docutils literal"><span class="pre">a</span></tt>,
<tt class="docutils literal"><span class="pre">dx</span></tt>, and <tt class="docutils literal"><span class="pre">dy</span></tt> as in the <tt class="docutils literal"><span class="pre">circlealign</span></tt> method. For the length of the
alignment vector its largest value is taken for all cases.</dd>
<dt><tt class="docutils literal"><span class="pre">linealignequal(boxes,</span> <span class="pre">a,</span> <span class="pre">dx,</span> <span class="pre">dy)</span></tt>:</dt>
<dd>as above, but performing a line alignment</dd>
<dt><tt class="docutils literal"><span class="pre">tile(boxes,</span> <span class="pre">a,</span> <span class="pre">dx,</span> <span class="pre">dy)</span></tt>:</dt>
<dd>tiles the boxes <tt class="docutils literal"><span class="pre">boxes</span></tt> with a distance <tt class="docutils literal"><span class="pre">a</span></tt> between the boxes (in addition
the maximal box extent in the given direction (<tt class="docutils literal"><span class="pre">dx</span></tt>, <tt class="docutils literal"><span class="pre">dy</span></tt>) is taken into
account)</dd>
</dl>
</div>
<div class="section" id="rectangular-boxes">
<h2>Rectangular boxes<a class="headerlink" href="#rectangular-boxes" title="Permalink to this headline">¶</a></h2>
<p>For easier creation of rectangular boxes, the module provides the specialized
class <tt class="docutils literal"><span class="pre">rect</span></tt>. Its constructor first takes four parameters, namely the x, y
position and the box width and height. Additionally, for the definition of the
position of the center, two keyword arguments are available. The parameter
<tt class="docutils literal"><span class="pre">relcenter</span></tt> takes a tuple containing a relative x, y position of the center
(they are relative to the box extent, thus values between <tt class="docutils literal"><span class="pre">0</span></tt> and <tt class="docutils literal"><span class="pre">1</span></tt> should
be used). The parameter <tt class="docutils literal"><span class="pre">abscenter</span></tt> takes a tuple containing the x and y
position of the center. This values are measured with respect to the lower left
corner of the box. By default, the center of the rectangular box is set to this
lower left corner.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="manual.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Module <tt class="docutils literal"><span class="pre">box</span></tt>: Convex box handling</a><ul>
<li><a class="reference internal" href="#polygon">Polygon</a></li>
<li><a class="reference internal" href="#functions-working-on-a-box-list">Functions working on a box list</a></li>
<li><a class="reference internal" href="#rectangular-boxes">Rectangular boxes</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="axis.html"
title="previous chapter">Axes</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="connector.html"
title="next chapter">Module <tt class="docutils literal"><span class="pre">connector</span></tt></a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/box.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="connector.html" title="Module connector"
>next</a> |</li>
<li class="right" >
<a href="axis.html" title="Axes"
>previous</a> |</li>
<li><a href="manual.html">PyX v0.11.1 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2011, Jörg Lehmann, Michael Schindler, André Wobst.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div>
</body>
</html>
|