DXF::Parser - A perl module for parsing DXF files
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' );
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.
Called by the parser to intialize the output class. It should call the super class initialize function.
Called by the parser to open the new output file. It is passed a filename prefix.
Called by the parser to close the output file.
Called by the parser to draw a line consisting of two or more points.
Called by the parser to draw an arc.
Called by the parser to draw a circle.
Called by the parser to draw text.
Called by the parser to draw a polygon of three or more points.
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.
This method is called at the end of a BLOCK section.
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.
see dxftoobj and dxftofig.
based on:
dxftoobj -- convert autocad .dxf files to wavefront's .obj format
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)
dxftoobj, dxftofig
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.
To install DXF::Parser, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DXF::Parser
CPAN shell
perl -MCPAN -e shell install DXF::Parser
For more information on module installation, please visit the detailed CPAN module installation guide.