|
NAMECAD::Drawing::Manipulate::Transform - Matrix methods for CAD::DrawingDESCRIPTIONProvides 3D transformation methods (based on traditional matrix algorithms) for Drawing.pm objects.Coordinate SystemAll 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!AUTHOREric L. Wilhelm <ewilhelm at cpan dot org>http://scratchcomputing.com COPYRIGHTThis module is copyright (C) 2004-2006 by Eric L. Wilhelm. Portions copyright (C) 2003 by Eric L. Wilhelm and A. Zahner Co.LICENSEThis 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 WARRANTYThis software is distributed with ABSOLUTELY NO WARRANTY. The author, his former employer, and any other contributors will in no way be held liable for any loss or damages resulting from its use.ModificationsThe 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 ALSOCAD::Drawing CAD::Drawing::Calculate CAD::Calc Math::Vec Math::Matrix MethodsTransform$drw->Transform($addr, \%opts); Options: normal_ready => [@normal_vec] # no-questions-asked normal vector input Non-OO Functionsbuild_matrixBuilds a linear transformation matrix according to %opts;$mat = build_matrix(%opts);
NewMatCalls Math::MatrixReal->new_from_rows([@_]) see Math::MatrixReal for methods which can be applied to the returned object.$mat = NewMat(@rows); transform_ptApplies 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_matricesReturns 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_matrixBuilds a linear transformation tranlation matrix from @trans, where @trans = ($trX, $trY, $trZ).$mat = translation_matrix(@trans); scaling_matrixBuilds a linear tranformation matrix from @scales, where @scales = ($sX, $sY, $sZ).$mat = scaling_matrix(@scales);
Visit the GSP FreeBSD Man Page Interface. |