The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

DXF::Parser - A perl module for parsing DXF files

SYNOPSIS

 package DXF::<format>;

 use DXF::Parser;

 sub
 open { }

 sub
 polyline { }

 sub
 close { }
 
 $p = DXF::<format>->new( verbose => 1,
                        debug => 0,
                        disable_text => 0 );

 $p->parse_from_file( 'sample.dxf' );

DESCRIPTION

This module provides a way to parse DXF files. You are expected to inherit your output class from module and optionally implement the following methods: initialize, open, close, line, arc, circle, text and polygon.

Additionally, you should implement dxf_block and dxf_insert.

METHODS

initialize

Called by the parser to intialize the output class. It should call the super class initialize function.

open

Called by the parser to open the new output file. It is passed a filename prefix.

close

Called by the parser to close the output file.

line

Called by the parser to draw a line consisting of two or more points.

arc

Called by the parser to draw an arc.

circle

Called by the parser to draw a circle.

text

Called by the parser to draw text.

polygon

Called by the parser to draw a polygon of three or more points.

dxf_block

This method (along with dxf_endblk and dxf_insert) implement the BLOCK/INSERT function of DXF. This method is called at the start of a BLOCK section.

dxf_endblk

This method is called at the end of a BLOCK section.

dxf_insert

This method is called when a BLOCK is inserted in the current output file. Typically, the dxf_block method has stored the requested BLOCK somewhere.

EXAMPLES

see dxftoobj and dxftofig.

HISTORY

based on:

dxftoobj -- convert autocad .dxf files to wavefront's .obj format

TODO

Fix dxf_block/dxf_insert. This should be handled entirely in the parser module by keeping the BLOCKs as list of entitites.

Support rotatations (especially in INSERT blocks)

SEE ALSO

dxftoobj, dxftofig

COPYRIGHT

Copyright 2007 Charles Williams <chas@cmf.nrl.navy.mil>

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.