SourceForge.net Logo stopsoftwarepatents.eu petition banner

Athens

FSFE Newsletter ThanCad
n-dimensional cad for engineers


GENERAL

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 GPL.

DEVELOPMENT STEPS

The development will proceed with the following steps:

1. Store the drawing elements in memory so they can be accessed fast.
2. Visualize the drawing elements into screen.
3. Get interactive input from the user (mouse click drag, typed commands etc.).
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 languages
(command line is necessary).
7. Store drawings to disk.
8. Plot drawings to plotters and printers.
9. Export to dxf (easy) and Import from dxf (difficult).
10. Insert raster into drawings.

CURRENT STATUS (May 9, 2022)

I am developing ThanCad in my free time, so the progress is slow. Right now steps 1-7, 9-10 are
ready or partially implemented.
Step 8 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!
The drawing elements are stored in standard python data structures.
Element access is moderately fast for Python!
The GUI is split to 2 components. The first is library independent and deals with abstract windows,
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 properly under
Linux. In the future the GUI may be ported to other libraries.

FEATURES

At 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 garden.

BUGS

- 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 possible.
- 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 retry.
- 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.

DOWNLOADS

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 sourceforge, as soon as I find the time to upload it!

IMPROVEMENTS

After the basic program is up and running, the following improvements might be considered:

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.

HISTORY

- 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
from dxf was partially implemented.

- Version 0.0.3 changed to Tkinter GUI. Export to dxf was implemented.

- Version 0.0.4

-Version 0.0.5 - Version 0.0.6 - Version 0.0.7 “Bond” - Version 0.0.8 “DoSomething” has so many enhancements that it is difficult to remember. Here are some:
  1. Massive changes in move,delete,scale,rotate commands.
  2. Old select routines were deleted.
  3. Plot (export) to raster image.
  4. 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.
  5. thanlcd font, thantimes font (not finished).
  6. Import .shp font file.
  7. Command select (element/window/crossing/previous).
  8. Command list.
  9. Command erase.
  10. do/undo mechanism.
    do/undo for erase command.
  11. Added an option to insert a raster image as follows:
    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.
  12. Command move and copy.
  13. Zoom in/out can be done with middle wheel of the mouse.
  14. Export to PIL has a GUI now (not finalized).
  15. Command Rotate was cleaned and decorated with undo/redo functions.
  16. Export to PIL image and then print as a workaround to print a drawing.
  17. Command Scale was cleaned and decorated with undo/redo functions.
  18. ThanCad was presented in EuroPython 2007, Vilnius, Lithuania.
  19. Conversion to limited z capability. All elements accept z coordinates. In fact ThanCad has now n-dimensional support. All adaptations to the code for the z-coordinate, also support arbitrary number of dimensions. Physicists this CAD is for you!
  20. New status bar supports view of pixel coordinates when the cursor is over raster images. Toggle between world/pixel coordinates with F7.
  21. Beginnings of GIS support (see educational menu).
  22. Internal support for embedding other applications into ThanCad (for developers).
-Version 0.0.9 “DoesSomething” has also many enhancements that it is difficult to remember.Here are some:
  1. Area command implemented.
  2. Fillet command was implemented.
  3. List command shows length, area for line, circles, arcs.
  4. Purge (for layers) was implemented.
  5. The command highlight was implemented for very small objects to become visible in Tkinter.
  6. The command trim was implemented for lines/polylines, circles and arcs. It was more difficult than I thought. It took me all day.
  7. The command hull was implemented for lines/polylines. It finds the 2d convex hull of the nodes of the lines.
  8. The centroid was implemented for lines/polylines. It finds the ndimensional centroid of the (closed or open) lines.
  9. Line hatch of open (not closed) shapes was implemented.
  10. 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 :)
  11. Extensive translation to Greek.
  12. 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 (approximate) results.
  13. The OSNAP "per" infrastructure was implemented. The "per" for arcs, circles, lines was implemented.
  14. Various algorithms for ICP with lines (published only in scientific papers).
  15. The reverse command was implemented. It reverses the orientation of direction of lines.
  16. The mirror command was implemented. It mirrors elements with respect to a line.
  17. 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).
  18. The "ddedit" command was implemented.
  19. 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 Python?
  20. 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 polyline.
  21. 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.
  22. 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:))
  1. Import from linicad (http://sourceforge.net/projects/linicad/) was implemented. Request by a user (guess who!).
  2. The Spline element was added.
  3. The copy/cut/paste was fixed. Control-C, Control-X, Control-V now work.
  4. 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.
  5. The dimensions of the last drawing window are saved, so that new windows are drawn with the same dimensions.
  6. 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.
  7. 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.
  8. The named point was (fully) implemented. The poedit (point edit) command was also implemented to make point handling easier.
  9. The plot command is partially implemented. Hooray! It can also save to a postscript file for later printing or (pre)viewing.
  10. 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 right). 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.
  11. 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.
  12. I began to write a new format for ThanCad, which is an xml file.
  13. 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.
  14. The transformation command in the research menu was more or less implemented. I began working on it in April 2010.
  15. 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.
  16. The open command opens multiple drawings at once, now.
  17. The save/saveas commands were implemented (the previous save command was really the saveas command).
  18. The do/undo mechanism was implemented for continueline, trim commands.
  19. Explode was implemented for the aligned dimension element.
  20. I have been implementing the do/undo mechanism for all ThanCad's commands since last month. Many weeks more are needed.
  21. 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 texts, images.
  22. 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.
  23. 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.
  24. 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 at once.
  25. Image log command can open multiple .log files at once.
  26. 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.
  27. F6 now toggles coordinates on and off (as the mouse moves).
  28. 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.
  29. 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.
  30. 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.
  31. 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:))
  1. Image clip (rectangular) was implemented. That was quite a change.
  2. Correction of a bug that redrew (but did not regen) an Image, when the layer it belonged to was frozen.
  3. Brighten/darken all the raster images was implemented. These effects can also be done by gray+ and gray- (without the control button).
  4. All the imports (dxf, syk, brk and so on) were merged to the open command. The dxfin command remains as an alias.
  5. ThanCad accepts now filenames as arguments. It simply opens all the files given in the command line.
  6. The menus now have shortcuts with combination of alt-(underlined character). For the moment, this works only in English.
  7. The camera parameters dialog (and command) was implemented.
  8. Beginnings of the interior orientation in photogrammetry. A 2nd developer makes a difference especially if she is a girl :)
  9. The purge command now deletes objects (DTM, Triangulation, Non-cartesian system and photogrammetric model).
  10. 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 regen, sometimes.
  11. The units command was implemented: The dialog, differentiation between angle and direction angle, and some code to make the units changeable by the user.
  12. 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).
  13. 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.
  14. The command joingap (or jg) was implemented. It joins 2 non adjacent lines. It links the line ends with the least distance.
  15. The straighten command was implemented. It straightens a line between 2 user selected points of the line.
  16. The simplify command accepts now parameters (error 'XYmax', 'XYmean', 'Zmax' and 'keep' original elements).
  17. 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.
  18. 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.
  19. The command highlight was deleted. All elements draw a small rectangle if they are too small to be seen.
  20. 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.
  21. 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 contour lines.
  22. 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.
  23. 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 not important.
  24. 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.
  25. The imageframe command was implemented. Much of the functionality was already there.
  26. 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 of ThanCad.
  27. 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.
  28. 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.
  29. The xml-like format for ThanCad is now fully implemented.
  30. ThanCad can export to other formats with the save command.
  31. The big command window which is displayed when the user presses F2 is now colored as the normal (small) command window.
  32. Bugs in the "recent files" and "opened files" mechanism were corrected.
  33. 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.
  34. The infrastructure and commands for DEMs (Digital Elevation Models) in the engineering menu.
  35. 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.
  36. 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 profiles.
  37. The PROFILE object was made. It keeps the stations (name, distance, height) of the profile when a detailed profile is computed and drawn.
  38. 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.
  39. The PROFILE object is also created when a quick profile is created. The "gradeline" command also works here.
  40. The command 'ELEVN' was implemented. It sets the default elevations of z and higher dimensions.
  41. The command 'CHELEVN' was implemented. It changes the elevations of z and higher dimensions of the selected elements.
  42. 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.
  43. 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).
  44. The filet command now handles intersecting lines, and draws the appropriate arc of the possible four, according to how the user selected the lines.
  45. 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.
  46. The dtext command was made a little bit friendlier.
  47. 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:
  1. ThanCad can now massively open .tif (ortho)images with insertion information stored in standard .tfw files.
  2. 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.
  3. The status bar now shows a brief explanation of the menu entries, when the user uses the menu.
  4. Experimental 3d viewing of points was added. Red/blue (actually red/cyan) glasses are needed.
  5. Image unload and load were implemented. Now images can be unloaded when they are not used, so that precious RAM is released.
  6. 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.
  7. ThanCad can now open a drawing forcing all the images unloaded. This dramatically improves the time ThanCad needs to open a drawing with many images.
  8. ThanCad now has the option to enter the elevation of a point explicitly.
  9. ThanCad can now automatically compute and draw the plan view of a simple stair case.
  10. ThanCad can now create dashed lines, circle, arcs etc. The dash type is an inheritable attribute of a layer.
  11. The interpolate command was implemented. It interpolates points in long lines with sparse nodes. Useful for survey engineers.
  12. DDEDIT can now alter the text (i.e the name) of named points.
  13. DEM has now the options to export grid points into .syn format
  14. 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.
  15. 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.
  16. 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 direction
  17. 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.
  18. 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).
  19. The command background changes the canvas background color.
  20. When exporting to image, now there is an option to change the background color.
  21. 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.
  22. The command 'insert' was implemented. The command functions like 'open' but it inserts the layers and elements of the chosen drawing into the current one.
  23. 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.
  24. 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.
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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 images.
  6. ThanCad now reads DEM stored in ESPRI PRJ/BIL format. Both .bil and .prj files must be present.

-Version 0.2.4 “Valencia”
  1. In the triangulation command, ThanCad now displays all triangles/centroids regardless of the triangles' dimensions.
  2. 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.
  3. Support for old .thc files was deleted.
  4. The "extend" command was implemented.
  5. Numpy library removed support of oldnumeric which ThanCad relied on. Now ThanCad does not need oldnumeric.
  6. ThanCad can now import TerraSAR images (.cos) directly. The conversion from 16bits to 8bits (gray scale) can be done automatically or semi-automatically.
  7. The "movelinepoint" command was implemented. It is now possible to move an arbitrary point of a polyline, leaving all the other points at their original position.
  8. 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).
  9. 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.
  1. ThanCad version numbers changed. The first number is a radical release. The second is an incremental release. The third is for bug fixing.
  2. ThanCad was ported to python3.
  3. ThanCad now imports 3DFACEs from dxf files, and stores them as closed polylines.
  4. 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 casting="unsafe".
  5. After the suggestion of one of my students, ThanCad now is able to mirror elements with respect to a point.

-Version 0.4.0 “Prague”
  1. Now ThanCad shows the GPL license in English, if the language is English.
  2. A bug in importation of dxf dash (linetype) definition was corrected. A dxf had 2 consequtive dashes (positive) and no space (negative) at all. In this case ThanCad adds space equal to the dash.
  3. I changed ThanFont to take unicode text. The codes of line font thanprime1 changed to unicode (instead of iso8859-7). On the occasion, I corrected the underscore character, and the Greek capital letters I and Y with dialytika.
    The other fonts (except thanprime1) are not transformed to unicode yet.
  4. A new version of the thcx file (0,4,0) was created. ThanCad reads and saves version 0,4,0 thcx files with utf_8 encoding. Older thcx versions (< 0,4,0) are read with iso8859_7 encoding.
  5. Text files .dxf, .syk, .brk, .syn, .xyz, .mhk now are read/saved replacing undefined characters in the encoding with "?".
    .kml, .kmz files are read/saved as binary because the underlying ElementTree() object sets the encoding defined in the kml, kmz themselves.
    .lin, .lcad are read/saved as binary because the undelying mechanism is pickle.
  6. Import from the new format (.lcad) of linicad (http://sourceforge.net/projects/linicad/) was implemented. ThanCad also supports the old format (.lin) even though linicad does not support it any more!
  7. A new command, "encoding", selects the encoding which the text files are read/written with. It currently affects .dxf, .syk, .brk, .syn, .xyz, .mhk files.
  8. ThanCad imports placemarks from a .kml file as points. Now, the id of the placemark's style is imported as layer and the colour of the style as colour of the layer.
    Export to .kml file, creates a style for every ThanCad layer. The id of the style is the pathname of the layer (with slashes converted to __) and the colour of the style is the (monitor) colour of the layer.
  9. The import of .kml/.kmz files now autotransforms the GRS80 geodetic coordinates Ξ»,Ο† of the .kml file to the easting, northing of the geodetic projection defined in the ThanCad drawing. The elevation z is not changed at all, and it may be orthometric or geometric as defined in the .kml file.
    In order to import a .kml file in a projection other than the default projection (which currently is EGSA87), a new drawing must be created. The geodetic projection of this new drawing is set to the desired projection. Then the .kml file is inserted to this drawing.
  10. The multiplication symbol times (unicode decimal code 215) was added to the thanfontprime font.
  11. ThanCad now can import (topographic) points from spreadsheets (.xls or .xlsx). The points must be in the first sheet, at columns 1-4. Column 1 contains the name, and columns 2-4 the x, y, z coordinates. The z coordinate may be absent (taken as zero). Blank rows are ignored. Syntax errors trigger warnings, but the rest of points are imported.
  12. After the import of (topographic) points from .xls, .xlsx or .syn files, the layer where the points were put into, has now its attributes "hidename" and "hideheight" set to False. But if the z coordinates of the points are absent or invalid the "hideheight" attribute is set to True.
  13. ThanCad now can import lines from spreadsheets (.xls or .xlsx). The lines must be in the first sheet, at columns 1-3. Columns 1-3 contain the x, y, z coordinates of the lines. Different lines are separated by one or more empty rows. The z coordinate may be absent (taken as zero). Syntax errors cause the import to fail.
  14. The .j2w file for image georeferencing, now searchs for .jpg files as well as for .jp2 files.
  15. The export to kml now respects the geodetic projection of the drawing. Before it always used EGSA87. The geodetic projection can be set using the "geodeticprojection" command.
  16. The FACE3D element was added.
  17. ThanCad now can import a surface from spreadsheets (.xls or .xlsx). The surface must be in the first sheet. Row 1 contains the x coordinates of a grid (of variable step), column 1 contains the y coordinates of the grid, and the remaining cells contain the z coordinates of the surface. Syntax errors cause the import to fail.
    The surface is represented by neighboring 3dfaces.
  18. Added the geodetic projections: a. Lambert conformal conic, and b. the USGS Transantarctic Mountain projection (EPSG:3294 WGS 84).
  19. The reason of long time bug was found out (at last!). When a global DEM was read from a .thcx file, the geodetic projection of the projection of the drawing was ignored, and thus the default (EGSA87) was assumed. The result was that the global DEM could not compute elevations, or worse, it gave erroneous elevations.
    The bug was fixed. The whole mechanism of ThanCad objects had to be revised.
  20. ThanCad can now import polygons and paths (lines) from .kml/.kmz files. The coordinates are autoconverted to EGSA87. If this is not desired, create a new drawing, change the geodetic projection to the desired one, and the insert the .kml/.kmz file.
  21. Mykonos was added to the perimeter of Greece.
  22. Support for the following global DEMs was added:
    a. SRTM 1arc version 3 from USGS (SRTM1USGS).
    b. ASTER ALOS WORLD 3D 30m (AW3D30).
  23. The quick profile command now has the option to change the differential scale of the elevation (y) axis with respect to the station (x) axis. Previously it was always 10. Now the default is 10.0, but the user can change it.

-Version 0.5.0 “Students2020”
  1. The penthickness (in mm) now is taken into account when the drawing is drawn on screen. All elements are affected.
  2. Global OrthoImages are now supported. The gorthoimage (goi) command loads a global orthoimage frame to the point the user clicks (it it exists).
  3. Global Points are now supported. The glp command loads points of a global set of points within a rectangular region.
    The glpexport command, exports the Global Points to a .trg and a .csv file.
  4. If there is only 1 argument in the command line, and this argument is a directory, then this is set as the default directory.
  5. The second point of the command "break" is set to the same coordinates as the first, if user presses enter.
  6. The "continueline" command has now an option to continue the most recently created line (if it still exists).
  7. Support for the following global DEMs was added:
    a. TANDEMX 90 m (TANXDEM90)
    Support for the following global DEMs was added in the previous years:
    a. Intermediate TANDEMX (TANIDEM)
    b. TANDEMX 30 m (TANXDEM30)
    c. TANDEMX 12 m (TANXDEM12)
  8. A bug was corrected in thancom/thanjoin/thanjointgap.py. The code is also now twice as fast.
  9. The chelevcontour command was modified, to report intersections only within the user defined line segment.
  10. New command "highlightzero" was implemented. It highlights temporarily lines and points with elevation zero. This is needed in topography, when contour lines are drawn with zero elevations.
  11. There are now 3 slightly different commands:
    joingap2: Joins lines regardless of the z or higher dimensions. It finds the smallest gap between two lines using 2d distance.
    joingap3: Joins lines taking into account the z (but not higher dimensions). It finds the smallest gap between two lines using 3d distance.
    joingap: Joins contour lines, that is lines with the same z at all points. It finds the smallest gap between two lines using 2d distance (in this case 2d distance and 3d distance is identical). Further more, if one line was different z than the other line, the command refuses to join them.
    For two lines which both have zero (or any constant value) z at all points the three commands are identical.
  12. A bug concerning Greek letters with acute was corrected.

-Version 0.6.6 “Students2021”
  1. A bug in the computation of the length of a circular arc was corrected.
  2. Circle creation with diameter (instead of radius) was implemented.
  3. THAN_STATE_NONE and similar states converted to enum.
  4. Circle creation passing through 3 points was implemented.
  5. When we trim or break a circle, now the resulting arc keeps the spin of the circle. Likewise, when the circle is offset the new circle inherits the spin.
    The same when we extend an arc.
  6. Polar coordinates were implemented. Like: 100<30 -> 100*cos(30),100*sin(30)
  7. Now undo/redo keeps track of the last point clicked or last point given by the keyboard. This is needed for relative coordinates. It is only partially implemented: for lines, and the insertion of any element.
  8. layer is now another command for ddlmodes.
  9. Circle creation passing through 2 antidiamteric was implemented.
  10. The hatch element was implemented. It can be filled with inclined lines or solid color. Export to dxf as lines, or as triangular solids.
  11. fillmode environmental variable was implemented. It specifies whether hatches and fills, 2D solids, and wide polylines are filled in. Default fillmode is to fill (hatches, solids etc).
    Accordingly, the fill command has changed meaning:
    a. Now it sets environmental variable fillmode.
    b. Previously, it set the fill attribute off all layers to ON.
    Please note the fill attribute of layers is whether to fill polygons and circles; it is independent to the fill of hatches and solids.
  12. The orthomode command was implemented.
  13. The ThanDimali has now options for architectural ticks, instead of arrow.
    Now you can continue a ThanDimali dimension.
  14. DDEDIT can now edit the text of dimensions (ThanDimali).
  15. Circle element has new methods for creating it: ttr and ttt.
  16. Now ThanCad reads hatch from dxf.


AUTHORS

Thanasis Stamos
----Residence: Athens, Greece, Europe.
----E-mail:
cyberthanasis@excite.com

PAPERS ABOUT THANCAD (directly or indirectly)

  1. ThanCad was presented in the EuroPython conference held in Vilnius, Lithuania, July 9-11, 2007.
    The presentation is here.
  2. 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:

  1. www.ktim.gr used ThanCad to create private cadastre maps in 2008 (sadly the site is no longer functioning).
  2. 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.
  3. The National Technical University of Athens continues to use ThanCad for educational purposes (1 semester 2011-2012).
  4. 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.
  5. The National Technical University of Athens uses ThanCad for educational purposes (1st semester 2021-2022).
    They use ThanCad for an introductory course in Computer Aided Design. The course takes place in the PC LAB of the university which runs Linux exclusively.


  6. Last Updated: May 9, 2022