From ahaas at airmail.net Sat Aug 2 10:28:17 2003 From: ahaas at airmail.net (Art Haas) Date: Sat Aug 2 10:28:24 2003 Subject: [PythonCAD] Data structure question Message-ID: <20030802142817.GA24108@artsapartment.org> Hi. As inidicated in my last mail, I am looking at ways of storing the enties in a drawing in a better manner. After "Google"ing around I bit I found a number of papers dealing with things like R-trees, R*-trees, and PMR Quadtrees. The little bit I've read suggest that PMR Quadtrees would offer an improved means of storing the drawing objects, as this structure works by dividing up spatial regions and storing references to objects that are found in that region. In this manner it would be very quick to see if a mouse click is on a certain object because the spatial divisions occur when a certain number of objects are found in its boundary, so then that area of space is sub-divided into four smaller areas. I'm mailing the list in hopes that someone can suggest possibly other structures that might also be considered. Please send references to them like links to web pages or PDF files. Also if someone has used the PMR Quadtrees before (I haven't) and has some experience in using them could they comment on what they found. Thanks. Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From ahaas at airmail.net Wed Aug 6 10:03:10 2003 From: ahaas at airmail.net (Art Haas) Date: Wed Aug 6 10:03:23 2003 Subject: [PythonCAD] Data structure question In-Reply-To: <20030802142817.GA24108@artsapartment.org> References: <20030802142817.GA24108@artsapartment.org> Message-ID: <20030806140310.GA13985@artsapartment.org> On Sat, Aug 02, 2003 at 09:28:17AM -0500, Art Haas wrote: > Hi. > > As inidicated in my last mail, I am looking at ways of storing the > enties in a drawing in a better manner. After "Google"ing around I bit I > found a number of papers dealing with things like R-trees, R*-trees, and > PMR Quadtrees. The little bit I've read suggest that PMR Quadtrees would > offer an improved means of storing the drawing objects, as this > structure works by dividing up spatial regions and storing references to > objects that are found in that region. In this manner it would be very > quick to see if a mouse click is on a certain object because the > spatial divisions occur when a certain number of objects are found in > its boundary, so then that area of space is sub-divided into four > smaller areas. > I've looked around for more info on quadtrees, and they seem to be commonly used for storing and retrieving 2-D data. The papers I've found discuss using these structures for applications that process data for mapmaking and similiar large-scale data processing. Quadtrees also seem to pop up in image enhancement applications as well. I haven't been able to find anything Python related to quadtrees though, so that is a bit discouraging. FYI, he Vaults of Parnassus link on the Python home page has links to various Python web pages with lots of example code, modules, and Python tips and techniques, so if you are looking for some hints as to how to perform some task with Python, I'd suggest browsing the link. Don't go there looking for quadtree info, though ... I'd still like to hear from someone on the list who has any experience with quadtrees as I've had no replies to my earlier posting. Thanks in advance. Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From pfrostie at yahoo.com Wed Aug 6 10:18:21 2003 From: pfrostie at yahoo.com (phrostie) Date: Wed Aug 6 12:18:25 2003 Subject: [PythonCAD] Data structure question In-Reply-To: <20030806140310.GA13985@artsapartment.org> Message-ID: <20030806161821.79298.qmail@web11007.mail.yahoo.com> i know nothing about quadtrees, but did want to ask about the direction and use. you commented that "they seem to be commonly used for storing and retrieving 2-D data" are your plans for pythoncad going to stay 2D or are you planning to goto a 3D? > > I've looked around for more info on quadtrees, and they seem to be > commonly used for storing and retrieving 2-D data. The papers I've found > discuss using these structures for applications that process data for > mapmaking and similiar large-scale data processing. Quadtrees also seem > to pop up in image enhancement applications as well. > > I haven't been able to find anything Python related to quadtrees though, > so that is a bit discouraging. FYI, he Vaults of Parnassus link on the > Python home page has links to various Python web pages with lots of > example code, modules, and Python tips and techniques, so if you are > looking for some hints as to how to perform some task with Python, I'd > suggest browsing the link. Don't go there looking for quadtree info, > though ... > > I'd still like to hear from someone on the list who has any experience > with quadtrees as I've had no replies to my earlier posting. Thanks in > advance. > > Art > -- > Man once surrendering his reason, has no remaining guard against absurdities > the most monstrous, and like a ship without rudder, is the sport of every > wind. > > -Thomas Jefferson to James Smith, 1822 > > _______________________________________________ > PythonCAD mailing list > PythonCAD@python.org > http://mail.python.org/mailman/listinfo/pythoncad ===== phrostie Oh I have slipped the surly bonds of DOS and danced the skies on Linux silvered wings. http://pfrostie.freeservers.com/cad-tastrafy/ http://www.freelists.org/webpage/cad-linux __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com From ahaas at airmail.net Thu Aug 14 13:29:30 2003 From: ahaas at airmail.net (Art Haas) Date: Thu Aug 14 13:30:15 2003 Subject: [PythonCAD] Quadtrees and update Message-ID: <20030814172930.GA13936@artsapartment.org> Hi. I've found a little more documentation on quadtrees, so I've started trying to cook up a Python implementation for these beasties. While looking for info on them I've found information on other topics that appear to be useful for PythonCAD so I've started investigating and implementing these things as well. One topic is line clipping in a region, and circle clipping as well. Clipping an entity into a region had been implemented for some objects like construction lines, but not for objects like segments and circles, so the plan is to add clipping methods to these objects and use them when redrawing the screen and for quadtree occupancy testing. I've also been informed that PythonCAD and Python 2.3 don't play nicely together. I'd hoped that there would not be any problem running PythonCAD in the new version but it looks like there is. The problem dealt with object initialization and is almost certainly an error in the PythonCAD code. Has anyone on the list tried running PythonCAD with the latest Python release? Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From inigoserna at terra.es Fri Aug 15 00:53:46 2003 From: inigoserna at terra.es (=?ISO-8859-1?Q?I=F1igo?= Serna) Date: Thu Aug 14 17:52:10 2003 Subject: [PythonCAD] Quadtrees and update In-Reply-To: <20030814172930.GA13936@artsapartment.org> References: <20030814172930.GA13936@artsapartment.org> Message-ID: <1060898025.21057.3.camel@inigo.katxi.org> Hi all, El jue, 14-08-2003 a las 19:29, Art Haas escribi?: > I've also been informed that PythonCAD and Python 2.3 don't play nicely > together. I'd hoped that there would not be any problem running > PythonCAD in the new version but it looks like there is. The problem > dealt with object initialization and is almost certainly an error in the > PythonCAD code. Has anyone on the list tried running PythonCAD with the > latest Python release? PythonCAD-DS1-R9/Generic/text.py, line 529: original: class TextBlock(object, TextFormat): working version: class TextBlock(TextFormat, object): it showed something about MRO resolution with Python v2.3. Best regards, I?igo Serna -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente Url : http://mail.python.org/pipermail/pythoncad/attachments/20030814/d02b74d8/attachment.bin From ahaas at airmail.net Mon Aug 18 13:58:46 2003 From: ahaas at airmail.net (Art Haas) Date: Mon Aug 18 13:58:55 2003 Subject: [PythonCAD] Updates for tenth release Message-ID: <20030818175846.GB21579@artsapartment.org> Hi. I've been working on line clipping stuff over the last week or two, and have implemented some routines in the code that will trim segments and construction lines within a rectangular region of space. These routines are being used for redrawing the screen and for testing if these objects appear within some region of space. I've also got a circle-clipping routine coded up that I found on from searching on Google, and it is a pretty slick way of testing if a circle is visible in a region and what parts of the circle are seen. Routines like these will be needed if quadtrees are used for storing object references because each node in the quadtree stores the objects that are found in its spatial region. I've also started trying to write an Autocad dwg format translator. There are documents about older versions of this file format available on the internet, so the ones I got from http://www.opendwg.org deal with the R13/R14 versions of Autocad. I've also found some stuff on older versions as well. Newer versions of the format are apparently not yet available, at least to those who don't shell out $$$. There won't be a release this month of PythonCAD - there hasn't been enough changes in the code to justify it. It looks like now the next release will be sometime in September, probably in the later half of the month. Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From ahaas at airmail.net Mon Aug 25 09:53:35 2003 From: ahaas at airmail.net (Art Haas) Date: Mon Aug 25 09:54:13 2003 Subject: [PythonCAD] Test message Message-ID: <20030825135335.GA26350@artsapartment.org> Hi. This is just a test to see if mail to the PythonCAD mailing list is working again. The python.org machine was hit pretty hard by the e-mail worm of last week ... Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From ahaas at airmail.net Wed Aug 27 19:26:35 2003 From: ahaas at airmail.net (Art Haas) Date: Wed Aug 27 19:26:45 2003 Subject: [PythonCAD] First hack at DWG reading Message-ID: <20030827232635.GB16779@artsapartment.org> Hi. I've finished up the first shot at reading DWG files. I downloaded the spec from the OpenDWG group and have coded up a beastly little thing that does nothing other than print out what it finds in the DWG file it is reading. The script will only work on R13/R14 version files as those versions are what the spec describes. I've run this thing on the sample files that people have mailed me (thanks!), and the script doesn't bomb out when looking at the data in the file. That's good, but this thing need much more testing as the files I have contain a limited number of entity types. It would be great of some people with lots of R13/R14 files could try and run the script on the files and see if it reads them without an error. So, where is this script you ask? I thought about mailing it with this posting, but it is 20K gzipped and there is no need to clutter up your mailbox with 20K of stuff if you can't test it. If only the wankers who write e-mail worms or generate spam mail would be so kind. If you can test this and would like to do so, write me and I'll mail it to you. The script will run like this ... $ python dwg.py /path/to/the/dwg/file/you/will/test.dwg If it is an R13/R14 file the script will print out _lots_ of stuff as it reads the data in the file. Hopefully there will not be any error messages. Earlier or later versions of the format will generate an 'unknown format' message. The script only reads the files and prints stuff out - it does _not_ modify the DWG file. I expect to have to make several iterations on this script before it reads the files people test it on work decently. The script reads nearly all the entities described in the OpenDWG spec, and nearly completely. There are a number of entities that not all the data is read and processed, and some entitles like 'OLE2FRAME' entities are not read at all. The entities that PythonCAD can deal with - lines, circles, points, etc. - all seem to be read well enough that the ability to import the data from DWG into PythonCAD looks like a very achievable goal. There is still much I don't understand about the DWG file format (and many other things) so documentation, references, and help in deciphering the format will be greatly appreciated. I've also sent some stuff up to the repo - the line clipping stuff I worked on a week or two ago, and I've added a change the the text.py file that should fix the Python-2.3 problem. Let me know if you want to have the dwg.py file and I'll send it along. Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From ahaas at airmail.net Wed Aug 27 19:32:23 2003 From: ahaas at airmail.net (Art Haas) Date: Wed Aug 27 19:32:27 2003 Subject: [PythonCAD] First hack at DWG reading In-Reply-To: <20030827232635.GB16779@artsapartment.org> References: <20030827232635.GB16779@artsapartment.org> Message-ID: <20030827233223.GC16779@artsapartment.org> I should have listed the OpenDWG site in the earlier mail ... http://www.opendwg.org Also the following site was _very_ helpful in providing some C code that reads the DWG files. The code does have some bugs in it, and it doesn't always match what the spec says but it generates output that is sensible and useful to compare the output of the dwg.py script. http://www.geocities.com/kuyunjik Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From ewilhelm at sbcglobal.net Thu Aug 28 17:17:45 2003 From: ewilhelm at sbcglobal.net (Eric Wilhelm) Date: Thu Aug 28 17:17:54 2003 Subject: [PythonCAD] True and False not defined Message-ID: <200308281617.45618.ewilhelm@sbcglobal.net> I'm new to messing with Python, so maybe I'm missing a library or something. trying to use the dwg.py and gtkpycad.py with python2.2 (on redhat 7.3) I get the following: python2.2 gtkpycad.py Traceback (most recent call last): File "gtkpycad.py", line 32, in ? import Interface.Gtk.gtkimage File "Interface/Gtk/gtkimage.py", line 31, in ? import gtkmenus File "Interface/Gtk/gtkmenus.py", line 31, in ? import gtkedit File "Interface/Gtk/gtkedit.py", line 26, in ? import Generic.segment as segment File "Generic/segment.py", line 24, in ? import graphicobject File "Generic/graphicobject.py", line 28, in ? class GraphicObject(object): File "Generic/graphicobject.py", line 55, in GraphicObject color.Color(0xffffff), File "Generic/color.py", line 106, in __init__ tree.TreeItem.__init__(self) File "Generic/tree.py", line 42, in __init__ baseobject.ModObject.__init__(self) File "Generic/baseobject.py", line 41, in __init__ self.__modified = False NameError: global name 'False' is not defined Is there something missing in my Python libraries? Thanks, Eric From lists at soffernet.com Thu Aug 28 17:29:00 2003 From: lists at soffernet.com (Jaime Soffer) Date: Thu Aug 28 17:36:12 2003 Subject: [PythonCAD] True and False not defined In-Reply-To: <200308281617.45618.ewilhelm@sbcglobal.net> References: <200308281617.45618.ewilhelm@sbcglobal.net> Message-ID: <3F4E741C.5000208@soffernet.com> Eric Wilhelm wrote: > I'm new to messing with Python, so maybe I'm missing a library or something. > > trying to use the dwg.py and gtkpycad.py with python2.2 (on redhat 7.3) > I get the following: > > python2.2 gtkpycad.py ... > NameError: global name 'False' is not defined > > Is there something missing in my Python libraries? True and False were added on Python 2.2.1; what is your full version (python -V)? > > Thanks, > Eric From ewilhelm at sbcglobal.net Thu Aug 28 20:49:32 2003 From: ewilhelm at sbcglobal.net (Eric Wilhelm) Date: Thu Aug 28 20:49:26 2003 Subject: [PythonCAD] Re: [cad-linux] First hack at DWG reading for PythonCAD In-Reply-To: <20030828225748.GC25639@artsapartment.org> References: <20030828011949.GB17960@artsapartment.org> <200308281528.39822.ewilhelm@azahner.com> <20030828225748.GC25639@artsapartment.org> Message-ID: <200308281949.32790.ewilhelm@sbcglobal.net> > The following was supposedly scribed by > Art Haas > on Thursday 28 August 2003 05:57 pm: >The code you have is just the first take on reading the DWG files. I'm >sure there are errors in it - the R13/R14 files I have don't have all >the entities that the spec describes, so I'm sure I've goofed up on some >of them. Sorry to freak out everybody's e-mail client as I switch addresses and jump threads between mailing lists. I'm looking at a fairly simple R14 file with the dwg.py and a fresh build of python: $ ~/src/Python-2.2.3/python dwg.py sm14_chck.dwg zombie: 0 itemclassid: 1f2 bitpos after itemclassid: 2278 classnum: 506 version: 0 appname: 'AutoCAD 2000' cplusplusclassname: 'AcDbXrecord' classdxfname: 'XRECORD' zombie: 0 itemclassid: 1f3 bitpos after itemclassid: 2587 Traceback (most recent call last): File "dwg.py", line 4450, in ? dump_info(_fh) File "dwg.py", line 139, in dump_info _cmap = decode_class_data(_class_data) File "dwg.py", line 973, in decode_class_data _bitpos, _classnum = get_bit_short(data, _bitpos) File "dwg.py", line 4169, in get_bit_short _sh = get_bits(data, 16, (offset + 2)) File "dwg.py", line 4408, in get_bits _b2 = (data[_idx] & _mask2) IndexError: array index out of range the file is only 36k. What's the attachment policy on this list? --Eric From ahaas at airmail.net Thu Aug 28 22:36:44 2003 From: ahaas at airmail.net (Art Haas) Date: Fri Aug 29 00:01:52 2003 Subject: [PythonCAD] Re: [cad-linux] First hack at DWG reading for PythonCAD In-Reply-To: <200308281949.32790.ewilhelm@sbcglobal.net> References: <20030828011949.GB17960@artsapartment.org> <200308281528.39822.ewilhelm@azahner.com> <20030828225748.GC25639@artsapartment.org> <200308281949.32790.ewilhelm@sbcglobal.net> Message-ID: <20030829023644.GB27327@artsapartment.org> On Thu, Aug 28, 2003 at 07:49:32PM -0500, Eric Wilhelm wrote: > > The following was supposedly scribed by > > Art Haas > > on Thursday 28 August 2003 05:57 pm: > > Sorry to freak out everybody's e-mail client as I switch addresses and jump > threads between mailing lists. > > I'm looking at a fairly simple R14 file with the dwg.py and a fresh build of > python: > $ ~/src/Python-2.2.3/python dwg.py sm14_chck.dwg > > zombie: 0 > itemclassid: 1f2 > bitpos after itemclassid: 2278 > classnum: 506 > version: 0 > appname: 'AutoCAD 2000' > cplusplusclassname: 'AcDbXrecord' > classdxfname: 'XRECORD' > zombie: 0 > itemclassid: 1f3 > bitpos after itemclassid: 2587 > Traceback (most recent call last): > File "dwg.py", line 4450, in ? > dump_info(_fh) > File "dwg.py", line 139, in dump_info > _cmap = decode_class_data(_class_data) > File "dwg.py", line 973, in decode_class_data > _bitpos, _classnum = get_bit_short(data, _bitpos) > File "dwg.py", line 4169, in get_bit_short > _sh = get_bits(data, 16, (offset + 2)) > File "dwg.py", line 4408, in get_bits > _b2 = (data[_idx] & _mask2) > IndexError: array index out of range > > the file is only 36k. What's the attachment policy on this list? > I think I sent it up so that anything over 40K gets stopped. If you can mail me the file directly that would be great. Don't send something that is proprietary/secret/confidential etc. I'd like to get the file so I can fix the bug and keep it as a test file for future iterations of the reading code. Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From ahaas at airmail.net Thu Aug 28 23:15:24 2003 From: ahaas at airmail.net (Art Haas) Date: Fri Aug 29 00:01:52 2003 Subject: [PythonCAD] Test message #2 Message-ID: <20030829031524.GE27327@artsapartment.org> Does this make it through? Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From ewilhelm at sbcglobal.net Fri Aug 29 00:35:45 2003 From: ewilhelm at sbcglobal.net (Eric Wilhelm) Date: Fri Aug 29 00:35:35 2003 Subject: [PythonCAD] Test message #2 In-Reply-To: <20030829031524.GE27327@artsapartment.org> References: <20030829031524.GE27327@artsapartment.org> Message-ID: <200308282335.45273.ewilhelm@sbcglobal.net> > The following was supposedly scribed by > Art Haas > on Thursday 28 August 2003 10:15 pm: >Does this make it through? > >Art yes From ahaas at airmail.net Fri Aug 29 13:05:31 2003 From: ahaas at airmail.net (Art Haas) Date: Fri Aug 29 13:06:17 2003 Subject: [PythonCAD] Updated DWG reading program Message-ID: <20030829170531.GC24776@artsapartment.org> Hi. I've fixed the fix found bug in the 'dwg.py' file - decoding the class data info did not handing padding bits correctly. I've also changed the way handles are stored in the file. Now they are tuples of integers. Let me know if you want this file to test on your R13/R14 drawings. Feedback is appreciated. Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From ewilhelm at sbcglobal.net Fri Aug 29 13:17:07 2003 From: ewilhelm at sbcglobal.net (Eric Wilhelm) Date: Fri Aug 29 13:16:56 2003 Subject: [PythonCAD] Updated DWG reading program In-Reply-To: <20030829170531.GC24776@artsapartment.org> References: <20030829170531.GC24776@artsapartment.org> Message-ID: <200308291217.07652.ewilhelm@sbcglobal.net> > The following was supposedly scribed by > Art Haas > on Friday 29 August 2003 12:05 pm: >Hi. > >I've fixed the fix found bug in the 'dwg.py' file - decoding the class >data info did not handing padding bits correctly. I've also changed the >way handles are stored in the file. Now they are tuples of integers. That works on my little test file, but crashes with this on the huge one: name: DIMASSOC reading from bit offset 170 bit short type: 0x1 name: SORTENTS reading from bit offset 244 bit short type: 0x1 name: XCLIPFRAME parent handle: (4, 1, 12) reactor handle 0: (4, 1, 12) xdicobjhandle: (3, 0) item handle 0: (2, 3, '\x03', '\xb5', '\xbf') item handle 1: (2, 2, '\x02', '\xfd') item handle 2: (2, 3, '\x04', '9', '\xed') reading object 33 reading at 3063830 [2ec016] size: 21 object data after size at 3063832 reading from bit offset 0 bit short type: 0x0 type: 502 bitpos: 18 handle: (0, 2, '\x02', '\xfd') bitpos: 42 reading from bit offset 42 bit short type: 0x2 extended data size: 0 object data size in bits: 128 bitpos: 76 type: 502 => DICTIONARYVAR dictionaryvar_reader() ... numreactors: 1 intval: 0x0 reading from bit offset 94 bit short type: 0x1 string: 0x3 parent handle: (3, 1, 50) Traceback (most recent call last): File "dwg.py", line 4360, in ? dump_info(_fh) File "dwg.py", line 148, in dump_info _objects = read_objects(handle, _objmap, _cmap) File "dwg.py", line 3888, in read_objects _vobjmap[_stype](_data, _bitpos) File "dwg.py", line 3143, in dictionaryvar_reader _bitpos, _handle = get_handle(data, _bitpos) File "dwg.py", line 4181, in get_handle _handle = get_bits(data, _hlen, (offset + 8)) File "dwg.py", line 4318, in get_bits _b2 = (data[_idx] & _mask2) IndexError: array index out of range I'm afraid that I can't give you this file, but if I can find a way to cause this with another file, I'll get you one of those. Any clues to what kind of object this is? XCLIPFRAME? --Eric From ahaas at airmail.net Fri Aug 29 13:32:25 2003 From: ahaas at airmail.net (Art Haas) Date: Fri Aug 29 13:35:56 2003 Subject: [PythonCAD] Updated DWG reading program In-Reply-To: <200308291217.07652.ewilhelm@sbcglobal.net> References: <20030829170531.GC24776@artsapartment.org> <200308291217.07652.ewilhelm@sbcglobal.net> Message-ID: <20030829173225.GE24776@artsapartment.org> On Fri, Aug 29, 2003 at 12:17:07PM -0500, Eric Wilhelm wrote: > > The following was supposedly scribed by > >Hi. > > > >I've fixed the fix found bug in the 'dwg.py' file - decoding the class This should read "I've fixed the first found bug ..." > >data info did not handing padding bits correctly. I've also changed the > >way handles are stored in the file. Now they are tuples of integers. > > That works on my little test file, but crashes with this on the huge one: > > name: DIMASSOC > reading from bit offset 170 > bit short type: 0x1 > name: SORTENTS > reading from bit offset 244 > bit short type: 0x1 > name: XCLIPFRAME > parent handle: (4, 1, 12) > reactor handle 0: (4, 1, 12) > xdicobjhandle: (3, 0) > item handle 0: (2, 3, '\x03', '\xb5', '\xbf') > item handle 1: (2, 2, '\x02', '\xfd') > item handle 2: (2, 3, '\x04', '9', '\xed') > reading object 33 > reading at 3063830 [2ec016] > size: 21 > object data after size at 3063832 > reading from bit offset 0 > bit short type: 0x0 > type: 502 > bitpos: 18 > handle: (0, 2, '\x02', '\xfd') > bitpos: 42 > reading from bit offset 42 > bit short type: 0x2 > extended data size: 0 > object data size in bits: 128 > bitpos: 76 > type: 502 => DICTIONARYVAR > dictionaryvar_reader() ... > numreactors: 1 > intval: 0x0 > reading from bit offset 94 > bit short type: 0x1 > string: 0x3 > parent handle: (3, 1, 50) > Traceback (most recent call last): > File "dwg.py", line 4360, in ? > dump_info(_fh) > File "dwg.py", line 148, in dump_info > _objects = read_objects(handle, _objmap, _cmap) > File "dwg.py", line 3888, in read_objects > _vobjmap[_stype](_data, _bitpos) > File "dwg.py", line 3143, in dictionaryvar_reader > _bitpos, _handle = get_handle(data, _bitpos) > File "dwg.py", line 4181, in get_handle > _handle = get_bits(data, _hlen, (offset + 8)) > File "dwg.py", line 4318, in get_bits > _b2 = (data[_idx] & _mask2) > IndexError: array index out of range > > I'm afraid that I can't give you this file, but if I can find a way to cause > this with another file, I'll get you one of those. > This is objectype 502 - a DICTIONARYVAR object. The type is printed out in the midst of the many things that get printed. It looks like the program is bombing out where it is reading the number of reactors, which in this case is 1. I'll take a look. Thanks. Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From guy_j_edwards at HotPOP.com Fri Aug 29 21:56:43 2003 From: guy_j_edwards at HotPOP.com (Guy Edwards) Date: Fri Aug 29 17:09:33 2003 Subject: [PythonCAD] Re: [cad-linux] Updated DWG reading program In-Reply-To: <20030829170531.GC24776@artsapartment.org> References: <20030829170531.GC24776@artsapartment.org> Message-ID: <1062190526.2543.21.camel@linstation> On Fri, 2003-08-29 at 18:05, Art Haas wrote: > I've fixed the fix found bug in the 'dwg.py' file - decoding the class > data info did not handing padding bits correctly. I've also changed the > way handles are stored in the file. Now they are tuples of integers. > > Let me know if you want this file to test on your R13/R14 drawings. > Feedback is appreciated. Is there any chance of putting the file somewhere public for download? I can't email you as my email provider isn't my ISP and your account software blocks it (or something along those lines). Also, is this likely to become a DWG read+write library? Please say yes :-) Guy -- Guy Edwards From ahaas at airmail.net Fri Aug 29 17:25:41 2003 From: ahaas at airmail.net (Art Haas) Date: Fri Aug 29 17:25:50 2003 Subject: [PythonCAD] Re: [cad-linux] Updated DWG reading program In-Reply-To: <1062190526.2543.21.camel@linstation> References: <20030829170531.GC24776@artsapartment.org> <1062190526.2543.21.camel@linstation> Message-ID: <20030829212541.GB12451@artsapartment.org> On Fri, Aug 29, 2003 at 09:55:26PM +0100, Guy Edwards wrote: > On Fri, 2003-08-29 at 18:05, Art Haas wrote: > > Is there any chance of putting the file somewhere public for download? I > can't email you as my email provider isn't my ISP and your account > software blocks it (or something along those lines). > The file is checked into the PythonCAD subversion repo. I wanted to put it under revision control. I can be pulled from there. > Also, is this likely to become a DWG read+write library? Please say yes > :-) At some point in time I'd like to be able to write DWG files, but for now it is enough of a challenge to just read them. -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From ahaas at airmail.net Fri Aug 29 19:50:20 2003 From: ahaas at airmail.net (Art Haas) Date: Fri Aug 29 19:50:25 2003 Subject: [PythonCAD] DWG reader update Message-ID: <20030829235020.GD13530@artsapartment.org> Hi. A short note to thank the people who sent me DWG files, and to let people know that these files have been incredibly useful in flushing out bugs. Numerous bugs have been fixed today thanks to these test files. Please keep testing and sending files that fail - if you can. Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From ahaas at airmail.net Sat Aug 30 18:19:48 2003 From: ahaas at airmail.net (Art Haas) Date: Sat Aug 30 18:19:55 2003 Subject: [PythonCAD] DWG Reader for R12 file format Message-ID: <20030830221948.GA26940@artsapartment.org> Hi. I've just finished a reader for the R12 file format. It operates the same way as the R13/R14 file reader. I have one R12 DWG file and it reads this file without generating an error. I'd like this to get tested in the same way as the R13/R14 reader. Please mail me if you can test this out. The file format info was found by searcing on the Internet, not the OpenDWG people. Searching on Google lead to info from Frans Faase and Reini Urban and some work they had done in decoding the format. The decoding doesn't appear to be as complete as the OpenDWG people produced, but it looks like there is enough to get the info out of the file. I'd welcome links to more indepth info if it is available. Again, let me know if you can try this out. Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From pfrostie at yahoo.com Sat Aug 30 19:34:50 2003 From: pfrostie at yahoo.com (phrostie) Date: Sat Aug 30 18:34:31 2003 Subject: [PythonCAD] lil OT, python questions Message-ID: <106228241301@ispsnet.net> i have some projects/ideas(Inventor/Coin) that i've been playing with for quite some time but never got very far with them. since joining this list i've been thinking that python might be a better approach. in the current copy of linuxjournal they talk about using pygtk and glade. looking thru the debian package lists i did not find pygtk, but did find python-gtk. are these the same? -- Oh i've slipped the surly bonds of DOS and danced the skies on Linux silvered wings. http://pfrostie.freeservers.com/cad-tastrafy/ http://www.freelists.org/webpage/cad-linux From ahaas at airmail.net Sat Aug 30 18:43:39 2003 From: ahaas at airmail.net (Art Haas) Date: Sat Aug 30 18:43:45 2003 Subject: [PythonCAD] lil OT, python questions In-Reply-To: <106228241301@ispsnet.net> References: <106228241301@ispsnet.net> Message-ID: <20030830224339.GB26940@artsapartment.org> On Sat, Aug 30, 2003 at 06:34:50PM -0400, phrostie wrote: > i have some projects/ideas(Inventor/Coin) that i've been playing with for > quite some time but never got very far with them. since joining this list > i've been thinking that python might be a better approach. > > in the current copy of linuxjournal they talk about using pygtk and glade. > looking thru the debian package lists i did not find pygtk, but did find > python-gtk. are these the same? > That is the older release. You'll want 'python-gtk2'. For more info ... $ apt-cache show python-gtk2 Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From pfrostie at yahoo.com Sat Aug 30 19:52:51 2003 From: pfrostie at yahoo.com (phrostie) Date: Sat Aug 30 18:52:38 2003 Subject: [PythonCAD] lil OT, python questions In-Reply-To: <20030830224339.GB26940@artsapartment.org> References: <106228241301@ispsnet.net> <20030830224339.GB26940@artsapartment.org> Message-ID: <106228477701@ispsnet.net> > > That is the older release. You'll want 'python-gtk2'. > > For more info ... > > $ apt-cache show python-gtk2 > > Art thanks got'em now. so pygtk and python-gtk are the samething? -- Oh i've slipped the surly bonds of DOS and danced the skies on Linux silvered wings. http://pfrostie.freeservers.com/cad-tastrafy/ http://www.freelists.org/webpage/cad-linux From ahaas at airmail.net Sat Aug 30 22:03:30 2003 From: ahaas at airmail.net (Art Haas) Date: Sat Aug 30 22:03:53 2003 Subject: [PythonCAD] lil OT, python questions In-Reply-To: <106228477701@ispsnet.net> References: <106228241301@ispsnet.net> <20030830224339.GB26940@artsapartment.org> <106228477701@ispsnet.net> Message-ID: <20030831020330.GB28018@artsapartment.org> On Sat, Aug 30, 2003 at 06:52:51PM -0400, phrostie wrote: > > > > That is the older release. You'll want 'python-gtk2'. > > > > For more info ... > > > > $ apt-cache show python-gtk2 > > > > Art > > thanks got'em now. > so pygtk and python-gtk are the samething? > Well, mostly. PyGTK is the name of the modules from James Henstridge, and python-gtk is the Debian package. As indicated in my message and your response, you want the Debian 'python-gtk2' package to get the current, GTK-2.X based code. I'm running the PyGTK code from the gnome CVS repo, btw. Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From guy_j_edwards at HotPOP.com Fri Aug 29 23:07:56 2003 From: guy_j_edwards at HotPOP.com (Guy Edwards) Date: Sun Aug 31 10:36:51 2003 Subject: [PythonCAD] Re: [cad-linux] Updated DWG reading program In-Reply-To: <20030829211559.GA12451@artsapartment.org> References: <20030829170531.GC24776@artsapartment.org> <1062190526.2543.21.camel@linstation> <20030829211559.GA12451@artsapartment.org> Message-ID: <1062194684.2543.47.camel@linstation> Sorry I can't email directly as your software blocks me. (see previous email) On Fri, 2003-08-29 at 22:15, Art Haas wrote: [snip] > > Also, is this likely to become a DWG read+write library? Please say yes > > :-) > > At some point in time I'd like to be able to write DWG files, but for > now the challenge is just reading them. A free DWG lib would be worth its weight in gold x1000. If you want any xhtml/css, testing or doc work done to help a lib effort, please let me know as I'd be happy to help. > I was sent a good test file which exposed numerous bugs in the code, and > a 'pychecker dwg.py' run flushed out even more. Send me mail if you want > the latest work-in-progress version to test. Yes, I'd be happy to test it. Also if it helps: Test files: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/lx-viewer/testing/ The small.dwg file is quite complex, it was submitted by a user. There are approx 14,000 DWG files public at: ftp.autodesk.com/PointA/GeneralSymbolsCatalog But beware... there are also ~14,000 DWF files, and with that many files even a directory listing is 2mb so it takes a while. also, copied and pasted from the lx-viewer website: ------------------------ Test Files Free files to download from the internet. If you know of any more, let us know * DWG mapping information files - from 15k fields to 3mb+ maps (links to ftp site) http://www.labins.org/dwg.htm * some architectural small drawings http://www.vngrd.com/downloads.html * power supply dwg's http://www.acopian.com/autocad.html * technical specs http://www.farrar.co.uk/usa/resources/downloads.htm http://www.eldoradostone.com/technical/body_techcreative.html * door specs http://www.cecodoor.com/dwglib.htm ----------------------- Guy http://lx-viewer.sourceforge.net -- Guy Edwards From guy_j_edwards at HotPOP.com Sat Aug 30 22:55:36 2003 From: guy_j_edwards at HotPOP.com (Guy Edwards) Date: Sun Aug 31 10:36:52 2003 Subject: [PythonCAD] Re: DWG reading file In-Reply-To: <20030830203709.GA4536@artsapartment.org> References: <20030829222031.GC12451@artsapartment.org> <1062267891.2531.31.camel@linstation> <20030830203709.GA4536@artsapartment.org> Message-ID: <1062280495.2531.100.camel@linstation> On Sat, 2003-08-30 at 21:37, Art Haas wrote: [snip] > Please don't send any > confidential/proprietary/secret etc. drawings. Everything I've got is public and should be 100% fine. > If you put them on a web site that would be great. I can grab them with > lynx/mozilla and use them to figure out where the problem is. There you go: http://lx-viewer.sourceforge.net/dwg/dwg.php It's got files, logs, and a brief explanation of the lib. Let me know when you've fixed a file and I'll replace it. I've downloaded all 14,000 or so DWG files Autodesk has public in their FTP site. (I'm testing batch conversion in our own app). I'll convert them to R14 and then test a few at a time. I'll put a maximum of 10 on the website at once, unless you want more or have more people working on it etc. There's no real space limit on our website so it's cool. > P.S. Attached is the latest version of the script - it fixes a number of > problems. Do the drawings that fail when run with the older script stil > fail? I'm afraid it still gives errors. 3 questions: 1) Is there any way to directly link to your script at your site so people can download it to test it from that same page? 2) Can you just stick a copyright header in that script to say what license you're putting it under? 3) is std out any good to you or is it just std error you're after? I've put both on the site for now. Guy -- Guy Edwards From ewilhelm at sbcglobal.net Sun Aug 31 12:01:00 2003 From: ewilhelm at sbcglobal.net (Eric Wilhelm) Date: Sun Aug 31 12:04:02 2003 Subject: [PythonCAD] Updated DWG reading program In-Reply-To: <20030830204540.GC4536@artsapartment.org> References: <20030829234204.GB13530@artsapartment.org> <200308292013.06234.ewilhelm@sbcglobal.net> <20030830204540.GC4536@artsapartment.org> Message-ID: <200308311101.00433.ewilhelm@sbcglobal.net> > The following was supposedly scribed by > Art Haas > on Saturday 30 August 2003 03:45 pm: >Thanks for testing. Fixed. New code attached. I've found several other large drawings that I can freely lend to you (just don't build anything with them and say that I said it would work :) Attached is the shell script that I'm using to test them batch-wise and the console output from running it. The drawings which fail are: $du -hc *.dwg.gz 168k elec-r14.dwg.gz 3.2M env_studies-r14.dwg.gz 8.0k FileR14.dwg.gz 8.1M __Final_drawingF-DXB-r14.dwg.gz 452k hvac-r14.dwg.gz 8.0k polylines-r14.dwg.gz 2.4M Site--2D-r14.dwg.gz 15M total I'll copy the list with this script so that anyone else doing testing can quickly identify suspect drawings. note: they are identified by being the only .dwg.gz files in the directory so you have to clean-out between tests or spend some time writing in bash :( Let me know how to get you these dwg files. I'd be happy to ftp them to your site or whatever, but I don't have enough web space anywhere to post them (until I get on with this linux-router dmz setup.) --Eric -- "It is impossible to make anything foolproof because fools are so ingenious." --Murphy's Second Corollary -------------- next part -------------- A non-text attachment was scrubbed... Name: sh_tester.gz Type: application/x-gzip Size: 187 bytes Desc: not available Url : http://mail.python.org/pipermail/pythoncad/attachments/20030831/bd76bba7/sh_tester-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: tester_output.txt.gz Type: application/x-gzip Size: 708 bytes Desc: not available Url : http://mail.python.org/pipermail/pythoncad/attachments/20030831/bd76bba7/tester_output.txt-0001.bin From ewilhelm at sbcglobal.net Sun Aug 31 19:03:45 2003 From: ewilhelm at sbcglobal.net (Eric Wilhelm) Date: Sun Aug 31 19:03:31 2003 Subject: [PythonCAD] Re: DWG reading file In-Reply-To: <1062280495.2531.100.camel@linstation> References: <20030830203709.GA4536@artsapartment.org> <1062280495.2531.100.camel@linstation> Message-ID: <200308311803.45140.ewilhelm@sbcglobal.net> > The following was supposedly scribed by > Guy Edwards > on Saturday 30 August 2003 04:54 pm: >I've >downloaded all 14,000 or so DWG files Autodesk has public in their FTP >site. (I'm testing batch conversion in our own app). I'll convert them >to R14 and then test a few at a time. You might like this script then. This is a HUGE improvement on the little bash script that I posted earlier and will test all dwg files in a directory, keeping a record of STDERR and catching the last part of STDOUT (everything after the last "_reader()" ) in a logfile per drawing. If a new version of dwg.py is being run, it reports on which files were successful in this run versus the last. It also gzips the files to another directory, but you can disable that (and I've built it so that you have to at least open the code and change a few values or it won't run, so please edit the code as shown in the comments.) You will need to set your path to python and dwg.py, as well as making a few directories and setting a few flags. There is support for a "skip_these.txt" list of files to skip. If the only thing on a line in that file matches a dwg filename, it will be skipped. --Eric -- The opinions expressed in this e-mail were randomly generated by the computer and do not necessarily reflect the views of its owner. --Management -------------- next part -------------- A non-text attachment was scrubbed... Name: tester.pl.gz Type: application/x-gzip Size: 1342 bytes Desc: not available Url : http://mail.python.org/pipermail/pythoncad/attachments/20030831/178678ba/tester.pl.bin From ewilhelm at sbcglobal.net Sun Aug 31 19:16:26 2003 From: ewilhelm at sbcglobal.net (Eric Wilhelm) Date: Sun Aug 31 19:16:11 2003 Subject: [PythonCAD] Re: DWG reading file In-Reply-To: <200308311803.45140.ewilhelm@sbcglobal.net> References: <1062280495.2531.100.camel@linstation> <200308311803.45140.ewilhelm@sbcglobal.net> Message-ID: <200308311816.26682.ewilhelm@sbcglobal.net> > The following was supposedly scribed by > Eric Wilhelm > on Sunday 31 August 2003 06:03 pm: >If a new version of dwg.py is being run, it reports on which files were >successful in this run versus the last. This minor improvement now reports on which files had different errors in this run versus the last (i.e. it made it a little further through the file but still hung.) $perl tester.pl array-r14.dwg ok elec-r14.dwg no change failed wrt: elec-r14.dwg env_studies-r14.dwg different error failed wrt: env_studies-r14.dwg file14.dwg ok FileR14.dwg no change failed wrt: FileR14.dwg hvac-r14.dwg different error failed wrt: hvac-r14.dwg polylines-r14.dwg no change failed wrt: polylines-r14.dwg Site--2D-r14.dwg different error failed wrt: Site--2D-r14.dwg --Eric -- "These crispix get soggy so quickly." -- Tina Connolly -------------- next part -------------- A non-text attachment was scrubbed... Name: tester.pl.gz Type: application/x-gzip Size: 1429 bytes Desc: not available Url : http://mail.python.org/pipermail/pythoncad/attachments/20030831/4c34a06c/tester.pl.bin