Пример #1
0
            /// <summary>
            /// Intesects all NURBS Surfaces with Voxels.
            /// </summary>
            /// <param name="Model">the scene.</param>
            /// <param name="Box">the voxel</param>
            /// <param name="Index">the index of the surface to test.</param>
            /// <returns></returns>
            private bool BoxIntersection(RhCommon_Scene Model, OnBoundingBox Box, int Index)
            {
                On3dPoint Center = Box.Center();
                double    Radius = Center.DistanceTo(Box.Min());
                double    s      = 0;
                double    t      = 0;
                On3dPoint point  = new On3dPoint();

                if (RhUtil.RhinoBrepClosestPoint(Model.Brep(Index), Center, new OnCOMPONENT_INDEX(), ref s, ref t, point, Radius))
                //if (Center.DistanceTo(point) < Radius)
                {
                    return(true);
                }
                return(false);
            }