[cad-linux-dev] Perl module progress

  • From: Eric Wilhelm <ewilhelm@xxxxxxxxxxxxx>
  • To: cad-linux-dev@xxxxxxxxxxxxx
  • Date: Sat, 11 Oct 2003 23:24:04 -0500

perl -e 'use CAD::Drawing;
$d = CAD::Drawing->new();
$d->addtextlines([0,10], "this is\n   the way\nthe world\n\n\nends...");
$d->save("text.dxf");'

I've now gotten all of the dwg/dxf access completely re-written in Inline::C 
form (from the previous SWIG setup.)

All of that is just backend though.  The postscript save and image save 
functions have yet to be rewritten and then I'm off to the dbload, dbsave 
functions.

A lot has been done to move this away from the autocad style, such as adding a 
textual id per entity (rather than just storing them in a list.)

I've also moved the geometry one level down in the data structure, leaving 
room at the top for things like directory names, layer properties, database 
passwords, etc.

I'll also be working on a circle format (I've got about 4million circles to 
juggle) which will be rather similar to the directory-based format (except 
that all circles on a "layer" would be in one file.  This might be fairly 
short-lived, but will be an interesting experiment.  I've been playing with 
it a little, and it has really simplified a few tasks over the last week to 
be able to store some extra information with each circle (like using their 
i,j locations in a grid as a name/index.)

The current format is like this:
  print OUT join(":", $name, join(",", @pt), $rad, $color, $lt, ), "\n";
or on input:
  chomp($line = <IN>);
  ($id, $coord, $rad, $color, $lt) = split(/:/, $line);
  @coord = split(/,/, $coord);


I'd also like to see how the database tables will resolve into this 
batch-processing style of data handling.

I'm really interested in how many formats can be supported by a fairly 
simplistic (if 3000 lines is simple!) Perl module.  Anyone want to take a 
crack at how this would work with the Directory format?  

I've gotten things broken down into fairly modular components, with a 
CAD::Drawing::IO:: directory to be filled with format-specific load/save 
functions.

I've got a spot registered on CPAN, but can't quite get the Inline-based dwg 
module to build in the typical way.  If anyone knows something about 
packaging Perl XS / Inline modules, I could sure use some help.

Thanks,
Eric

-- 
"Left to themselves, things tend to go from bad to worse."
                                        --Murphy's Corollary


Other related posts: