NAME

CAD::Drawing::Calculate -- Calculations for CAD::Drawing

DESCRIPTION

This module provides calculation functions for the CAD::Drawing family of modules.

AUTHOR

Eric L. Wilhelm
ewilhelm at sbcglobal dot net
http://pages.sbcglobal.net/mycroft

COPYRIGHT

This module is copyright (C) 2003 by Eric L. Wilhelm and A. Zahner Co.

LICENSE

This module is distributed under the same terms as Perl. See the Perl source package for details.

You may use this software under one of the following licenses:

(1) GNU General Public License
  (found at http://www.gnu.org/copyleft/gpl.html)
(2) Artistic License
  (found at http://www.perl.com/pub/language/misc/Artistic.html)

NO WARRANTY

This software is distributed with ABSOLUTELY NO WARRANTY. The author and his employer will in no way be held liable for any loss or damages resulting from its use.

Modifications

The source code of this module is made freely available and distributable under the GPL or Artistic License. Modifications to and use of this software must adhere to one of these licenses. Changes to the code should be noted as such and this notification (as well as the above copyright information) must remain intact on all copies of the code.

Additionally, while the author is actively developing this code, notification of any intended changes or extensions would be most helpful in avoiding repeated work for all parties involved. Please contact the author with any such development plans.

SEE ALSO

CAD::Drawing
CAD::Calc
Math::Vec

Methods

OrthExtents

Calculates the extents of a group of objects (selected according to select_addr()) and returns an array: [xmin,xmax],[ymin,ymax].

@extents = $drw->OrthExtents(\%opts);

getExtentsRec

Alias to OrthExtents() which returns a polyline-form array of points (counter clockwise from lower-left) describing a rectangle.

@rec = $drw->getExtentsRec(\%opts);

EntOrthExtents

Gets the orthographic extents of the object at $addr

@extents = $drw->EntOrthExtents($addr);

@orthfunc

List of hash references containing code references to reduce duplication and facilitate natural flow (rather than ifififif statements.)

offset

Intended as any-object offset function (not easy).

$dist is negative to offset outward

$drw->offset($dist);

divide

$drw->divide();

pline_to_ray

Transforms a polyline with a nubbin into a ray (line with direction.)

$line_addr = $drw->pline_to_ray($pline_addr);

trim_both

Trims two lines to their intersection.

$drw->trim_both($addr1, $addr2);