예제 #1
0
        /// <summary>
        /// Intersects two Brep objects and returns the intersection curves.
        /// </summary>
        /// <param name="header">The header.</param>
        /// <param name="inBrep0">The first Brep.</param>
        /// <param name="inBrep1">The second Brep.</param>
        /// <param name="tolerance">The intersection tolerance.</param>
        /// <returns>The intersection curves if successful.</returns>
        public RockfishGeometry[] IntersectBreps(RockfishHeader header, RockfishGeometry inBrep0, RockfishGeometry inBrep1, double tolerance)
        {
            if (null == header)
            {
                throw new FaultException("RockfishHeader is null");
            }

            header.Method = nameof(IntersectBreps);
            RhinoApp.WriteLine("{0} request received from {1}.", header.Method, header.ClientId);

            using (var item = new RockfishRecord(header))
            {
                if (null == inBrep0?.Brep || null == inBrep1?.Brep)
                {
                    throw new FaultException("Brep is null");
                }

                var rc = Intersection.BrepBrep(inBrep0.Brep, inBrep1.Brep, tolerance, out Curve[] curves, out Point3d[] points);
예제 #2
0
        /// <summary>
        /// Simple test to see if the RockFish service is operational.
        /// </summary>
        /// <param name="header">The header.</param>
        /// <param name="str"></param>
        /// <returns>The echoed string if successful.</returns>
        public string Echo(RockfishHeader header, string str)
        {
            if (null == header)
            {
                throw new FaultException("RockfishHeader is null");
            }

            header.Method = nameof(IntersectBreps);
            RhinoApp.WriteLine("{0} request received from {1}.", header.Method, header.ClientId);

            using (var item = new RockfishRecord(header))
            {
                var host_name = RockfishServerPlugIn.ServerHostName();
                var rc        = $"Echo from \"{host_name}\" : {str}";

                header.Succeeded = true;
                return(rc);
            }
        }