Code Monkey home page Code Monkey logo

rockfish's Introduction

Rockfish

The Rockfish sample project demonstrates how one might set up a RhinoCommon plug-in to host a Windows Communication Foundation (WCF) service.

Prerequisites

To build the Rockfish solution, you will need the following:

  • Visual Studio - Any of the free version of Microsoft Visual Studio, that can build plug-ins for Rhino, will work.
  • Rhino - The project current targets Rhino 5. But with some minor effort, the project could easily be refactored to work with Rhino 6.

Overview

The Rockfish sample solution contains the following projects:

RockfishServer - This project builds a RhinoCommon plug-in that hosts a WCF Service. The service current uses basic HTTP binding, but it has provisions for named pipes for ease of testing. The service contract has four simple operations that can be called from client systems. The project has three commands:

  • RockfishStart - Starts the service.
  • RockfishStart - Stops the service.
  • RockfishStart - Configures service options.

Note, to access the service remotely, you will need to open TCP Port 8000 on any firewall software running on the system. And in order for the service to listen on TCP Port 8000, Rhino will need to be launched "as Administrator."

RockfishClient - This project also builds a RhinoCommon plug-in, and it consumes the service provided by RockfishServer. The plug-in provides five simple commands:

  • RF_SetServer - Allows you to specify the Rockfish server to be used by the plug-in.
  • RF_Echo - Tests connectivity with the server by sending a string and then printing the server's response on the command line.
  • RF_PolylineFromPoints - Selects points objects and then sends their location to the server. The server creates a polyline curve from the points and sends it back.
  • RF_IntersectBreps - Selects two Brep objects and then sends them to the server. The server calculates the intersection curves and return them back.
  • RF_CreateMeshFromBrep - Selects one or more Brep objects and then sends them to the server. The server generates meshes from the Brep and return them back.

RockfishCommon - This project creates a .NET assembly that references RhinoCommon. This assembly provides common classes that are shared between the RockfishServer and RockfishClient projects. The classes and interfaces of interest are:

  • IRockfishServer - This is the WCF Service Contract that is implemented by RockfishServer.
  • RockfishChannel This class is responsible with opening a communication channel with a Rockfish server and calling function in the server's IRockfishServer implementation.
  • RockfishGeometry - This class defines a WCF Data Contract. The class also handles the binary serialization and de-serialization Rhino.Geometry.GeometryBase inherited objects.

RockfishConsole - This project creates a .NET console application. The project references the Rhino3dmIO NuGet package which allows .NET applications to read and write Rhino's .3dm file format. When built, the application will read Breps from .3dm files and the send them to a Rockfish server. The server will, in turn, return mesh objects which are written to a new .3dm file. Here is the command line syntax:

C:\> RockfishConsole <host_name> <file_name>

Notes

The sample WCF Service instance is multi-threaded. But Rhino is not. You need to keep this in mind when adding functionality to the service.

rockfish's People

Contributors

dalefugier avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.