This file is indexed.

/usr/share/doc/pythoncad/usage.html is in pythoncad 0.1.37.0-3.

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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="#internalStyle" type="text/css"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>PythonCAD Usage</title>
<style type="text/css" id="internalStyle">
h1.center { text-align: center }
</style>
</head>
<body>
<h1 class="center">
Usage Questions and Answers
</h1>
<p>
A stated goal of the PythonCAD project is to produce an easy to use CAD
package. Still, questions will arise as to how to do some certain operation
in PythonCAD. This page will hopefully provide answers to these questions.
Keep in mind that the program is in its earliest form, so an answer stating
<q>That cannot be done as the code for doing that has not yet been
written</q> will be common. Over time, that answer should appear less
and less frequently, and some happy day in the future it will not appear
at all. If you are able to help develop the code and do so, that day arrives
sooner.
</p>
<h3><strong>How do I ...</strong></h3>
<ul>
<li><a href="#enter_data">enter a point/radius/...?</a></li>
<li><a href="#layers">work with layers?</a></li>
<li><a href="#printing">print a drawing?</a></li>
<li><a href="#setting_attributes">set the color/linetype/thickness/... of an object?</a></li>
<li><a href="#changing_attributes">change the color/linetype/thickness/... of an object?</a></li>
<li><a href="#customizing">add a new linetype/style/dimstyle?</a></li>
<li><a href="#dimensioning">set dimension attributes?</a></li>
<li><a href="#commands">enter commands?</a></li>
</ul>
<p>
This list is by no means complete, and will be added to as various
new question arise.
</p>
<h4 id="enter_data">Entering Data</h4>
<p>
If you are being prompted for a single value of something, like the
radius of a circle, just type it in the entry field below the drawing.
If you type in the value as an integer value (no decimal point), PythonCAD
will convert it to a float value if needed. If it does not do this then you
have found a bug.  When PythonCAD wants you enter a point in the entry
area below the drawing, it will expect you to enter the point in parenthesis,
with the <q>x</q> and <q>y</q> coordinates separated by a comma.
So, if you wanted to enter a point at the location (0.0,0.0), just type it
in like that. You do not need quotes around the parentheses, nor around the
digits.
</p>
<p>
Some effort is made to evaluate what you enter, so if you enter the point
like this <code>((3.4 + 5.5), (2.3 + 3.2))</code>, PythonCAD will create
a point at (8.9, 5.5). Entering any arbitrary expression into will probably
not work (yet), though at some point it is hoped that PythonCAD will be
able to handle really complex expressions. As Python itself can handle
the expressions, the weakness is in the PythonCAD code.
</p>
<h4 id="layers">Working with Layers</h4>
<p>
PythonCAD is built around the idea that a drawing is simply a collection
of layers with various entities stored in each layer. There is no restriction
as to how many layers a drawing may have. All drawings will have at least
one layer, and, if you wanted to, you could put all the entities comprising
the drawing in that single layer. As drawings get more complex, though, it
will probably be clearer if you split up the entities between the layers. One
idea could be to place all the dimensions in a layer, the construction lines
and circles in another, etc. You will have to decide what works best for
your particular needs.
</p>
<p>
Nearly all the layer operations can be done through the layer display
on the side of the drawing. If you right-click a particular layer, a
pop-up menu will appear. This menu gives you the choices of renaming the
layer, hiding or showing it, and hiding or showing any layers that are
<q>children</q> of that layer. Eventually the code will allow you
to drag and drop the layers so you can re-parent them as needed. For now
the drag and drop functionality only allows you to re-order the layers
under a parent. That is, the children layers <q>A-B-C</q> can be
reordered to <q>A-C-B</q>.
</p>
<p>
If you add a new layer, the new layer becomes the <q>active</q> layer.
Any entities that are drawn will now be stored in this layer. If you want
to change which layer is active, just click on the layer that you want to
activate. When a drawing has multiple layers, the entities in the active
layer are drawn showing what color they have. Entities kept in the inactive
layers are all drawn the same color (currently a blue color). A future
release will allow you to choose the color for inactive layers, but for
now you have to stick with blue.
</p>
<p>
If you draw an object in one layer, and then decide you want to move it
to another layer, you can do that through the use of the <q>Transfer</q>
menu item in the <q>Modify</q> menu. After you invoke the menu item,
you can click on the objects that you want to pull into the current active
layer. Fillets and chamfers cannot be pulled from one layer to another just
yet; this problem should be rectified in an upcoming release. 
</p>
<h4 id="printing">Printing and Plotting</h4>
<p>
As of the seventeenth release, PythonCAD can now print! The program will
generate a PostScript file that can be sent to a printer or saved to
a file. The initial printing support has several know flaws, such as
not printing the dimension end-point markers like arrows or slashes.
Subsequent releases will fix these problems as well as enhance the
overall printing abilities of the program.
</p>
<p>
The strategy for printing support had always been to generate a file in
some format that did not depend on the interface, and PostScript has
filled that bill nicely. For people not using PostScript printers, there
are third party software packages like
<a href="http://www.cs.wisc.edu/~ghost">Ghostscript</a> that can convert
the PostScript output into other formats.
</p>
<h4 id="setting_attributes">Setting Object Attributes</h4>
<p>
The current linetype, color, style, and line thickness are all set from
the <q>Set</q> submenu in the <q>Draw</q> menu. Depending on
which menu choice you make, a dialog box will appear and allow you to
set the value of whatever attribute you wish to change.
</p>
<h4 id="changing_attributes">Changing Object Attributes</h4>
<p>
The ability to change an objects color, linetype, thickness, or style was
added in the second release. First, you must select the objects that you
want to change. Use the <q>Select</q> menu item in the <q>Edit</q>
menu to select the entities that will get modified. Next, go to the
<q>Modify</q> menu, and use one of the choices found in the
<q>Change</q> submenu. After clicking <q>OK</q> in whichever
dialog box that appears, the selected objects will now have the new attribute
values from your menu and dialog choice.
</p>
<p>
There is currently no easy way to identify which entities are selected,
and this deficiency will be rectified in an upcoming release. Also, after
changing the attribute of the selected entities, the selected entity list
is cleared. This behavior may or may not be a considered a feature, and
could change depending on user feedback.
</p>
<h4 id="customizing">Adding new Linetypes/Styles/Dimension Styles</h4>
<p>
There is no interface code written for doing this yet, so adding one of
these things means delving into the code. There should be either a simple
dialog box, or a sequence of dialogs, that will make it easy to do this
sort of work, but none of that has been written. Also, questions regarding
the saving and loading of these customized features will need answers, as
the initial release (and probably many following releases) do not have
any support for reading what would be a customization or preferences file.
</p>
<p>
For storing preferences, it is envisioned that there will be a global set
of preferences stored in some file, and a user-specific set of preferences
kept in each user&apos;s directory. If these files are written in Python code,
then they could be brought into the program via an <code>import</code>
statement, or the use of the <code>imp</code> module, though the decision
as to what these files will be written in, let alone their format, has
yet to be made. Feedback to the developers will determine what route to
pursue. Other file format options are things like XML or some home-grown
key/value text file.
</p>
<p>
Writing the preference files in Python does seem to present advantages
over other formats, as there would be no need to try and write some sort
of parser to read the file. Reading the file would be very quick, and any
errors could be caught by a simple try/except block. Other alternatives
could require more work for the importation of the data in the files. Still,
it may be simpler to write the information <em>out</em> in a format other
than Python, and that may be a deciding factor on just how to handle this
problem.
</p>
<p>
<strong>Update</strong>: Storing the preferences as files written in Python
has been implemented since the fifth release. This approach has utilized
the <code>imp</code> module to load the file and, as the preference file
is Python code, makes use of the Python interpreter to parse the file. This
approach has worked reasonably well, and has provided a good initial
implementation of storing and loading user preferences. At present editing
the global preference file is done with a text editor, and probably requires
root access as the file is hard-coded to reside in the /etc/pythoncad/
directory. A user can copy this file to a $HOME/.pythoncad/ directory
and modify it to their own needs. It is planned that in some future revision
the file paths will be more adjustable, as well as be more suitable for
non-unix platforms.
</p>
<h4 id="dimensioning">Dimensioning</h4>
<p>
Dimensions are currently the most complex objects in PythonCAD. Any individual
dimension has a large number of attributes that can be set, such as line
and font color, dimension text position and formatting, and various properties
relating to the dimension lines themselves. Dimensions are also at a very
early stage in the code, so for all the things they can do, there are many
lines of code still needing to be written in order to exercise all the
dimension functionality that exists.
</p>
<p>
The fourth release of PythonCAD addressed many of the shortcomings in
the earlier releases. Angular dimensions can be created, displayed, and
saved, and linear dimensions will be displayed (they could be created but
wouldn't show up). The display of the dimension text is also improved,
and the interactive creation of dimensions now has some visual feedback
to indicate the dimension points and text location. There is still much
work to be added in making dimensions more flexible and editable, but
progress is being made, and the fourth release contains vastly improved
dimensioning capabilities.
</p>
<p>
General dimension properties can be set through the <q>Preferences</q>
menu item in the <q>Dimension</q> menu. Ideally, all drawing preferences
will be set though a single <q>Preferences</q> menu, and there will not
be one in both the <q>Edit</q> and <q>Dimension</q> menus. The
reason there are two menus now is that the author did not have a good way
to integrate dimensional preferences with the preference dialog that exists
in the <q>Edit</q> menu. It is clear that using a notebook widget with
<em>lots</em> of pages is not a good user interface design. The current
layout for selecting preferences needs to be completely reworked, as the
program will gain many more user-definable options in the coming releases.
Examples of good preference dialogs would be welcomed, as a clear, concise
means of setting preferences will probably borrow ideas from them.
</p>
<p>
For the initial releases, the easiest way to find out what a dimension can
do is poke around the dimension preference dialog, alter some of the
settings, then go dimension some objects in a drawing. Be advised that
PythonCAD will not add a dimension to a drawing if it is duplicating an
existing dimension. For example, if you have a drawing consisting of
a single line segment, this drawing can have at most one horizontal
dimension, one vertical dimension, and one linear dimension. You cannot
draw multiple identical dimensions between two points, as the second, third,
fourth, etc. dimension would just be repeating the information given in the
first dimension. This behavior is considered a feature, and it will take
a number of good reasons for changing this design decision.
</p>
<h4 id="commands">Commands</h4>
<p>
The seventh release of PythonCAD shipped with the first iteration of
a command interpreter. The long-term goal with the command interpreter
is to make it possible to use PythonCAD to a great extent by just typing
commands in the entry box at the bottom of the screen. As this functionality
is new, it is quite limited in what it can do at the moment. Future releases
of PythonCAD will add more commands and enhance the usability of the
command interpreter.
</p>
<p>
Visit <a href="commands.html">this</a> page for a description of the available
commands in PythonCAD.
</p>
</body>
</html>