From 46755b9b1996846f3e1bb55cdef9fa17afbcbc70 Mon Sep 17 00:00:00 2001 From: Luis Fraguada Date: Fri, 4 Dec 2020 15:30:45 +0100 Subject: [PATCH] Updating READMEs --- rhino.inside/javascript/README.md | 12 ++++++++- .../javascript/SampleRhinoInsideCEF/README.md | 23 +++++++++++++++++ .../SampleRhinoInsideCEF.sln | 5 ++++ .../SampleRhinoInsideElectronApp/README.md | 24 ++++++++++++++++++ .../SampleRhinoInsideElectronApp/package.json | 4 +++ .../SampleRhinoInsideElectronAppGH/README.md | 25 +++++++++++++++++++ .../package.json | 4 +++ .../SampleRhinoInsideNodeApp/README.md | 25 +++++++++++++++++++ .../SampleRhinoInsideNodeApp/package.json | 6 ++++- 9 files changed, 126 insertions(+), 2 deletions(-) create mode 100644 rhino.inside/javascript/SampleRhinoInsideCEF/README.md create mode 100644 rhino.inside/javascript/SampleRhinoInsideElectronApp/README.md create mode 100644 rhino.inside/javascript/SampleRhinoInsideElectronAppGH/README.md create mode 100644 rhino.inside/javascript/SampleRhinoInsideNodeApp/README.md diff --git a/rhino.inside/javascript/README.md b/rhino.inside/javascript/README.md index 9295feb5..27e81dfc 100644 --- a/rhino.inside/javascript/README.md +++ b/rhino.inside/javascript/README.md @@ -1,12 +1,22 @@ # Rhino.Inside Javascript -Rhino Inside® technology allows Rhino and Grasshopper to be embedded within other products. +Rhino Inside� technology allows Rhino and Grasshopper to be embedded within other products. ### Running Rhino and Grasshopper inside various JavaScript Runtimes / Frameworks (Node.js, Electron, Chromium Embedded Framework) ## Samples 1. [Rhino.Inside Node.js](SampleRhinoInsideNodeApp) - This sample runs Rhino inside Node.js. The JavaScript code calls into a .NET dll which launches Rhino, creates some geometry, and returns information related to that geometry. This information is then passed back to JavaScript and is printed to the console. This sample uses the RhinoMethods Library. + +![image](https://user-images.githubusercontent.com/1014562/101172558-9b3a5e80-3641-11eb-84cc-1e9816053f19.png) + 2. [Rhino.Inside Electron](SampleRhinoInsideElectronApp) - This sample runs Rhino.Inside Electron. The Electron app calls methods from JavaScript to .NET to launch Rhino, create some geometry. This geometry is then passed back to Electron. The geometry is deserialized with rhino3dm.js and rendered with Three.js. This sample uses the RhinoMethods Library. + +![image](https://user-images.githubusercontent.com/1014562/101173482-e43ee280-3642-11eb-8e49-d3cfd222a516.png) + 3. [Rhino.Inside Electron + GH](SampleRhinoInsideElectronAppGH) - This sample starts Rhino and Grasshopper inside Electron. Grasshopper preview meshes are passed to the Electron app and visualized with Three.js. This sample uses the RhinoTaskManager Library. + +![image](https://user-images.githubusercontent.com/1014562/101174472-36ccce80-3644-11eb-9c1d-42d4fe0fccfb.png) + + 4. [Rhino.Inside CEF](SampleRhinoInsideCEF) - This sample starts Rhino and Grasshopper inside a .net winforms application hosting a Chromium Embedded Framework browser. Grasshopper Preview meshes are passed to CEF and visualized with Three.js. This sample uses the RhinoTaskManager Library. ## Libraries diff --git a/rhino.inside/javascript/SampleRhinoInsideCEF/README.md b/rhino.inside/javascript/SampleRhinoInsideCEF/README.md new file mode 100644 index 00000000..17e5fb9d --- /dev/null +++ b/rhino.inside/javascript/SampleRhinoInsideCEF/README.md @@ -0,0 +1,23 @@ +# Rhino.Inside CEF +Sample showing how to start Rhino and Grasshopper from a winforms app with a CEF control. + +![image](https://user-images.githubusercontent.com/1014562/101174472-36ccce80-3644-11eb-9c1d-42d4fe0fccfb.png) + + +## Requirements +- [Rhino 7 for Windows](https://www.rhino3d.com/download/rhino-for-windows/7/latest) +- [node.js and npm](https://nodejs.org/en/) (tested on node version 12.18.0 and npm 6.14.4) + +## Dependencies +- [CEFSharp](https://github.com/cefsharp/CefSharp) - [version 86.0.241] Used to host the UI, and javascript. +- [rhino3dm.js](https://www.npmjs.com/package/rhino3dm) - [version 0.13.0] Used to decode data from .net +- [three.js](https://threejs.org) - [version 123] Used to display the geometry coming from Rhino.. +- .net [version 4.8] +- [Rhino.Inside](https://www.nuget.org/packages/Rhino.Inside/) - [version 7.0.0] - Used to resolve Rhino related assemblies. +- [RhinoTaskManager Library](../SampleRhinoInsideJavascriptTaskManagerLib) - .net library that opens up Rhino. + +## Usage +1. This assumes you've installed node.js and Rhino 7. +2. Clone this repository and open the `SampleRhinoInsideCEF.sln` in Visual Studio 2019. +3. Start the application. +4. A winforms window will appear, then the GH Editor. Place some components onto the GH canvas to see them rendered on the js canvas hosted in CEF. This might take some time to start depending on the number of plugins installed in Rhino and GH. \ No newline at end of file diff --git a/rhino.inside/javascript/SampleRhinoInsideCEF/SampleRhinoInsideCEF.sln b/rhino.inside/javascript/SampleRhinoInsideCEF/SampleRhinoInsideCEF.sln index 9289f31d..bfc2629a 100644 --- a/rhino.inside/javascript/SampleRhinoInsideCEF/SampleRhinoInsideCEF.sln +++ b/rhino.inside/javascript/SampleRhinoInsideCEF/SampleRhinoInsideCEF.sln @@ -7,6 +7,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleRhinoInsideCEF", "Sam EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleRhinoInsideJavascriptTaskManagerLib", "..\SampleRhinoInsideJavascriptTaskManagerLib\SampleRhinoInsideJavascriptTaskManagerLib.csproj", "{B70ABEBE-DF8A-4960-82E4-97959F353738}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{CF6F4C66-31E3-4A48-8BFE-9FA6538F2C7B}" + ProjectSection(SolutionItems) = preProject + README.md = README.md + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/rhino.inside/javascript/SampleRhinoInsideElectronApp/README.md b/rhino.inside/javascript/SampleRhinoInsideElectronApp/README.md new file mode 100644 index 00000000..0e3de050 --- /dev/null +++ b/rhino.inside/javascript/SampleRhinoInsideElectronApp/README.md @@ -0,0 +1,24 @@ +# Rhino.Inside Electron +Sample showing how to start Rhino from Electron + +![image](https://user-images.githubusercontent.com/1014562/101172558-9b3a5e80-3641-11eb-84cc-1e9816053f19.png) + +## Requirements +- [Rhino 7 for Windows](https://www.rhino3d.com/download/rhino-for-windows/7/latest) +- [node.js and npm](https://nodejs.org/en/) (tested on node version 12.18.0 and npm 6.14.4) + +## Dependencies +- [electron-edge.js](https://www.npmjs.com/package/electron-edge-js) - [version 12.16.3] Used to communicate between .net and node.js. +- [rhino3dm.js](https://www.npmjs.com/package/rhino3dm) - [version 0.13.0] Used to decode data from .net +- [three.js](https://threejs.org) - [version 123] Used to display the geometry coming from Rhino in the Electron app. +- [Electron](https://www.electronjs.org/) - [version 5.0.13] Used to host the application, UI, and javascript. +- .net [version 4.8] +- [Rhino.Inside](https://www.nuget.org/packages/Rhino.Inside/) - [version 7.0.0] - Used to resolve Rhino related assemblies. +- [RhinoMethods Library](../SampleRhinoInsideJavascriptMethodsLib) - .net library that opens up Rhino. + +## Usage +1. This assumes you've installed node.js and Rhino 7, and have built the RhinoMethods library. +2. Clone this repository. Open a terminal to the cloned repository directory. +3. Install dependencies: `npm i`. +4. Start app: `npm run start`. +5. An electron app will appear and eventually a wireframe render of a sphere. \ No newline at end of file diff --git a/rhino.inside/javascript/SampleRhinoInsideElectronApp/package.json b/rhino.inside/javascript/SampleRhinoInsideElectronApp/package.json index 2743d43d..5385e46d 100644 --- a/rhino.inside/javascript/SampleRhinoInsideElectronApp/package.json +++ b/rhino.inside/javascript/SampleRhinoInsideElectronApp/package.json @@ -17,5 +17,9 @@ "dependencies": { "electron": "5.0.13", "electron-edge-js": "12.16.3" + }, + "engines": { + "node": ">=12.18.0", + "npm": ">=6.14.0" } } diff --git a/rhino.inside/javascript/SampleRhinoInsideElectronAppGH/README.md b/rhino.inside/javascript/SampleRhinoInsideElectronAppGH/README.md new file mode 100644 index 00000000..a0df4e82 --- /dev/null +++ b/rhino.inside/javascript/SampleRhinoInsideElectronAppGH/README.md @@ -0,0 +1,25 @@ +# Rhino.Inside Electron + GH +Sample showing how to start Rhino and Grasshopper from Electron + +![image](https://user-images.githubusercontent.com/1014562/101173482-e43ee280-3642-11eb-8e49-d3cfd222a516.png) + + +## Requirements +- [Rhino 7 for Windows](https://www.rhino3d.com/download/rhino-for-windows/7/latest) +- [node.js and npm](https://nodejs.org/en/) (tested on node version 12.18.0 and npm 6.14.4) + +## Dependencies +- [electron-edge.js](https://www.npmjs.com/package/electron-edge-js) - [version 12.16.3] Used to communicate between .net and node.js. +- [rhino3dm.js](https://www.npmjs.com/package/rhino3dm) - [version 0.13.0] Used to decode data from .net +- [three.js](https://threejs.org) - [version 123] Used to display the geometry coming from Rhino in the Electron app. +- [Electron](https://www.electronjs.org/) - [version 5.0.13] Used to host the application, UI, and javascript. +- .net [version 4.8] +- [Rhino.Inside](https://www.nuget.org/packages/Rhino.Inside/) - [version 7.0.0] - Used to resolve Rhino related assemblies. +- [RhinoTaskManager Library](../SampleRhinoInsideJavascriptTaskManagerLib) - .net library that opens up Rhino. + +## Usage +1. This assumes you've installed node.js and Rhino 7, and have built the [RhinoTaskManager Library](../SampleRhinoInsideJavascriptTaskManagerLib). +2. Clone this repository. Open a terminal to the cloned repository directory. +3. Install dependencies: `npm i`. +4. Start app: `npm run start`. +5. An electron app will appear, then the GH Editor. Place some components onto the GH canvas to see them rendered in the Electron app. This might take some time depending on the number of plugins installed in Rhino and GH. \ No newline at end of file diff --git a/rhino.inside/javascript/SampleRhinoInsideElectronAppGH/package.json b/rhino.inside/javascript/SampleRhinoInsideElectronAppGH/package.json index 2743d43d..5385e46d 100644 --- a/rhino.inside/javascript/SampleRhinoInsideElectronAppGH/package.json +++ b/rhino.inside/javascript/SampleRhinoInsideElectronAppGH/package.json @@ -17,5 +17,9 @@ "dependencies": { "electron": "5.0.13", "electron-edge-js": "12.16.3" + }, + "engines": { + "node": ">=12.18.0", + "npm": ">=6.14.0" } } diff --git a/rhino.inside/javascript/SampleRhinoInsideNodeApp/README.md b/rhino.inside/javascript/SampleRhinoInsideNodeApp/README.md new file mode 100644 index 00000000..4291482b --- /dev/null +++ b/rhino.inside/javascript/SampleRhinoInsideNodeApp/README.md @@ -0,0 +1,25 @@ +# Rhino.Inside Node.js +Sample showing how to start Rhino from node.js + +## Requirements +- [Rhino 7 for Windows](https://www.rhino3d.com/download/rhino-for-windows/7/latest) +- [node.js and npm](https://nodejs.org/en/) (tested on node version 12.18.0 and npm 6.14.4) + +## Dependencies +- [edge.js](https://www.npmjs.com/package/edge-js) - [version 14.3.2] Used to communicate between .net and node.js. +- [rhino3dm.js](https://www.npmjs.com/package/rhino3dm) - [version 0.13.0] Used to decode data from .net +- .net [version 4.8] +- [Rhino.Inside](https://www.nuget.org/packages/Rhino.Inside/) - [version 7.0.0] - Used to resolve Rhino related assemblies. +- [RhinoMethods Library](../SampleRhinoInsideJavascriptMethodsLib) - .net library that opens up Rhino. + +## Usage +1. This assumes you've installed node.js and Rhino 7, and have built the RhinoMethods library. +2. Clone this repository. Open a terminal to the cloned repository directory. +3. Install dependencies: `npm i`. +4. Start app: `npm run start`. +5. You will see the following in the terminal: +``` +rhino3dm loaded. +Rhino has started. +Mesh has 92 vertices and 100 faces. +``` \ No newline at end of file diff --git a/rhino.inside/javascript/SampleRhinoInsideNodeApp/package.json b/rhino.inside/javascript/SampleRhinoInsideNodeApp/package.json index dd3a4d26..7e5308cb 100644 --- a/rhino.inside/javascript/SampleRhinoInsideNodeApp/package.json +++ b/rhino.inside/javascript/SampleRhinoInsideNodeApp/package.json @@ -10,8 +10,12 @@ "edge-js": "14.3.2", "rhino3dm": "0.13.0" }, + "engines": { + "node": ">=12.18.0", + "npm": ">=6.14.0" + }, "scripts": { - "start": "node app.js" + "start": "node ." }, "keywords": [ "rhino3d",