Git Product home page Git Product logo

cad-drawing-manipulate-transform's Introduction

NAME
    CAD::Drawing::Manipulate::Transform - Matrix methods for CAD::Drawing

DESCRIPTION
    Provides 3D transformation methods (based on traditional matrix
    algorithms) for Drawing.pm objects.

Coordinate System
    All of these methods assume a RIGHT-HANDED coordinate system. If you are
    using a left-handed coordinate system, you are going to have trouble,
    trouble, trouble. We aren't making video games here!

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::Drawing::Calculate
      CAD::Calc
      Math::Vec
      Math::Matrix

Changes
      0.01 First public release

Methods
  Transform

      $drw->Transform($addr, \%opts);

    Options:

      normal_ready => [@normal_vec]  # no-questions-asked normal vector input

  build_matrix

    Builds a linear transformation matrix according to %opts;

      $mat = build_matrix(%opts);

    Options:
      LTM => $ltm                  # pass-through for pre-built matrices
      R   => [$rX, $rY, $rZ]       # rotation about each axis
      T   => [$tX, $tY, $tZ]       # translation along each axis
      S   => [$sX, $sY, $sZ]       # scaling along each axis

    Units:
    Scaling is in decimal (e.g. $sX = 0.9 will scale by 90%)

  NewMat

    Calls Math::MatrixReal->new_from_rows([@_]) see Math::MatrixReal for
    methods which can be applied to the returned object.

      $mat = NewMat(@rows);

  transform_pt

    Applies matrix multiplication to linearly transform @pt by $mat. This
    eliminates the tedium of making new matrices just to multiply one point.

      @pt = transform_pt(\@pt, $mat);

  rotation_matrices

    Returns a list of matrices corresponding to ($rX, $rY, $rZ)

    Rotation is in ccw radians about each axis (right-hand rule) except that
    they may be specified in degrees with $angle . "d"

      @rotations = rotation_matrices($rX, $rY, $rZ);

    Resulting matrix will perform rotations in Z,Y,X order.

  translation_matrix

    Builds a linear transformation tranlation matrix from @trans, where
    @trans = ($trX, $trY, $trZ).

      $mat = translation_matrix(@trans);

  scaling_matrix

    Builds a linear tranformation matrix from @scales, where @scales = ($sX,
    $sY, $sZ).

      $mat = scaling_matrix(@scales);

cad-drawing-manipulate-transform's People

Contributors

ewilhelm avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.