History of !ClipDraw

I am a philatelist. Some people may recall the !Stampbase program I wrote which as well as acting as a database for stamp collections giving printouts of stamps either yet to be collected or in a collection, produced stamp album pages for the mounting of a collection. I cut down this program to produce !MailBase for my postal history collection of Olomouc in the Czech Republic.

!Mailbase produces the sheets on which to mount my covers, postcards etc and I gave it the option of producing a greyed out background of the skyline of Olomouc to make my sheets look more attractive. Since Olomouc is at the centre of an impressive railway network in Moravia constructed during the Austo-Hungarian Empire period and since a lot of the routes had travelling post offices (TPOs) with their own special cancellations I thought it would be a good idea to put a map of the route taken by a particular TPO for each cover in my collection.

So I drew what turned out to be quite a large map of the railway network around Olomouc by tracing in !Draw from scanned railway maps. It was quite tedious when it came to incorporating just the right part of the map on to each sheet, involving blanking out with filled white objects those parts of the map which were redundant for that TPO. How much easier I thought if I could just cut out the part I required as a drawfile and place that on my sheet.

I searched through all the utilities I had and the numerous CDRoms but couldn't find anything which even attempted what I wanted. Having a little knowledge (always dangerous) of drawfile construction I decided I would write my own utility program.

!ClipDraw is the result. The only real difficulty I had was with Bezier curves, I found equations to use on the Internet so that I could find the start and endpoints of a clipped curve, but the equation for the new curve is completely different to the old and although I found a compromise which drew a curve from the start to the right end point the curve imbetween didn't exactly match the original. However the mismatch was not a disaster and I had a usable utility.

I then looked at other possible !Draw objects and did my best to incorporate them as well, having I hope a good success with sprite objects. The writing only took a few evenings, so when I met Colin Sutton (Archive PD commentator among other claims to fame) I was pleased to find out that he didn't know of any similar utilies and why didn't I post to Archive-on-line my difficulties wuth Bezier curves.

Three weeks after my posting John Harrison contacted me, wrote that he had gone to the pub to consider my problem and had written down a few equations that might help. I immediately typed the equations into my program and that was the end of the Bezier problem. I don't know John, which pub he drinks in, or most importantly what beer they serve but it is obviously potent stuff. Thanks John. The upgraded program is now version 1.01.

The program as it stands does not cope with filled objects, rotated sprites and probably several other things as well. However it fulfills my original purpose in writing it and justifies the time taken for that. I am passing it on through Archive and hope that it proves useful to others.

Please let me have your comments, if there is enough interest I could attempt to improve the program.

Version 1.02 25.6.03
After receiving most helpful comments from Rosemary Miskin, several cosmetic changes have been made to fit in with style guides, but more importantly 2 new features have been added.
1. Rosemary's biggest wish was for a direct save from !Draw and dragging to the icon bar. This is now implemented.
2. There is now an extra option on the iconbar menu to group the output file rather than it containing lots of separate objects. This was such a good idea that the output files are now grouped by default unless you untick the menu. Thanks Rosemary.

Version 1.03 28.6.03
After more comments about the peculiar effects of leaving curved lines with fill information an option has been added to the iconbar menu to dispense with fill information altogether. The default is that it is included unless unticked on the menu.

Version 1.04 31.6.03
Couple of bug fixes, first affecting move in a path, 2 perfectly good lines of code 1 cancelling the other! Second more serious involving grouped text objects. Seemed to be OK in clipfile which could be imported into another file with text objects. This file would save but gave errors on trying to reload. Altered the position of the group command and now seems OK.

Version 1.045 4.7.03
Rosemary sent me a file with a path parameter of 5 in it, so now I understand what it does, so an extra line of code and now it is treated correctly.

Version 1.05 7.7.03
Colin Sutton sent me some 'problem' files. How steep does a line have to get before it is vertical. I decided 1000:1 in the end which stops Colin's file generating a Number too large error. If other problem files arrive I may have to have a relook at the equations I use for intersecting lines. His next file ran into one of my error traps, now if a straight line starts exactly on the edge of the bounding box but then moves away it is ignored.

Version 1.06 26.7.03
John Norris sent me an email concerning an error he had come across, probably because he was using an early version. However he suggested it would be more practical to preserve objects especially filled objects if they were enclosed by the red box. I agreed with this so now there is another option on the menu "Include fill" which includes all the information (not just fill) on any object whose bounding box falls within the red box.

Version 1.07 13.12.04
Changed the options to change the options by  adding a choices window and removing the options from the iconbar menu. Also made it possible to save these choices. Added routines that clip text objects.

Derek Baron

Derek.Baron@tesco.net
