コード例 #1
0
ファイル: Kinematic.cs プロジェクト: carlhuth/GenXSource
        public static void CreateSpiralSurface()
        {
            msgScene scene = msgScene.GetScene();

            scene.Clear();

            msgArcStruct   ArcGeo = new msgArcStruct();
            msgPointStruct ArP1   = new msgPointStruct(-1.0, -3.0, 0.0);
            msgPointStruct ArP2   = new msgPointStruct(-1.0, -2.0, 0.0);
            msgPointStruct ArP3   = new msgPointStruct(0.0, -3.5, 0.0);

            ArcGeo.FromThreePoints(ArP1, ArP2, ArP3, false);
            msg2DObject ar = msgArc.Create(ArcGeo);

            scene.AttachObject(ar);
            ar.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
            ar.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

            msgPointStruct axeP1 = new msgPointStruct(2.0, -3.0, 0.0);
            msgPointStruct axeP2 = new msgPointStruct(2.0, 3.0, 0.0);

            msg3DObject spirO = (msg3DObject)msgKinematic.Spiral(ar, null, axeP1, axeP2, 4, 10, 15, false);

            scene.AttachObject(spirO);
            spirO.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 85);

            msgVectorStruct transV1 = new msgVectorStruct(0, -11.5, 0);

            spirO.InitTempMatrix().Translate(transV1);
            spirO.ApplyTempMatrix();
            spirO.DestroyTempMatrix();
        }
コード例 #2
0
        public static void CreateFromClips()
        {
            msgScene scene = msgScene.GetScene();

            scene.Clear();

            msgPointStruct tmpPnt = new msgPointStruct();

            msgSplineStruct spl1 = msgSplineStruct.Create();

            tmpPnt.x = 98.0; tmpPnt.y = 0.0; tmpPnt.z = -13.0;
            spl1.AddKnot(tmpPnt, 0);
            tmpPnt.x = 85.0; tmpPnt.y = 0.0; tmpPnt.z = 19.0;
            spl1.AddKnot(tmpPnt, 1);
            tmpPnt.x = 43.0; tmpPnt.y = 0.0; tmpPnt.z = -31.0;
            spl1.AddKnot(tmpPnt, 2);
            tmpPnt.x = 5.0; tmpPnt.y = 0.0; tmpPnt.z = -3.0;
            spl1.AddKnot(tmpPnt, 3);
            tmpPnt.x = -11.0; tmpPnt.y = 0.0; tmpPnt.z = -39.0;
            spl1.AddKnot(tmpPnt, 4);
            tmpPnt.x = -48.0; tmpPnt.y = 0.0; tmpPnt.z = 23.0;
            spl1.AddKnot(tmpPnt, 5);
            tmpPnt.x = -125.0; tmpPnt.y = 0.0; tmpPnt.z = 23.0;
            spl1.AddKnot(tmpPnt, 6);

            msgSpline spl1_obj = msgSpline.Create(spl1);

            msgSplineStruct.Delete(spl1);
            scene.AttachObject(spl1_obj);
            spl1_obj.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
            spl1_obj.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

            msgSplineStruct spl2 = msgSplineStruct.Create();

            tmpPnt.x = 96.0; tmpPnt.y = 150.0; tmpPnt.z = 8.0;
            spl2.AddKnot(tmpPnt, 0);
            tmpPnt.x = 66.0; tmpPnt.y = 150.0; tmpPnt.z = -20.0;
            spl2.AddKnot(tmpPnt, 1);
            tmpPnt.x = 12.0; tmpPnt.y = 150.0; tmpPnt.z = 37.0;
            spl2.AddKnot(tmpPnt, 2);
            tmpPnt.x = -128.0; tmpPnt.y = 150.0; tmpPnt.z = -23.0;
            spl2.AddKnot(tmpPnt, 3);

            msgSpline spl2_obj = msgSpline.Create(spl2);

            msgSplineStruct.Delete(spl2);
            scene.AttachObject(spl2_obj);
            spl2_obj.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
            spl2_obj.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

            msgLine ln_obj = msgLine.Create(100.0, 100.0, 50.0, -121.0, 100.0, -50.0);

            scene.AttachObject(ln_obj);
            ln_obj.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
            ln_obj.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

            msgArcStruct   arcG   = new msgArcStruct();
            msgPointStruct arcBeg = new msgPointStruct(98.0, 50.0, -80.0);
            msgPointStruct arcEnd = new msgPointStruct(-117.0, 50.0, -80.0);
            msgPointStruct arcMid = new msgPointStruct(-55.0, 50.0, -50.0);

            arcG.FromThreePoints(arcBeg, arcEnd, arcMid, false);
            msgArc arc_obj = msgArc.Create(arcG);

            scene.AttachObject(arc_obj);
            arc_obj.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
            arc_obj.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

            msg2DObject[] objcts = new msg2DObject[4];
            objcts[0] = spl1_obj;
            objcts[1] = arc_obj;
            objcts[2] = ln_obj;
            objcts[3] = spl2_obj;

            double[] param = new double[4];
            param[0] = param[1] = param[2] = param[3] = 0.0;

            msgObject surf = msgSurfaces.SplineSurfaceFromSections(objcts, param, false);

            scene.AttachObject(surf);
            surf.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 24);

            msgVectorStruct transV1 = new msgVectorStruct(0, 0, -5);

            surf.InitTempMatrix().Translate(transV1);
            surf.ApplyTempMatrix();
            surf.DestroyTempMatrix();
        }
コード例 #3
0
        public static void CreateCoonsFrom3Curves()
        {
            msgScene scene = msgScene.GetScene();

            scene.Clear();

            msgPointStruct tmpPnt = new msgPointStruct();

            msgSplineStruct spl1 = msgSplineStruct.Create();

            tmpPnt.x = -6.0; tmpPnt.y = 0.0; tmpPnt.z = -1.0;
            spl1.AddKnot(tmpPnt, 0);
            tmpPnt.x = -5.0; tmpPnt.y = 0.0; tmpPnt.z = -2.0;
            spl1.AddKnot(tmpPnt, 1);
            tmpPnt.x = -3.0; tmpPnt.y = 0.0; tmpPnt.z = -1.0;
            spl1.AddKnot(tmpPnt, 2);
            tmpPnt.x = -2.0; tmpPnt.y = 0.0; tmpPnt.z = -2.0;
            spl1.AddKnot(tmpPnt, 3);
            tmpPnt.x = -1.0; tmpPnt.y = 0.0; tmpPnt.z = 1.0;
            spl1.AddKnot(tmpPnt, 4);
            tmpPnt.x = 2.0; tmpPnt.y = 0.0; tmpPnt.z = 1.0;
            spl1.AddKnot(tmpPnt, 5);
            tmpPnt.x = 2.0; tmpPnt.y = 0.0; tmpPnt.z = 0.0;
            spl1.AddKnot(tmpPnt, 6);
            tmpPnt.x = 4.0; tmpPnt.y = 0.0; tmpPnt.z = 1.0;
            spl1.AddKnot(tmpPnt, 7);

            msgSpline spl1_obj = msgSpline.Create(spl1);

            msgSplineStruct.Delete(spl1);
            scene.AttachObject(spl1_obj);
            spl1_obj.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 0);
            spl1_obj.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 1);

            msgSplineStruct spl2 = msgSplineStruct.Create();

            tmpPnt.x = -6.0; tmpPnt.y = 0.0; tmpPnt.z = -1.0;
            spl2.AddKnot(tmpPnt, 0);
            tmpPnt.x = -6.0; tmpPnt.y = 0.5; tmpPnt.z = 0.0;
            spl2.AddKnot(tmpPnt, 1);
            tmpPnt.x = -6.0; tmpPnt.y = 2.0; tmpPnt.z = -1.0;
            spl2.AddKnot(tmpPnt, 2);
            tmpPnt.x = -6.0; tmpPnt.y = 3.0; tmpPnt.z = 1.0;
            spl2.AddKnot(tmpPnt, 3);
            tmpPnt.x = -4.0; tmpPnt.y = 4.0; tmpPnt.z = 1.0;
            spl2.AddKnot(tmpPnt, 4);

            msgSpline spl2_obj = msgSpline.Create(spl2);

            msgSplineStruct.Delete(spl2);
            scene.AttachObject(spl2_obj);
            spl2_obj.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 50);
            spl2_obj.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 3);

            msgPointStruct ArP1   = new msgPointStruct();
            msgPointStruct ArP2   = new msgPointStruct();
            msgPointStruct ArP3   = new msgPointStruct();
            msgArcStruct   ArcGeo = new msgArcStruct();

            ArP1.x = -4.0; ArP1.y = 4.0; ArP1.z = 1.0;
            ArP2.x = 4.0; ArP2.y = 0.0; ArP2.z = 1.0;
            ArP3.x = 0.0; ArP3.y = 5.0; ArP3.z = -4.0;
            ArcGeo.FromThreePoints(ArP1, ArP2, ArP3, false);
            msgArc arcObj = msgArc.Create(ArcGeo);

            scene.AttachObject(arcObj);
            arcObj.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 20);
            arcObj.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 3);

            msg3DObject coons = (msg3DObject)msgSurfaces.Coons(spl1_obj, spl2_obj, arcObj, null, 36, 36, 4, 4);

            scene.AttachObject(coons);
            coons.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 4);

            msgVectorStruct transV1 = new msgVectorStruct(0, 0, -0.4);

            coons.InitTempMatrix().Translate(transV1);
            coons.ApplyTempMatrix();
            coons.DestroyTempMatrix();
        }
コード例 #4
0
ファイル: Surface.cs プロジェクト: The-E/GeometrosTest
        public static void CreateCoonsFrom3Curves()
        {
            msgScene scene = msgScene.GetScene();
            scene.Clear();

            msgPointStruct tmpPnt = new msgPointStruct();

            msgSplineStruct spl1 = msgSplineStruct.Create();

            tmpPnt.x = -6.0; tmpPnt.y = 0.0; tmpPnt.z = -1.0;
            spl1.AddKnot(tmpPnt,0);
            tmpPnt.x = -5.0; tmpPnt.y = 0.0; tmpPnt.z = -2.0;
            spl1.AddKnot(tmpPnt,1);
            tmpPnt.x = -3.0; tmpPnt.y = 0.0; tmpPnt.z = -1.0;
            spl1.AddKnot(tmpPnt,2);
            tmpPnt.x = -2.0; tmpPnt.y = 0.0; tmpPnt.z = -2.0;
            spl1.AddKnot(tmpPnt,3);
            tmpPnt.x = -1.0; tmpPnt.y = 0.0; tmpPnt.z = 1.0;
            spl1.AddKnot(tmpPnt,4);
            tmpPnt.x =2.0; tmpPnt.y = 0.0; tmpPnt.z = 1.0;
            spl1.AddKnot(tmpPnt,5);
            tmpPnt.x =2.0; tmpPnt.y = 0.0; tmpPnt.z = 0.0;
            spl1.AddKnot(tmpPnt,6);
            tmpPnt.x =4.0; tmpPnt.y = 0.0; tmpPnt.z = 1.0;
            spl1.AddKnot(tmpPnt,7);

            msgSpline spl1_obj = msgSpline.Create(spl1);
            msgSplineStruct.Delete(spl1);
            scene.AttachObject(spl1_obj);
            spl1_obj.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 0);
            spl1_obj.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 1);

            msgSplineStruct spl2 = msgSplineStruct.Create();

            tmpPnt.x = -6.0; tmpPnt.y = 0.0; tmpPnt.z = -1.0;
            spl2.AddKnot(tmpPnt,0);
            tmpPnt.x = -6.0; tmpPnt.y = 0.5; tmpPnt.z = 0.0;
            spl2.AddKnot(tmpPnt,1);
            tmpPnt.x = -6.0; tmpPnt.y = 2.0; tmpPnt.z = -1.0;
            spl2.AddKnot(tmpPnt,2);
            tmpPnt.x = -6.0; tmpPnt.y = 3.0; tmpPnt.z = 1.0;
            spl2.AddKnot(tmpPnt,3);
            tmpPnt.x =-4.0; tmpPnt.y = 4.0; tmpPnt.z = 1.0;
            spl2.AddKnot(tmpPnt,4);

            msgSpline spl2_obj = msgSpline.Create(spl2);
            msgSplineStruct.Delete(spl2);
            scene.AttachObject(spl2_obj);
            spl2_obj.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 50);
            spl2_obj.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 3);

            msgPointStruct ArP1 = new msgPointStruct();
            msgPointStruct ArP2 = new msgPointStruct();
            msgPointStruct ArP3 = new msgPointStruct();
            msgArcStruct ArcGeo = new msgArcStruct();
            ArP1.x = -4.0; ArP1.y = 4.0; ArP1.z = 1.0;
            ArP2.x = 4.0; ArP2.y = 0.0; ArP2.z = 1.0;
            ArP3.x = 0.0; ArP3.y = 5.0; ArP3.z = -4.0;
            ArcGeo.FromThreePoints(ArP1,ArP2,ArP3,false);
            msgArc arcObj = msgArc.Create(ArcGeo);

            scene.AttachObject(arcObj);
            arcObj.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 20);
            arcObj.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 3);

            msg3DObject coons = (msg3DObject)msgSurfaces.Coons(spl1_obj, spl2_obj, arcObj, null, 36, 36, 4, 4);

            scene.AttachObject(coons);
            coons.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 4);

            msgVectorStruct transV1 = new msgVectorStruct(0,0,-0.4);
            coons.InitTempMatrix().Translate(transV1);
            coons.ApplyTempMatrix();
            coons.DestroyTempMatrix();
        }
コード例 #5
0
ファイル: Surface.cs プロジェクト: The-E/GeometrosTest
        public static void CreateFromClips()
        {
            msgScene scene = msgScene.GetScene();
            scene.Clear();

            msgPointStruct tmpPnt = new msgPointStruct();

            msgSplineStruct spl1 = msgSplineStruct.Create();

            tmpPnt.x = 98.0; tmpPnt.y = 0.0; tmpPnt.z = -13.0;
            spl1.AddKnot(tmpPnt,0);
            tmpPnt.x = 85.0; tmpPnt.y = 0.0; tmpPnt.z = 19.0;
            spl1.AddKnot(tmpPnt,1);
            tmpPnt.x = 43.0; tmpPnt.y = 0.0; tmpPnt.z = -31.0;
            spl1.AddKnot(tmpPnt,2);
            tmpPnt.x = 5.0; tmpPnt.y = 0.0; tmpPnt.z = -3.0;
            spl1.AddKnot(tmpPnt,3);
            tmpPnt.x = -11.0; tmpPnt.y = 0.0; tmpPnt.z = -39.0;
            spl1.AddKnot(tmpPnt,4);
            tmpPnt.x =-48.0; tmpPnt.y = 0.0; tmpPnt.z = 23.0;
            spl1.AddKnot(tmpPnt,5);
            tmpPnt.x =-125.0; tmpPnt.y = 0.0; tmpPnt.z = 23.0;
            spl1.AddKnot(tmpPnt,6);

            msgSpline spl1_obj = msgSpline.Create(spl1);
            msgSplineStruct.Delete(spl1);
            scene.AttachObject(spl1_obj);
            spl1_obj.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
            spl1_obj.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

            msgSplineStruct spl2 = msgSplineStruct.Create();

            tmpPnt.x = 96.0; tmpPnt.y = 150.0; tmpPnt.z = 8.0;
            spl2.AddKnot(tmpPnt,0);
            tmpPnt.x = 66.0; tmpPnt.y = 150.0; tmpPnt.z = -20.0;
            spl2.AddKnot(tmpPnt,1);
            tmpPnt.x = 12.0; tmpPnt.y = 150.0; tmpPnt.z = 37.0;
            spl2.AddKnot(tmpPnt,2);
            tmpPnt.x = -128.0; tmpPnt.y = 150.0; tmpPnt.z = -23.0;
            spl2.AddKnot(tmpPnt,3);

            msgSpline spl2_obj = msgSpline.Create(spl2);
            msgSplineStruct.Delete(spl2);
            scene.AttachObject(spl2_obj);
            spl2_obj.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
            spl2_obj.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

            msgLine ln_obj = msgLine.Create(100.0,100.0,50.0, -121.0,100.0,-50.0);
            scene.AttachObject(ln_obj);
            ln_obj.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
            ln_obj.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

            msgArcStruct arcG = new msgArcStruct();
            msgPointStruct arcBeg = new msgPointStruct(98.0, 50.0 , -80.0);
            msgPointStruct arcEnd = new msgPointStruct(-117.0, 50.0 , -80.0);
            msgPointStruct arcMid = new msgPointStruct(-55.0, 50.0 , -50.0);
            arcG.FromThreePoints(arcBeg,arcEnd,arcMid,false);
            msgArc arc_obj = msgArc.Create(arcG);
            scene.AttachObject(arc_obj);
            arc_obj.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
            arc_obj.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

            msg2DObject[] objcts = new msg2DObject[4];
            objcts[0] = spl1_obj;
            objcts[1] = arc_obj;
            objcts[2] = ln_obj;
            objcts[3] = spl2_obj;

            double[] param = new double[4];
            param[0] = param[1] = param[2] = param[3] = 0.0;

            msgObject surf = msgSurfaces.SplineSurfaceFromSections(objcts, param, false);

            scene.AttachObject(surf);
            surf.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 24);

            msgVectorStruct transV1 = new msgVectorStruct(0,0,-5);
            surf.InitTempMatrix().Translate(transV1);
            surf.ApplyTempMatrix();
            surf.DestroyTempMatrix();
        }
コード例 #6
0
ファイル: Kinematic.cs プロジェクト: xuchuansheng/GenXSource
		public static void CreatePipeBody()
		{
			msgScene scene = msgScene.GetScene();
			scene.Clear();

			msgObject[] objcts = new msgObject[5];

			msgPointStruct ArP1 = new msgPointStruct();
			msgPointStruct ArP2 = new msgPointStruct();
			msgPointStruct ArP3 = new msgPointStruct();
			msgArcStruct ArcGeo = new msgArcStruct();

			ArP1.x = 0.0; ArP1.y = -2.0; ArP1.z = 0.0;
			ArP2.x = 1.0; ArP2.y = -1.0; ArP2.z = 0.0;
			ArP3.x = 0.4; ArP3.y = -1.2; ArP3.z = 0.0;
			ArcGeo.FromThreePoints(ArP1,ArP2,ArP3,false);
			objcts[0] = msgArc.Create(ArcGeo);

			ArP1.x = 1.0; ArP1.y = -1.0; ArP1.z = 0.0;
			ArP2.x = 2.0; ArP2.y = 0.0; ArP2.z = 0.0;
			ArP3.x = 1.9; ArP3.y = -0.5; ArP3.z = 0.0;
			ArcGeo.FromThreePoints(ArP1,ArP2,ArP3,false);
			objcts[1] = msgArc.Create(ArcGeo);

			ArP1.x = 2.0; ArP1.y = 0.0; ArP1.z = 0.0;
			ArP2.x = 1.0; ArP2.y = 1.0; ArP2.z = 0.0;
			ArP3.x = 1.6; ArP3.y = 0.8; ArP3.z = 0.0;
			ArcGeo.FromThreePoints(ArP1,ArP2,ArP3,false);
			objcts[2] = msgArc.Create(ArcGeo);

			objcts[3] = msgLine.Create(1.0, 1.0, 0.0, -1.0, 1.0, 0.0);

			ArP1.x = -1.0; ArP1.y = 1.0; ArP1.z = 0.0;
			ArP2.x = -1.0; ArP2.y = 0.0; ArP2.z = 1.0;
			ArP3.x = -1.1; ArP3.y = 1.0; ArP3.z = 0.0;
			ArcGeo.FromThreePoints(ArP1,ArP2,ArP3,false);
			objcts[4] = msgArc.Create(ArcGeo);

			msgContour cnt1 = msgContour.CreateContour(objcts);
			scene.AttachObject(cnt1);
			cnt1.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
			cnt1.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

			ArP1.x = -0.2; ArP1.y = -0.2; ArP1.z = 0.0;
			ArP2.x = -0.1; ArP2.y = 0.2; ArP2.z = 0.0;
			ArP3.x = -0.3; ArP3.y = 0.1; ArP3.z = 0.0;
			ArcGeo.FromThreePoints(ArP1,ArP2,ArP3,false);
			objcts[0] = msgArc.Create(ArcGeo);


			ArP1.x = -0.1; ArP1.y = 0.2; ArP1.z = 0.0;
			ArP2.x = 0.3; ArP2.y = 0.5; ArP2.z = 0.0;
			ArP3.x = 0.2; ArP3.y = 0.6; ArP3.z = 0.0;
			ArcGeo.FromThreePoints(ArP1,ArP2,ArP3,false);
			objcts[1] = msgArc.Create(ArcGeo);

			ArP1.x = 0.3; ArP1.y = 0.5; ArP1.z = 0.0;
			ArP2.x = -0.2; ArP2.y = -0.2; ArP2.z = 0.0;
			ArP3.x = 0.6; ArP3.y = -0.4; ArP3.z = 0.0;
			ArcGeo.FromThreePoints(ArP1,ArP2,ArP3,false);
			objcts[2] = msgArc.Create(ArcGeo);

			msgObject[] objcts2 = null;
			Array.Copy(objcts, objcts2, 3);
			msgContour cnt2 = msgContour.CreateContour(objcts2);
			scene.AttachObject(cnt2);
			cnt2.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
			cnt2.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

			msgCircleStruct cirGeo = new msgCircleStruct();
			msgPointStruct cirC = new msgPointStruct(0.3, -0.1, 0.0);
			msgVectorStruct cirNor = new msgVectorStruct(0.0, 0.0, 1.0);
			cirGeo.FromCenterRadiusNormal(cirC,0.31, cirNor);
			msg2DObject cir = msgCircle.Create(cirGeo);
			scene.AttachObject(cir);
			cir.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
			cir.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

			msgPointStruct point_in_plane = new msgPointStruct(0.0,0.0,0.0);

			bool  close = true;
			msg3DObject pipO = (msg3DObject)msgKinematic.Pipe(cnt2, new msg2DObject[] { cir }, cnt1, point_in_plane, 0.0, ref close);

			scene.AttachObject(pipO);
			pipO.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 25);

			msgVectorStruct transV1 = new msgVectorStruct(3.0, 1.0, 0);
			pipO.InitTempMatrix().Translate(transV1);
			pipO.ApplyTempMatrix();
			pipO.DestroyTempMatrix();
		}
コード例 #7
0
ファイル: Kinematic.cs プロジェクト: xuchuansheng/GenXSource
		public static void CreatePipeSurface()
		{
			msgScene scene = msgScene.GetScene();
			scene.Clear();

			msgArcStruct ArcGeo = new msgArcStruct();
			msgPointStruct ArP1 = new msgPointStruct(1.0, -4.0, 0.0);
			msgPointStruct ArP2 = new msgPointStruct(1.0, -3.6, 0.0);
			msgPointStruct ArP3 = new msgPointStruct(1.2, -3.5, 0.0);
			ArcGeo.FromThreePoints(ArP1,ArP2,ArP3,false);
			msg2DObject ar = msgArc.Create(ArcGeo);
			scene.AttachObject(ar);
			ar.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
			ar.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

			msgObject[] objcts = new msgObject[6];

			objcts[0] = msgLine.Create(0.0, -4.0, 0.0, 0.0, -2.0, 0.0);

			ArP1.x = 0.0; ArP1.y = -2.0; ArP1.z = 0.0;
			ArP2.x = 1.0; ArP2.y = -1.0; ArP2.z = 0.0;
			ArP3.x = 0.4; ArP3.y = -1.2; ArP3.z = 0.0;
			ArcGeo.FromThreePoints(ArP1,ArP2,ArP3,false);
			objcts[1] = msgArc.Create(ArcGeo);

			ArP1.x = 1.0; ArP1.y = -1.0; ArP1.z = 0.0;
			ArP2.x = 2.0; ArP2.y = 0.0; ArP2.z = 0.0;
			ArP3.x = 1.9; ArP3.y = -0.5; ArP3.z = 0.0;
			ArcGeo.FromThreePoints(ArP1,ArP2,ArP3,false);
			objcts[2] = msgArc.Create(ArcGeo);

			ArP1.x = 2.0; ArP1.y = 0.0; ArP1.z = 0.0;
			ArP2.x = 1.0; ArP2.y = 1.0; ArP2.z = 0.0;
			ArP3.x = 1.6; ArP3.y = 0.8; ArP3.z = 0.0;
			ArcGeo.FromThreePoints(ArP1,ArP2,ArP3,false);
			objcts[3] = msgArc.Create(ArcGeo);

			objcts[4] = msgLine.Create(1.0, 1.0, 0.0, -1.0, 1.0, 0.0);

			ArP1.x = -1.0; ArP1.y = 1.0; ArP1.z = 0.0;
			ArP2.x = -1.0; ArP2.y = 0.0; ArP2.z = 1.0;
			ArP3.x = -1.1; ArP3.y = 1.0; ArP3.z = 0.0;
			ArcGeo.FromThreePoints(ArP1,ArP2,ArP3,false);
			objcts[5] = msgArc.Create(ArcGeo);

			msgContour cnt1 = msgContour.CreateContour(objcts);
			scene.AttachObject(cnt1);
			cnt1.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
			cnt1.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

			msgPointStruct point_in_plane = new msgPointStruct(1.0, -4.0, 0.0);

			bool close = false;
			msg3DObject pipO = (msg3DObject)msgKinematic.Pipe(ar,null, cnt1, point_in_plane, 0.0, ref close);

			scene.AttachObject(pipO);
			pipO.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 25);

			msgVectorStruct transV1 = new msgVectorStruct(2.5, 1, 0);
			pipO.InitTempMatrix().Translate(transV1);
			pipO.ApplyTempMatrix();
			pipO.DestroyTempMatrix();
		}
コード例 #8
0
ファイル: Kinematic.cs プロジェクト: xuchuansheng/GenXSource
		public static void CreateSpiralSurface()
		{
			msgScene scene = msgScene.GetScene();
			scene.Clear();

			msgArcStruct ArcGeo = new msgArcStruct();
			msgPointStruct ArP1 = new msgPointStruct(-1.0, -3.0, 0.0);
			msgPointStruct ArP2 = new msgPointStruct(-1.0, -2.0, 0.0);
			msgPointStruct ArP3 = new msgPointStruct(0.0, -3.5, 0.0);
			ArcGeo.FromThreePoints(ArP1,ArP2,ArP3,false);
			msg2DObject ar = msgArc.Create(ArcGeo);
			scene.AttachObject(ar);
			ar.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
			ar.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

			msgPointStruct axeP1 = new msgPointStruct(2.0, -3.0, 0.0);
			msgPointStruct axeP2 = new msgPointStruct(2.0, 3.0, 0.0);

			msg3DObject spirO = (msg3DObject)msgKinematic.Spiral(ar, null, axeP1, axeP2, 4, 10, 15,false);

			scene.AttachObject(spirO);
			spirO.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 85);

			msgVectorStruct transV1 = new msgVectorStruct(0, -11.5, 0);
			spirO.InitTempMatrix().Translate(transV1);
			spirO.ApplyTempMatrix();
			spirO.DestroyTempMatrix();
		}
コード例 #9
0
ファイル: Kinematic.cs プロジェクト: carlhuth/GenXSource
        public static void CreatePipeBody()
        {
            msgScene scene = msgScene.GetScene();

            scene.Clear();

            msgObject[] objcts = new msgObject[5];

            msgPointStruct ArP1   = new msgPointStruct();
            msgPointStruct ArP2   = new msgPointStruct();
            msgPointStruct ArP3   = new msgPointStruct();
            msgArcStruct   ArcGeo = new msgArcStruct();

            ArP1.x = 0.0; ArP1.y = -2.0; ArP1.z = 0.0;
            ArP2.x = 1.0; ArP2.y = -1.0; ArP2.z = 0.0;
            ArP3.x = 0.4; ArP3.y = -1.2; ArP3.z = 0.0;
            ArcGeo.FromThreePoints(ArP1, ArP2, ArP3, false);
            objcts[0] = msgArc.Create(ArcGeo);

            ArP1.x = 1.0; ArP1.y = -1.0; ArP1.z = 0.0;
            ArP2.x = 2.0; ArP2.y = 0.0; ArP2.z = 0.0;
            ArP3.x = 1.9; ArP3.y = -0.5; ArP3.z = 0.0;
            ArcGeo.FromThreePoints(ArP1, ArP2, ArP3, false);
            objcts[1] = msgArc.Create(ArcGeo);

            ArP1.x = 2.0; ArP1.y = 0.0; ArP1.z = 0.0;
            ArP2.x = 1.0; ArP2.y = 1.0; ArP2.z = 0.0;
            ArP3.x = 1.6; ArP3.y = 0.8; ArP3.z = 0.0;
            ArcGeo.FromThreePoints(ArP1, ArP2, ArP3, false);
            objcts[2] = msgArc.Create(ArcGeo);

            objcts[3] = msgLine.Create(1.0, 1.0, 0.0, -1.0, 1.0, 0.0);

            ArP1.x = -1.0; ArP1.y = 1.0; ArP1.z = 0.0;
            ArP2.x = -1.0; ArP2.y = 0.0; ArP2.z = 1.0;
            ArP3.x = -1.1; ArP3.y = 1.0; ArP3.z = 0.0;
            ArcGeo.FromThreePoints(ArP1, ArP2, ArP3, false);
            objcts[4] = msgArc.Create(ArcGeo);

            msgContour cnt1 = msgContour.CreateContour(objcts);

            scene.AttachObject(cnt1);
            cnt1.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
            cnt1.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

            ArP1.x = -0.2; ArP1.y = -0.2; ArP1.z = 0.0;
            ArP2.x = -0.1; ArP2.y = 0.2; ArP2.z = 0.0;
            ArP3.x = -0.3; ArP3.y = 0.1; ArP3.z = 0.0;
            ArcGeo.FromThreePoints(ArP1, ArP2, ArP3, false);
            objcts[0] = msgArc.Create(ArcGeo);


            ArP1.x = -0.1; ArP1.y = 0.2; ArP1.z = 0.0;
            ArP2.x = 0.3; ArP2.y = 0.5; ArP2.z = 0.0;
            ArP3.x = 0.2; ArP3.y = 0.6; ArP3.z = 0.0;
            ArcGeo.FromThreePoints(ArP1, ArP2, ArP3, false);
            objcts[1] = msgArc.Create(ArcGeo);

            ArP1.x = 0.3; ArP1.y = 0.5; ArP1.z = 0.0;
            ArP2.x = -0.2; ArP2.y = -0.2; ArP2.z = 0.0;
            ArP3.x = 0.6; ArP3.y = -0.4; ArP3.z = 0.0;
            ArcGeo.FromThreePoints(ArP1, ArP2, ArP3, false);
            objcts[2] = msgArc.Create(ArcGeo);

            msgObject[] objcts2 = null;
            Array.Copy(objcts, objcts2, 3);
            msgContour cnt2 = msgContour.CreateContour(objcts2);

            scene.AttachObject(cnt2);
            cnt2.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
            cnt2.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

            msgCircleStruct cirGeo = new msgCircleStruct();
            msgPointStruct  cirC   = new msgPointStruct(0.3, -0.1, 0.0);
            msgVectorStruct cirNor = new msgVectorStruct(0.0, 0.0, 1.0);

            cirGeo.FromCenterRadiusNormal(cirC, 0.31, cirNor);
            msg2DObject cir = msgCircle.Create(cirGeo);

            scene.AttachObject(cir);
            cir.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
            cir.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

            msgPointStruct point_in_plane = new msgPointStruct(0.0, 0.0, 0.0);

            bool        close = true;
            msg3DObject pipO  = (msg3DObject)msgKinematic.Pipe(cnt2, new msg2DObject[] { cir }, cnt1, point_in_plane, 0.0, ref close);

            scene.AttachObject(pipO);
            pipO.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 25);

            msgVectorStruct transV1 = new msgVectorStruct(3.0, 1.0, 0);

            pipO.InitTempMatrix().Translate(transV1);
            pipO.ApplyTempMatrix();
            pipO.DestroyTempMatrix();
        }
コード例 #10
0
ファイル: Kinematic.cs プロジェクト: carlhuth/GenXSource
        public static void CreatePipeSurface()
        {
            msgScene scene = msgScene.GetScene();

            scene.Clear();

            msgArcStruct   ArcGeo = new msgArcStruct();
            msgPointStruct ArP1   = new msgPointStruct(1.0, -4.0, 0.0);
            msgPointStruct ArP2   = new msgPointStruct(1.0, -3.6, 0.0);
            msgPointStruct ArP3   = new msgPointStruct(1.2, -3.5, 0.0);

            ArcGeo.FromThreePoints(ArP1, ArP2, ArP3, false);
            msg2DObject ar = msgArc.Create(ArcGeo);

            scene.AttachObject(ar);
            ar.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
            ar.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

            msgObject[] objcts = new msgObject[6];

            objcts[0] = msgLine.Create(0.0, -4.0, 0.0, 0.0, -2.0, 0.0);

            ArP1.x = 0.0; ArP1.y = -2.0; ArP1.z = 0.0;
            ArP2.x = 1.0; ArP2.y = -1.0; ArP2.z = 0.0;
            ArP3.x = 0.4; ArP3.y = -1.2; ArP3.z = 0.0;
            ArcGeo.FromThreePoints(ArP1, ArP2, ArP3, false);
            objcts[1] = msgArc.Create(ArcGeo);

            ArP1.x = 1.0; ArP1.y = -1.0; ArP1.z = 0.0;
            ArP2.x = 2.0; ArP2.y = 0.0; ArP2.z = 0.0;
            ArP3.x = 1.9; ArP3.y = -0.5; ArP3.z = 0.0;
            ArcGeo.FromThreePoints(ArP1, ArP2, ArP3, false);
            objcts[2] = msgArc.Create(ArcGeo);

            ArP1.x = 2.0; ArP1.y = 0.0; ArP1.z = 0.0;
            ArP2.x = 1.0; ArP2.y = 1.0; ArP2.z = 0.0;
            ArP3.x = 1.6; ArP3.y = 0.8; ArP3.z = 0.0;
            ArcGeo.FromThreePoints(ArP1, ArP2, ArP3, false);
            objcts[3] = msgArc.Create(ArcGeo);

            objcts[4] = msgLine.Create(1.0, 1.0, 0.0, -1.0, 1.0, 0.0);

            ArP1.x = -1.0; ArP1.y = 1.0; ArP1.z = 0.0;
            ArP2.x = -1.0; ArP2.y = 0.0; ArP2.z = 1.0;
            ArP3.x = -1.1; ArP3.y = 1.0; ArP3.z = 0.0;
            ArcGeo.FromThreePoints(ArP1, ArP2, ArP3, false);
            objcts[5] = msgArc.Create(ArcGeo);

            msgContour cnt1 = msgContour.CreateContour(objcts);

            scene.AttachObject(cnt1);
            cnt1.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 12);
            cnt1.SetAttribute(msgObjectAttrEnum.SG_OA_LINE_THICKNESS, 2);

            msgPointStruct point_in_plane = new msgPointStruct(1.0, -4.0, 0.0);

            bool        close = false;
            msg3DObject pipO  = (msg3DObject)msgKinematic.Pipe(ar, null, cnt1, point_in_plane, 0.0, ref close);

            scene.AttachObject(pipO);
            pipO.SetAttribute(msgObjectAttrEnum.SG_OA_COLOR, 25);

            msgVectorStruct transV1 = new msgVectorStruct(2.5, 1, 0);

            pipO.InitTempMatrix().Translate(transV1);
            pipO.ApplyTempMatrix();
            pipO.DestroyTempMatrix();
        }