コード例 #1
0
        public void SetLCS(AttachedMember attachedMember, LineSegment3D lineSegment)
        {
            //Defining LCS for First lineSegment
            double xcor = attachedMember.ElementRAZ.line.vector.X;
            double ycor = attachedMember.ElementRAZ.line.vector.Y;
            double zcor = attachedMember.ElementRAZ.line.vector.Z;



            //Define LCS (local-y in XY plane) and unitize
            VectorRAZ vx = new VectorRAZ(xcor, ycor, zcor).Unitize();
            VectorRAZ vy = new VectorRAZ();
            VectorRAZ vz = new VectorRAZ();

            if (xcor == 0.0 && ycor == 0.0)
            {
                vy = new VectorRAZ(0.0, 1.0, 0.0).Unitize();
                vz = new VectorRAZ((-zcor), 0.0, (xcor)).Unitize();
            }
            else
            {
                vy = new VectorRAZ(-ycor, xcor, 0.0).Unitize();
                vz = new VectorRAZ((-zcor * xcor), (-zcor * ycor), ((xcor * xcor) + (ycor * ycor))).Unitize();
            }

            if (attachedMember.ElementRAZ.rotationLCS == 0.0)
            {
            }
            else
            {
                vy = VectorRAZ.RotateVector(vx, attachedMember.ElementRAZ.rotationLCS, vy);
                vz = VectorRAZ.RotateVector(vx, attachedMember.ElementRAZ.rotationLCS, vz);
            }

            var LocalCoordinateSystem = new CoordSystemByVector();

            LocalCoordinateSystem.VecX = new Vector3D()
            {
                X = vx.X, Y = vx.Y, Z = vx.Z
            };
            LocalCoordinateSystem.VecY = new Vector3D()
            {
                X = vy.X, Y = vy.Y, Z = vy.Z
            };
            LocalCoordinateSystem.VecZ = new Vector3D()
            {
                X = vz.X, Y = vz.Y, Z = vz.Z
            };

            lineSegment.LocalCoordinateSystem = LocalCoordinateSystem;
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: MelakuSeyoum/KarambaIDEA
        static void Main()
        {
            VectorRAZ a = new VectorRAZ(1, 2, 3);
            VectorRAZ b = new VectorRAZ(0, 0, 1);

            double angle = 90.0;

            double    scalar = VectorRAZ.DotProduct(a, b);
            VectorRAZ vector = VectorRAZ.CrossProduct(a, b);
            VectorRAZ xx     = VectorRAZ.RotateVector(b, angle, a);

            System.Windows.Media.Media3D.Vector3D va = new System.Windows.Media.Media3D.Vector3D(a.X, a.Y, a.Z);
            System.Windows.Media.Media3D.Vector3D vb = new System.Windows.Media.Media3D.Vector3D(b.X, b.Y, b.Z);

            double dot = System.Windows.Media.Media3D.Vector3D.DotProduct(va, vb);

            System.Windows.Media.Media3D.Vector3D cross = System.Windows.Media.Media3D.Vector3D.CrossProduct(va, vb);

            System.Windows.Media.Media3D.AxisAngleRotation3D vec = new System.Windows.Media.Media3D.AxisAngleRotation3D();



            //System.Windows.Media.Media3D.Rotation3D rot = new System.Windows.Media.Media3D.Rotation3D();


            KarambaIDEA.MainWindow   mainWindow = new MainWindow();
            Tester.GenerateTestJoint fj         = new GenerateTestJoint();
            //KarambaIDEA.TestFrameworkJoint fj = new TestFrameworkJoint();

            //hieronder testjoint definieren
            Joint joint = fj.Testjoint();

            //Joint joint = fj.Testjoint5();
            joint.project.CreateFolder(@"C:\Data\");
            joint.project.templatePath = @"C:\Data\template.contemp";
            //min lasafmeting uitzetten bij Grasshopper
            joint.project.minthroat = 1.0;

            mainWindow.Test(joint);
        }