Exemple #1
0
        /// <summary>
        /// Initializes coordinate system using origin point  and transformation matrix.
        /// </summary>
        /// <param name="p">Origin of the coordinate system.</param>
        /// <param name="m">Transformation matrix (in row format).</param>
        /// <param name="name">Name of the coordinate system.</param>
        public Coord3d(Point3d p, Matrix3d m, string name = "")
        {
            if (!m.IsOrthogonal)
            {
                throw new ArgumentException("The matrix is not orthogonal");
            }

            _origin = p.ConvertToGlobal();
            _axes   = m.Copy();
            if ((!string.IsNullOrEmpty(name)))
            {
                _name = name;
            }
            else
            {
                _name = "Coord " + count.ToString();
            }
            count += 1;
        }
Exemple #2
0
 /// <summary>
 /// Initializes rotation using rotation matrix.
 /// </summary>
 /// <param name="m">Rotation matrix.</param>
 /// <param name="coord">Reference coordinate system (default - Coord3d.GlobalCS).</param>
 public Rotation(Matrix3d m, Coord3d coord = null)
 {
     _r     = m.Copy();
     _coord = (coord == null) ? Coord3d.GlobalCS : coord;
 }