Beispiel #1
0
 public Snap.Geom.Box3d GetBox3d()
 {
     if (Electrode != null)
     {
         var topFaceDir         = -Electrode.BaseFace.GetFaceDirection();
         var topFaceOrientation = new Snap.Orientation(topFaceDir);
         topFaceOrientation = Electrode.GetSidelongOrientation(topFaceOrientation);
         var quadrantType = EactConfig.ConfigData.GetInstance().QuadrantType;
         var transQ       = Snap.Geom.Transform.CreateRotation(new Snap.Position(), topFaceDir, SnapEx.Helper.CAngle(Electrode.GetQuadrantType(quadrantType), quadrantType));
         return(_body.AcsToWcsBox3d(topFaceOrientation));
     }
     return(_body.AcsToWcsBox3d());
 }
Beispiel #2
0
        /// <summary>
        /// 获取摄像机视角
        /// </summary>
        public static Snap.Orientation GetCameraOrientation(Snap.Orientation ori, Electrode elec = null)
        {
            var wcsOrientation = Electrode.GetStandardOrientation(Snap.Globals.WcsOrientation);
            var acsOrientation = Snap.Orientation.Identity;
            var transR         = Snap.Geom.Transform.CreateRotation(acsOrientation, wcsOrientation);

            var X = new Snap.Vector(ori.AxisX.X, ori.AxisX.Y, ori.AxisX.Z).Copy(transR);
            var Y = new Snap.Vector(ori.AxisY.X, ori.AxisY.Y, ori.AxisY.Z).Copy(transR);

            if (elec != null)
            {
                var baseDirOrientation = Electrode.GetSidelongOrientation(new Snap.Orientation(-elec.BaseFace.GetFaceDirection()));
                var transR1            = Snap.Geom.Transform.CreateRotation(baseDirOrientation, wcsOrientation);
                X = X.Copy(transR1);
                Y = Y.Copy(transR1);
            }

            return(new Snap.Orientation(X, Y));
        }