예제 #1
0
        private void GetNearestObject(VIZCore3D.NET.Data.AxisDirection axis, VIZCore3D.NET.Data.Vertex3D pt, bool visibleOnly, bool opaqueOnly)
        {
            VIZCore3D.NET.Data.NearestObjectByAxisPoint sdpt = vizcore3d.GeometryUtility.GetNearestObject(
                axis
                , pt
                , visibleOnly
                , opaqueOnly
                );

            if (sdpt.Index == -1)
            {
                return;
            }

            List <VIZCore3D.NET.Data.Vertex3DItemCollection> vertex = new List <VIZCore3D.NET.Data.Vertex3DItemCollection>();

            VIZCore3D.NET.Data.Vertex3DItemCollection item = new VIZCore3D.NET.Data.Vertex3DItemCollection();
            item.Add(pt);
            item.Add(sdpt.CollisionPoint);
            vertex.Add(item);


            int lineId = vizcore3d.ShapeDrawing.AddLine(
                vertex
                , sdpt.Index
                , Color.Red
                , 5.0f
                , true
                );

            //int vertexId = vizcore3d.ShapeDrawing.AddVertex(
            //        new List<VIZCore3D.NET.Data.Vertex3D>() { pt, sdpt.CollisionPoint }
            //        , sdpt.Index
            //        , Color.Red
            //        , 5.0f
            //        , 7.0f
            //        , true
            //        );

            string noteText = string.Format(
                "[{0}]{1}\r\nDistance: {2}\r\nCollision: {3}"
                , sdpt.Index
                , vizcore3d.Object3D.FromIndex(sdpt.Index).NodeName
                , sdpt.Distance.ToString()
                , sdpt.CollisionPoint.ToString()
                );

            VIZCore3D.NET.Data.Vertex3D text = new Data.Vertex3D(
                sdpt.CollisionPoint.X
                , sdpt.CollisionPoint.Y
                , sdpt.CollisionPoint.Z + 500
                );
            int surfaceNoteId = vizcore3d.Review.Note.AddNoteSurface(
                noteText
                , text
                , sdpt.CollisionPoint
                );
        }
예제 #2
0
        public void Set(VIZCore3D.NET.Data.NearestObjectByAxisPoint raw, string lugName, string rollerName, string collisionNodeName)
        {
            LugName           = lugName;
            RollerName        = rollerName;
            CollisionNodeName = collisionNodeName;

            CollisionPoint = raw.CollisionPoint;
            Distance       = raw.Distance;
            NodeIndex      = raw.Index;
            Input          = raw.InputPoint;
        }