n-dimensional cad for engineers
ThanCad is an n-dimensional cad, with raster inclusion capability and emphasis in engineering.
It is being written in Python and since it uses the Tkinter library, it is
platform independent! It is also easy to translate it to various languages.
ThanCad is published under
development will proceed with the following steps:
Store the drawing elements in memory so they can be accessed fast.
2. Visualize the drawing elements into screen.
interactive input from the user (mouse click drag, typed commands
4. Create simple elements and capabilities (points, lines,
layers, colors etc.).
5. Implement layers.
6. Design the user
interface so that it can easily be translated to various
(command line is necessary).
7. Store drawings to
8. Plot drawings to plotters and printers.
9. Export to
dxf (easy) and Import from dxf (difficult).
10. Insert raster into
STATUS (July 26, 2016)
am developing ThanCad in my free time, so the progress is slow. Right
now steps 1-7, 9-10 are
ready or partially implemented.
has, at last, been partially implemented, using the Tkinter ability
to produce postscript (with some workarounds). This is coupled with
the ability of CUPS to transparently integrate GhostScript (SuSE
only?), so that postscript will print to any printer!
elements are stored in standard python data structures.
access is moderately fast for Python!
The GUI is split to 2
components. The first is library independent and deals with abstract
menus etc. The second is library dependent and it
implements windows, menus etc. Thus it is easy to
port the GUI to
various libraries. Until version 0.0.2 wxPython was used as a library
(wxPython is a
wxWindows wrapper). Later versions use Tkinter
(Tkinter is the de-facto library that comes along
with python). The
reason for this change is that wxPython didn't seem, then, to work
Linux. In the future the GUI may be ported to other
first be warned that ThanCad is slow because it is written in Python.
Do not expect the speed that commercial CAD have. But because it is
written in a very flexible high level language, its development is at
least 10 times faster. In fact I do not think I would have the
patience to make it in C++. I think that 3 features will make ThanCad
better -well- than cad:
1. ThanCad is free. It is published
under GPL, the GNU General Public License. This means that you don't
pay anything for it, you can copy it as many times as you like, you
can give it to a friend, and you can use it in your home and in your
business. If you are a programmer, you can modify and/or extend
ThanCad, or you can base your software on it. But if you intend to
publish the modified/extended ThanCad (you may want to sell it), you
must give your customers at least the rights that you have with
ThanCad. Please see GPL for details.
2. ThanCad is written in
python, so it is -at least it should be- platform independent.
ThanCad runs modified in Linux, Windows (XP, 7), FreeBSD. It should also run
unmodified in Windows Vista, MACOS, Solaris etc. wherever python runs. I know of some companies
that can not switch to Linux, although they have ported all software
to Linux, because they depend on a commercially available CAD which
runs only in a certain platform. ThanCad will free you to use the OS
of your choice. ThanCad is currently being developed in OPEN SuSE
Linux 12.2. From time to time I run it under Windows XP/7. It is
sentimental to see the program behave the same way under Linux and
Windows, without changing a single line of code.
3. ThanCad supports the "layer sublayer" concept. This means that
a layer may contain sublayers and the sublayers may contain
subsublayers etc. Each layer will have a set of attributes such as
color, line type, visibility, draw order, transparency etc., which
will be shared by all the elements the layer contains. The sublayers
inherit the attributes of their parent by default. But you can
overwrite any attribute if you want. For example imagine that you
draw your house. Suppose you have a ground floor and a first floor.
Naturally you create one layer for each floor. For the first floor
you have the walls, the furniture, the various cables, the
hydraulics. You can create a separate sublayer with different colors
for each category. The same must be done for the ground floor. No
problem, just copy the sublayer structure of the layer of the first
floor to the layer of the second floor. The colors are already set.
If you want to examine the first floor, make the layer of the ground
floor invisible and all its sublayers are automatically made
invisible too! Suppose you want to change the color of the furniture
of the first and the ground floor. Select the common sublayers of the
two layers and change the color of the sublayer of the furniture.
Then you want to draw a garden. Create a layer "house" and
put the layers of the ground and the first floor into it, as
sublayers. Make this layer invisible, and you are free to draw the
- ThanCad is slower in Windows than in Linux. This is probably because
Tkinter is slower in Windows than in Linux. Unfortunately newer
version of Tkinter have not addressed this problem. Perhaps it is not
- The font of the text is built in since Tkinter does
not support rotated fonts. This means that standard X-fonts or
Windows fonts are not available.
- The zoom all command sometimes
does not zoom to the entire drawing. In this case
run regen and
- Many of the objects which contain references to Tkinter
widgets are not destroyed when they are deleted because there are
circular references. Spotting the circular references has proved to
be difficult. The result is memory leaks.
- Finally I am sure
there are many other bugs buried here and there in the code.
ThanCad is usable if you care to save your work frequently. It can read and
write dxf files, it can zoom and pan, and it can add lines, circles,
points, images etc. interactively.
The latest code is published in
as soon as I find the time to upload it!
the basic program is up and running, the following improvements might
1. Add new drawing elements (bezier curves, solids etc.).
2. Add utilities (trimming, extending, intersecting, dimensioning etc.).
3. Add raster editing.
4. Implement various algorithms (triangulation, contour lines etc.).
5. Add profession-specific capabilities (for example cross section of a highway, profile of a
conduit, circuit analysis, etc.).
6. Move the code to C and/or Fortran, for faster execution.
- Version 0.0.1 could only store elements in a structure, without
graphical User Interface (GUI).
- Version 0.0.2 added a
wxPython GUI. Lines, circles, and texts were implemented. Import
dxf was partially implemented.
- Version 0.0.3 changed to
Tkinter GUI. Export to dxf was implemented.
- Version 0.0.4
has better dxf import.
Pan, zoom were greatly enhanced.
Regenerations now happen when it is necessary.
Some bugs in the open/close commands were fixed.
The beginning of nested layers has been
The quadtree structure was dropped because the
overhead was bigger than the gain, in small to medium drawings.
- Version 0.0.6
- has raster image support.
Select window and select
crossing has been implemented.
Layers have 2 working attributes;
color and frozen.
Creation of a topographic grid was implemented -
for engineers at last :)
The beginning of international
translations was done.
Finally the drawing is saved in internal
format, using Python's pickle. This overcomes the deficiencies of
- Version 0.0.7 “Bond”
has now a working command line.
Object snap is quite implemented; and it works fast - that was a
- Version 0.0.8 “DoSomething” has so many enhancements
that it is difficult to remember. Here are some:
has better and colored command line. The name of the commands
are now more “familiar”. So are the menus.
Another layer attribute,
DrawOrder, was implemented which is an integer number; layers with
higher DrawOrder are drawn over the layers with lower DrawOrder.
The selection (or new definition) of layer colors is much better (and
Object snap now includes EndPoint, MidPoint, Center,
Node, Quadrant, Intersection, tangent, nearest modes; there is
also a nice window for the selection of object snap mode.
Right clicking when no command is running pops a menu with common
commands. Right clicking when zoom rt is active quits zoom and
starts pan rt (and vice versa).
Semi-automatic line tracing of a
bitmap (b/w) image is partially implemented.
The first steps to the units command were made.
The first unsuccessful steps to the
nesting of commands were made.
The rectangle command is a
convenience. It draws a closed line shaped as a rectangle.
-Version 0.0.9 “DoesSomething” has also many
enhancements that it is difficult to remember.Here are some:
Massive changes in move,delete,scale,rotate commands.
Old select routines were deleted.
Plot (export) to raster image.
F3 toggles OSNAP on/off.
control arrowup/control arrowdown pans the drawing up/down.
control arrowleft/control arrowright pans the drawing left/right.
gray+/gray- zooms in / zooms out.
thanlcd font, thantimes font (not finished).
Import .shp font file.
Command select (element/window/crossing/previous).
do/undo for erase command.
Added an option to insert a raster image as
a. The insertion point is at -0.5, -0.5 user units
b. The scale is 1 pixel is 1 user unit.
This is needed for rectification of scanned topographic maps, which
have errors due to contraction of paper, and scanner errors.
Command move and copy.
Zoom in/out can be done with middle wheel of the mouse.
Export to PIL has a GUI now (not finalized).
Command Rotate was cleaned and decorated with undo/redo
Export to PIL image and then print as a workaround
to print a drawing.
Command Scale was cleaned and decorated
with undo/redo functions.
ThanCad was presented in EuroPython
2007, Vilnius, Lithuania.
Conversion to limited z capability.
All elements accept z coordinates. In fact ThanCad has now
n-dimensional support. All adaptations to the code for
z-coordinate, also support arbitrary number of dimensions.
CAD is for you!
New status bar supports
view of pixel coordinates when the cursor is over
Toggle between world/pixel coordinates with F7.
Beginnings of GIS support (see educational menu).
Internal support for
embedding other applications into ThanCad (for developers).
Area command implemented.
Fillet command was implemented.
List command shows length, area for line, circles, arcs.
Purge (for layers) was implemented.
The command highlight was
implemented for very small objects to become visible in Tkinter.
The command trim was implemented for lines/polylines, circles and
arcs. It was more difficult than I thought. It took me all day.
The command hull was implemented for lines/polylines. It finds the
2d convex hull of the nodes of the lines.
The centroid was
implemented for lines/polylines. It finds the ndimensional centroid
of the (closed or open) lines.
Line hatch of open (not closed)
shapes was implemented.
Computation and creation of highway
Interchange. This was an existing program that was really awkward to
use with thAtCad (leading commercial CAD :)). I integrated it into
ThanCad and now it is very satisfying. It helps when you make the
_CAD code_ suit the application, and not the other way round :)
Extensive translation to Greek.
The Curve element, which is a
curve represented by many small line segments. The OSNAP end, tan and
cen were implemented. I tested the curve with a clothoid with good
The OSNAP "per"
infrastructure was implemented. The "per" for arcs,
circles, lines was implemented.
Various algorithms for ICP
with lines (published only in scientific papers).
command was implemented. It reverses the orientation of direction of
The mirror command was implemented. It mirrors elements
with respect to a line.
The script file was implemented. It
runs ThanCad commands from a file. Also, the thancad.scr script is
read at start, if it is found in the directory .thancad (~/.thancad
or $windir/.thancad in WinDoze).
command was implemented.
The ortho mode was implemented. The
last 2 changes made me realize that none of the changes/additions to
ThanCad have been trivial. They needed considerable effort, because of
their relationships to the other parts/mechanisms of ThanCad.
Luckily Python was there to ease the coding. How did you cope before
The "fill" layer attribute was implemented.
If "fill" is True then all closed lines (closed polylines,
circles) are filled with solid color (or hatch in the future). The
polygon element was converted to a command which creates a closed
The 'fill' command was implemented. It sets the
'fill' attribute of all layers to ON.If all the leaf layers have the
'fill' attribute on, this is reflected to the 'fill' variable when
exporting to .dxf format.
The 'ThanLineFilled' element was
implemented, which is essentially a closed polyline filled with
color, even if it belongs to a layer with the attribute 'fill' set
to off. This is for compatibility with leading commercial CADs, and
it is certainly inferior to the 'fill' attribute mechanism. The solid
command command now creates a filled triangle or quadrilateral which
are filled polylines. The data is entered with the crazy way of the
leading commercial CADs. The filled polylines with 3 or 4 nodes are
exported to dxf format as solids.
-Version 0.1.0 “Photogrammetric”
Here are the enhancements (most of them as it is hard to remember them all:))
Import from linicad (http://sourceforge.net/projects/linicad/) was
implemented. Request by a user (guess who!).
The Spline element was added.
The copy/cut/paste was fixed. Control-C, Control-X, Control-V now work.
When a point (coordinates) is asked from the user, the user may type
end,int,cen,non etc. to override temporarily the object snap settings.
The dimensions of the last drawing window are saved, so that new windows
are drawn with the same dimensions.
The scan command was implemented. This was a request from a user (my son!).
It uses the pysane package. If pysane is not installed, or if there are no
scanners, it creates a fake scanner. The fake scanner 'scans' always the
same image, but it shows the functionality.
Automatic computation of a floor plan. This was an existing
program that was integrated into ThanCad. Now it is much more convenient
and flexible to use. This is part of active research.
The named point was (fully) implemented. The poedit (point edit) command
was also implemented to make point handling easier.
The plot command is partially implemented. Hooray! It can also save to
a postscript file for later printing or (pre)viewing.
The 'language' command was implemented. You can type 'language' in the
command prompt, or select it from the help menu (the last menu on the
This command changes the language of ThanCad's interface. ThanCad must be
restarted so that all messages are in the new language. English and Greek
is supported so far.
The 'language' command and the menu entry is always in English,
for obvious reasons. If the language is not English, when ThanCad begins
execution, it print a message on how to change the language. The
message is always in English.
The reference point of the rotate and scale command can now be the
insertion point of each element. Thus each element will be scaled
or rotated with respect to its insertion point. This change was done
last year - I just remembered it.
I began to write a new format for ThanCad, which is an xml file.
The command text find in the tools menu will now search for text of
named points too.
Also, pressing ctrl-F will trigger the find command.
The transformation command in the research menu was more or less
implemented. I began working on it in April 2010.
The point element now has a finite size (not zero size) according
to the dimensions of the symbol and name and height (if it is a named
point). The dimensions of the symbols etc are taken relative to the
screen size, so that a regen before zoom extents is needed.
The open command opens multiple drawings at once, now.
The save/saveas commands were implemented (the previous save
command was really the saveas command).
The do/undo mechanism was implemented for continueline,
Explode was implemented for the aligned dimension element.
I have been implementing the do/undo mechanism for all ThanCad's commands
since last month. Many weeks more are needed.
I finished the offset command and corrected bugs in the line offset (it
still has some non-critical bugs). I also implemented the offset command
for circles, arcs and points. I don't think the offset command is needed for
I added new command imagelocate. This command may locate the actual image
file of a ThanCad image, if it was not found. Or it can change the image file
to something new.
I added new command imagedirectory. This command defines a directory, where
ThanCad will search for missing image files, for all ThanCad images, which the
image file was not found of.
I added new command imagelog. This command reads a .log file produced by my
orthophotography program and inserts and puts an image to their correct location
with the correct scale automatically. Multiple .log files may be opened
Image log command can open multiple .log files at once.
Milestone! ThanCad has a second developer (I hope it lasts). She implemented
cosys which creates a non-cartesian coordinate system, given
two (non-)parallel axes. Then, she enhanced F7 which now toggles between
world coordinates, cosys coordinates (which are named "image" coordinates)
and pixel coordinates.
F6 now toggles coordinates on and off (as the mouse moves).
The image insertion was changed so that the image can be inserted in mm.
If the resolution of the image can not be determined (for example for
.gif images), ThanCad asks for the resolution.
A new menu was added for photogrammetry. It uses the functionality of
ThanCad to import images in mm, and then define the "image" coordinate
system. It also draws the axes of the non-cartesian system.
Sometimes the raster images are not in the right orientation and they
must be rotated by 90, 180, or 270 degrees with GIMP, before they are
inserted into ThanCad. Not any more. ThanCad is now able to rotate an
image by 90, 180, and 270 degrees (counterclockwise). The insertion point
and the scale of the the image is not affected. In fact the insertion
point remains the lower-left point of the rotated image.
For 180 degrees, the image geometry is not changed at all.
Andreas Stamos (age 8), created the setup.py for py2exe, in order to make
ThanCad executable in WinDoze. It worked almost painlessly. The only glitch
was that various plugins of the Python Image Library (PIL) had to be
imported explicitely (usually "import Image" imports dynamically the
plugins that are needed).
-Version 0.1.1 “Photogrammetric”
Some bugs were fixed and imageclip was implemented. Image clip affected
all the code related to raster images. And there is room for optimization.
-Version 0.1.2 “Decade”
Here are the enhancements (most of them as it is hard to remember them all:))
Image clip (rectangular) was implemented. That was quite a change.
Correction of a bug that redrew (but did not regen) an Image, when the layer
it belonged to was frozen.
Brighten/darken all the raster images was implemented. These effects can
also be done by gray+ and gray- (without the control button).
All the imports (dxf, syk, brk and so on) were merged to the open
command. The dxfin command remains as an alias.
ThanCad accepts now filenames as arguments. It simply opens all
the files given in the command line.
The menus now have shortcuts with combination of alt-(underlined character).
For the moment, this works only in English.
The camera parameters dialog (and command) was implemented.
Beginnings of the interior orientation in photogrammetry. A 2nd developer
makes a difference especially if she is a girl :)
The purge command now deletes objects (DTM, Triangulation, Non-cartesian system
and photogrammetric model).
Corrected 2 stealth bugs in join command. The first caused join to crash some
times, but some times not. The second cause the joined lines not to show when
The units command was implemented: The dialog, differentiation between angle
and direction angle, and some code to make the units changeable by the user.
The list command now has an option to list the objects which
a drawing currently has (all the objects now inherit from ThanObject and
provide the thanList method).
New cursors: cross, chi, rectangle, circle. The new cursors are dynamically
resizeable: Pressing shift and mousewheel increases/decreases their size.
This is needed for the photogrammetric interior orientation.
The cursor type can be selected by pressing shift and right-click the mouse.
The command joingap (or jg) was implemented. It joins 2 non adjacent lines.
It links the line ends with the least distance.
The straighten command was implemented. It straightens a line between 2
user selected points of the line.
The simplify command accepts now parameters (error 'XYmax', 'XYmean', 'Zmax' and
'keep' original elements).
I added the 'elev' command to the tool menu (elev was implemented a long time
ago). I also started the implementation of the elevn command which displays
and sets the elevation and thickness for dimensions higher than 3.
I added the 'chelevcontour' which changes the elevation of lines progressively.
The user selects first and last line, and first and last elevation, and
all the lines in between are elevated by adding dh=(hlast - hfirst)/n
where n is the number lines between first and last.
The command highlight was deleted. All elements draw a small rectangle if
they are too small to be seen.
The command joingap can join more than 2 lines. However it needs n**2 * log2(n)
computational time, so that if n is big (n>100) there will be delays.
When clicking a line or a point (without having issued a command) the selected
line or point changes color for 3 seconds and small windows with its z dimension
is shown for 3 seconds. This apparently helps surveying engineers to edit
The select command has gained the "f" (layer of) subcommand. When this subcommand
is chosen, ThanCad asks for an element and then selects this element and all the other
elements that belong to the same layer.
The purge command can now delete the do/undo history. This was necessary as
the do/undo persists through invocations of ThanCad. A large do/undo
history delays save considerably. Thus the user has an option to delete it.
However, with the new format .thcx, which does not save the history, this is
The find (text) command now reports the whole text it found. For example
if we are searching for K4 and there is a text K411 (which contains K4)
the find command now shows 'K411" on the command line.
The imageframe command was implemented. Much of the functionality
was already there.
For the past month I have been implementing a new xml-like format for
ThanCad. Until now ThanCad saved the drawing as an object with the cPickle
library. However this is not stable as the objects evolve and ThanCad was
not able to read older files.
I very much wanted to save drawings as standard .svg files, but the format
is too complex. And anyway it does not support the n-dimensional geometry
A permanent handle for each ThanCad element was added. ThanCad already had a
unique code (string) for each element, but the code changed each time
the drawing was loaded. Now the code was made a 64bit integer, and permanent.
Thursday August 25, 2011
ThanCad is 10 years old today! The first (very early) version was ready
on Saturday August 25, 2001 and was published in SourceForge a few days
later. It was a very enjoyable ride, and I don't feel old at all. After
all, Linus Torvalds has been working on Linux for 20 years now :)
Looking back, I can see that starting ThanCad was the right choice. I work
at the National Technical University of Athens (and before that I worked
at a college), and I integrate research projects into ThanCad for
friendliness, robustness, durability and housekeeping reasons. This
routinely demands extensive modifications of the core of ThanCad.
Needless to say, this would not be possible if the source code were not
available. Python was also the right choice. Python enables me to
perform extensive refactoring in hours instead of days and in days
instead of weeks.
The xml-like format for ThanCad is now fully implemented.
ThanCad can export to other formats with the save command.
The big command window which is displayed when the user presses F2 is
now colored as the normal (small) command window.
Bugs in the "recent files" and "opened files" mechanism were corrected.
When the user opens a drawing and the previous drawing is the blank
drawing which ThanCad opens when it starts, the blank drawing closes
automatically. That meant that any messages in the command line of the
blank drawing were lost. Not any more.
The infrastructure and commands for DEMs (Digital Elevation Models) in the
In order to integrate the DEMs with the DTMs already present in ThanCad
extensive changes were made to the object mechanism. Now there can be
multiple DTMs, DEMs (and any other type of objects).
New code was added to return the z coordinates from the correct DEM/DTM
when multiple of those are present.
The profile of a 3D line, which may represent a road or a hydraulic pipe
or a geologic profile or whatever, can now be drawn as a detailed
engineering plan, complete with stations, heights, slopes etc. The
profile is also saved in the .mhk format, which is dedicated to
The PROFILE object was made. It keeps the stations (name, distance, height)
of the profile when a detailed profile is computed and drawn.
The "gradeline" command was added. When a PROFILE object is present in a
drawing, it computes the optimized grade line, writes a .mhk file with
this information, and opens it in another drawing.
The PROFILE object is also created when a quick profile is created.
The "gradeline" command also works here.
The command 'ELEVN' was implemented. It sets the default elevations
of z and higher dimensions.
The command 'CHELEVN' was implemented. It changes the elevations
of z and higher dimensions of the selected elements.
The command 'EDUBIOAZIM' tests a series of roads if they have west-east
as a means to check the bioclimatic design of a city plan.
Andreas Stamos ported ThanCad to FreeBSD (actually PCBSD). It was not much
of a port, as the only trouble was that numpy would deny installation.
Numeric was installed instead. Some changes in p_gnum were needed (max()
and min() functions), but otherwise the code (~100 KLOC) was not touched.
It was very impressive, but of course, ThanCad stands on the shoulders of
giants (Python, Linux, *BSD).
The filet command now handles intersecting lines, and draws the appropriate
arc of the possible four, according to how the user selected the lines.
For some time I needed the orientation of circles, arcs and closed lines
i.e. if they are clockwise or counter-clockwise. For lines it was possible
to tell but cumbersome.
So circles and arcs have now the spin attribute, which is
1 (counter-clockwise) or -1 (clockwise), and which is set to 1 when a circle
or arc is created.
In lines, the spin is computed by the formula which computes the area of the
polygon (which is created by linking the end nodes of the line), given the
the sequence of the polygon coordinates. The formula works even if the
polygon intersects itself, with the meaning if it is mostly clockwise or not.
If the line has only 1 segment then the spin is set to zero.
The "list" command now shows the spin of lines, circles, arcs.
The "reverse" command which handled only lines, now accepts circles and arcs
where it changes the spin attribute.
The dtext command was made a little bit friendlier.
The dtext command can now accept the size and the angle via the mouse.
-Version 0.2.2 “Urban SAR”
I skipped version 0.2.1 which was ready in 2012, but i didn't have the patience
to upload it. Current version 0.2.2 includes all that 0.2.1 had and more. Here
are the changes from version 0.1.2:
ThanCad can now massively open .tif (ortho)images with insertion information
stored in standard .tfw files.
ThanCad now releases memory (the imagez Tkinter PhotoImage object) when an
image is not displayed (after a regen). However, if a regen is not done,
the imagez object of images outside current viewport are not released.
This may eat up memory, when the drawing was few elements, many
(hundreds of) small images, and the zoom factor is big so that the images
are shown bigger.
The status bar now shows a brief explanation of the menu entries, when the
user uses the menu.
Experimental 3d viewing of points was added. Red/blue (actually red/cyan)
glasses are needed.
Image unload and load were implemented. Now images can be unloaded when they
are not used, so that precious RAM is released.
ThanCad can now transform all the elements (not just points and lines),
and thus an entire drawing, using a given transformation by the user. This
is apparently very useful for survey engineers.
ThanCad can now open a drawing forcing all the images unloaded. This
dramatically improves the time ThanCad needs to open a drawing with many
ThanCad now has the option to enter the elevation of a point explicitly.
ThanCad can now automatically compute and draw the plan view of a simple
ThanCad can now create dashed lines, circle, arcs etc. The dash type is
an inheritable attribute of a layer.
The interpolate command was implemented. It interpolates points in long
lines with sparse nodes. Useful for survey engineers.
DDEDIT can now alter the text (i.e the name) of named points.
DEM has now the options to export grid points into .syn format
The DEM command can now load SRTM DEM for the whole earth. The SRTM DEMs
must be downloaded before the use and must be put into certain directories.
Ideally ThanCad should download them after asking the user.
I implemented data input of temperature and humidity measurements. The
data are points whose z coordinate is the temperature or humidity. The data
is input from a .csv file created from an .xls spreadsheet, assuming
that the instrument operator was walking in a grid of straight lines.
The grid spacing is assumed 4 meters.
The code is to aid the diploma thesis of 2 students of the School of Civil
Engineering, National Technical university of Athens, Greece.
Now thanGudGetArc() function respects the positive direction of the angle
set by the units command (i.e. clockwise or counterclockwise).
This means that the measurement of angles, the creation of arcs and the
creation of architectural stairs now respect the positive angle
The global DEMs SRTM and ASTER, are now an internal part of ThanCad.
They are activated through the dem command, and the respective .tif
files are dynamically loaded when needed.
ThanCad was ported to OpenBSD 5.2. It was not much of a port, as the only
trouble was to compile cxFreeze (a few modifications of the setup script
did the job), and cxFreeze is not really necessary. The code (~100 KLOC)
was not touched.
It was very impressive, but of course, ThanCad stands on the shoulders of
giants (Python, Linux, *BSD).
The command background changes the canvas background color.
When exporting to image, now there is an option to change the background
The extend (to boundary edges) command was implemented. The command has
options to extend an element in place, to extend an element so that the
original endpoint is retained (lines only) and to extend an element
without touching by creating a new element for the net extension.
The implementation required the redesign of the intersection functions
and affected ThanCad and other programs. But as the source code was
available, the task was not impossible.
The command 'insert' was implemented. The command functions like 'open'
but it inserts the layers and elements of the chosen drawing into the
A hard to notice bug was fixed in the DTM library. The bug produced correct
results but in few cases the results were slightly non-optimum. Luckily a
ThanCad user noticed it and the bug was fixed.
ThanCad can now import geotiff files, which contain images whose positions
are in the tiff itself. For the moment only a part of the geotiff
specification is supported (orthoimages).
-Version 0.2.3 “Hannover”
Hereafter ThanCad versions will be named after European cities.
Almost all the file types recognized by ThanCad do not define a current
viewport. Dxf files which do have the capability may also not define it.
Thus, many times the default viewport of ThanCad does not show anything or
sometimes it shows the drawing as a tiny dot.
Now, ThanCad zoom to extents when a file does not define a viewport.
ThanCad now can import 3D points stored in Google Earth Keyhole Markup
Language (placemarks), either .kml file or .kmz files. Normally Google
Earth records only x and y coordinates (actually geodetic coordinates
λ, φ). But the user can see the z coordinate by placing the cursor over the
point and then write it by hand on the elevation tab (as absolute elevation).
This z coordinate is imported by ThanCad.
ThanCad now imports the linetype of a layer from a dxf file. If the linetype
is unknown, it substitutes it with the continuous linetype when drawing, but
it keeps it in case the user defines it later.
A bug was, sort of, corrected. When there are elements whose distance from
the origin is huge (10^15 units), but their relative distance is not (for
example 10^3), zoom extents fails. Due to truncation, the coordinates of
lower left and upper right corner are identical. ThanCad will refuse to
zoom automatically. The whole concept must be reconsidered.
ThanCad now can import an image which is split into tiles. The tiles are
named as *r1c1*, *r1c2*, *r1c3*, *r2c1*, *r2c2* etc. r1 means row1 and c3
means column 3. The width and the height are the same
(width=height=tilesize) for all tiles except the last row of all columns
and the last column of all rows which may be less. The tilesize is usually
16384. This kind of tiling is at least used by Digital Globe satellite
ThanCad now reads DEM stored in ESPRI PRJ/BIL format. Both .bil and .prj
files must be present.
-Version 0.2.4 “Valencia”
In the triangulation command, ThanCad now displays all triangles/centroids
regardless of the triangles' dimensions.
The command 'greeceperimeter' draws the perimeter of Greece in EGSA87
coordinates. This is useful if you have the coordinates of a point but you
have no idea where it is.
Support for old .thc files was deleted.
The "extend" command was implemented.
Numpy library removed support of oldnumeric which ThanCad relied on. Now
ThanCad does not need oldnumeric.
ThanCad can now import TerraSAR images (.cos) directly. The conversion
from 16bits to 8bits (gray scale) can be done automatically or semi-automatically.
The "movelinepoint" command was implemented. It is now possible to move an
arbitrary point of a polyline, leaving all the other points at their
I changed "import Image" to "from PIL import Image" to work around some
strange behavior in Pillow (which is a fork of the venerable PIL).
I changed the comparison to None from the "==" operator to the "is" operator
because of an obscure change in the behavior of the python interpreter, which
sometimes (rightly) breaks the code when comparing an object to None.
-Version 0.3.0 “Oberpfaffenhofen”
The most significant change in this version is that ThanCad was ported to python 3.
ThanCad version numbers changed. The first number is a radical release.
The second is an incremental release. The third is for bug fixing.
ThanCad was ported to python3.
ThanCad now imports 3DFACEs from dxf files, and stores them as closed
ThanCad now works with the new numpy lib. The new lib changed the default
functionality of the inplace *= operator from "unsafe" to "same_kind". The
operator was replaced by the function call to numpy.multiply() with
After the suggestion of one of my students, ThanCad now is able to
mirror elements with respect to a point.
----Residence: Athens, Greece, Europe.
PAPERS ABOUT THANCAD (directly or indirectly)
ThanCad was presented in the EuroPython conference held in Vilnius,
Lithuania, July 9-11, 2007.
The presentation is here.
The Binary Spatial Partitioning Tree data structure, which is used by
ThanCad, was presented in The Sixth International Conference on
Engineering Computational Technology, Athens, Greece, 2-5 September, 2008.
The presentation is here.
PROJECTS WHICH USE THANCAD (directly or indirectly)
ThanCad has been used for commercial and academic purposes:
www.ktim.gr used ThanCad to create private cadastre maps in 2008 (sadly the site is no longer
The National Technical University of Athens uses ThanCad for educational purposes (1 semester 2010-2011).
Dimitra Vassilaki, a researcher of the Laboratory of Photogrammetry,
School of Rural and Surveying Engineering,
has contributed code for basic photogrammetry. She uses ThanCad as teaching tool
in the laboratory. The students make measurements on real-world aerial images
loaded in ThanCad.
The National Technical University of Athens continues to use ThanCad for educational purposes
(1 semester 2011-2012).
Two students of the
School of Civil Engineering,
National Technical University of Athens,
used ThanCad to evaluate temperature/humidity measurements for their diploma thesis
Bioclimatic assessment of urban places:
The case of Kotzia square and Dikeosynis square in Athens
(October 2012, in Greek, abstract in English).
Special code was added to ThanCad to import
the measurements from a spreadsheet (as 3D points). Then triangulation creation and
contour lines computation produced isothermal and isohumidity lines.
Updated: July 26, 2016