Skip to content

Commit

Permalink
READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
fraguada committed Dec 9, 2020
1 parent 4dd81dc commit 127f972
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 3 deletions.
29 changes: 29 additions & 0 deletions compute/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Rhino.Compute Samples

Write code to access the Rhino and Grasshopper SDKs through a stateless REST API running on Windows Servers. Use Compute to enhance any online solution you are developing to create and manipulate two and three-dimensional curves, surfaces, and solids. Install and customize Compute to run on any cloud services framework.

These samples show how to calculate various geometric operations with Rhino.Compute.

- [C#](cs)
- [SampleMakeAMesh](cs/SampleMakeAMesh) - Creates a NURBS sphere and calls Rhino.Compute to mesh it.
- [SampleCircleIntersection](cs/SampleCircleIntersection) - Solves the intersection between two circles and saves the resul as an SVG.
- [SampleBrepBooleanOperation](cs/SampleBrepBooleanOperation) - Solves various boolean operations and saves them as OBJ files.
- [SampleNurbsTesselation](cs/SampleNurbsTesselation) - Creates a NurbsSurface, converts it to a Mesh (using different meshing parameters) and exports the results as OBJ files.
[![](https://user-images.githubusercontent.com/121068/52407745-00b27800-2ac9-11e9-8040-630a69c789f4.png)]()
- [JavaScript](js)
- [SampleBrepMesher](js/SampleBrepMesher) - Calls compute to mesh a BREP.
- [SampleBrepIsocurves](js/SampleBrepIsocurves) - Loads a 3dm file containing the Rhino logo as a BREP, fetches the render mesh and wireframe and loads them into a three.js scene.
[![BREP extract isocurves sample](https://user-images.githubusercontent.com/1014562/68939044-f2a02f00-079f-11ea-8e39-d582fa67e409.png)](js/SampleBrepIsocurves)
- [SampleBrepBoolean](js/SampleBrepBoolean) - Loads a 3dm file containing the Rhino logo as a BREP and another set of breps then calculates the boolean difference between the Rhino logo and these.
[![BREP Boolean difference sample](https://user-images.githubusercontent.com/1014562/68939173-3b57e800-07a0-11ea-9e3a-46a9e4a82f40.png)](js/SampleBrepBoolean)
- [SampleClashDetection](js/SampleClashDetection) - Performs clash detection between a bunch of randomly positioned spheres and one main sphere.
[![Clash detection sample](https://user-images.githubusercontent.com/1014562/68939429-e7013800-07a0-11ea-91cb-7b58a6e97c3b.png)](js/SampleClashDetection)
- [SampleGHCurveInput](js/SampleGHCurveInput) - Builds a curve with rhino3dm.js and uses it as the input to a GH definition.
[![Sample Grasshopper Curve Input](https://user-images.githubusercontent.com/1014562/101641267-d5d13c00-3a31-11eb-87f8-d92b4a8b293c.png)]()
- [SampleGHDelaunayMesh](js/SampleGHDelaunayMesh) - Generates random points and meshes them with the Delaunay component in Grasshopper.
[![Sample Grasshopper Delaunay Mesh](https://user-images.githubusercontent.com/1014562/68939360-bc16e400-07a0-11ea-80c1-f88aa7c5c0ec.png)](js/SampleGHDelaunayMesh)
- [SampleGHExtrusions](js/SampleGHExtrusions) - Passes the input from three sliders to a Grasshopper defintion which offsets faces from a mesh and smooths it with SubD components.
[![Sample Grasshopper Extrusions](https://user-images.githubusercontent.com/1014562/68939312-912c9000-07a0-11ea-9261-ed2e025bfa45.png)](SampleGHExtrusions)
- [Python](py)
- [SampleTkinter](py/SampleTkinter) - This sample uses rhino3dm to create a brep from a sphere and then sends it to Compute to generate a mesh. The resulting mesh is visualised with Python's built-in Tkinter GUI framework.
[![Python tkiner sample](https://user-images.githubusercontent.com/1014562/101641680-555f0b00-3a32-11eb-9dfd-c703adebe54c.gif)]()
6 changes: 3 additions & 3 deletions compute/js/SampleGHCurveInput/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as THREE from 'https://unpkg.com/three@0.122.0/build/three.module.js'
import { OrbitControls } from 'https://unpkg.com/three@0.122.0/examples/jsm/controls/OrbitControls.js'
import * as THREE from 'https://unpkg.com/three@0.123.0/build/three.module.js'
import { OrbitControls } from 'https://unpkg.com/three@0.123.0/examples/jsm/controls/OrbitControls.js'

let args = {
algo : null,
Expand Down Expand Up @@ -58,7 +58,7 @@ async function compute(){
let data = JSON.parse(result.values[0].InnerTree['{ 0; }'][0].data)
let mesh = rhino.CommonObject.decode(data)

let material = new THREE.MeshBasicMaterial( { vertexColors: true, side:2 } )
let material = new THREE.MeshBasicMaterial( { vertexColors: true, side:2, wireframe: true } )
let threeMesh = meshToThreejs(mesh, material)

scene.add(threeMesh)
Expand Down
42 changes: 42 additions & 0 deletions rhino.inside/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Rhino.Inside® Samples

The Rhino.Inside® technology allows Rhino and Grasshopper to be embedded within other products. It may be possible to:

* Starting Rhino and Grasshopper as an add in another product.
* Call directly into the host's native APIs from a Grasshopper or Rhino plugin.
* Access Rhino's APIs through the host application.
* Grasshopper definitions can be opened and previewed in Rhino within the same process as the parent.
* Object can be natively created by Rhino or Grasshopper within the parent product.

![sample-shot](https://user-images.githubusercontent.com/1014562/101173482-e43ee280-3642-11eb-8e49-d3cfd222a516.png)

This repository contains all the sample developer code for loading Rhino inside other 64-bit Windows applications.

These samples are compatible with Rhino 7 which can found [here](https://www.rhino3d.com/download/Rhino/7.0).

## Samples by host application.
The samples in this repository are organized by folders that correspond to the Company\Product name of the host application where you can found more information.

This repository contains samples for:
- [dotnet](dotnet)
- [C# console application](dotnet/SampleHelloWorld)
- [VB console application](dotnet/SampleHelloWorldVB)
- [C# console application for converting files to .obj](dotnet/SampleConvert)
- [Winforms App with Rhino display](dotnet/SampleWinFormsApp)
- [Eto App with Rhino display](dotnet/SampleEtoApp)
- [Console application which solves a GH definition](dotnet/SampleRunGrasshopper)
- [JavaScript](javascript)
- [Node.js](javascript/SampleRhinoInsideNodeApp) A basic example showing how to run Rhino inside of Node.js via edge.js.
- [Electron](javascript/SampleRhinoInsideElectronApp) Sample of running Rhino inside Electron.
- [Electron + GH](javascript/SampleRhinoInsideElectronAppGH) Sample of running Grasshopper inside Electron.
- [CEF](javascript/SampleRhinoInsideCEF) Sample of running Grasshopper inside Chromium Embedded Framework.

Related projects:
- [Rhino.Inside.Revit](https://github.com/mcneel/rhino.inside-revit)
- [Rhino.Inside.CPython]()
- [Rhino.Inside BricsCAD Bricsys](https://github.com/Bricsys/rhino.inside-bricscad)
- [Rhino.Inside.Unity](https://github.com/mcneel/rhino.inside/tree/master/Unity)
- [Rhino.Inside.Unreal](https://github.com/mcneel/rhino.inside/tree/master/Epic%20Games/UE)
- [Rhino.Inside.AutoCAD](https://github.com/mcneel/rhino.inside/tree/master/Autodesk/AutoCAD)

**If you have any questions, [visit the discussion forum...](https://discourse.mcneel.com/c/rhino-inside/110)**
27 changes: 27 additions & 0 deletions rhino3dm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# rhino3dm Samples

rhino3dm is a set of libraries based on the OpenNURBS geometry library with a "RhinoCommon" style. This provides the ability to access and manipulate geometry through .NET, Python or JavaScript applications independent of Rhino.

Functionality includes

- Create, interrogate, and store all geometry types supported in Rhino. This includes points, point clouds, NURBS curves and surfaces, polysurfaces (B-Reps), meshes, annotations, extrusions, and SubDs.
- Work with non-geometry classes supported in Rhino like layers, object attributes, transforms and viewports
- Read and write all of the above information to and from the .3dm file format
- Use as a client to make calls into the Rhino Compute cloud server for advanced manipulation of geometry objects
- Available on most platforms (Windows, macOS, Linux)

## Samples

- [C#](https://github.com/mcneel/rhino-developer-samples/tree/7/opennurbs/cs)
- [JavaScript](js)
- [SampleSketch2d](js/SampleSketch2d) - Sketch NURBS curves on a canvas. Also shows how to download the resulting 3dm file.
- [SampleObjectTypes](js/SampleObjectTypes) - Sample shows the creation of various object types.
- [SampleViewer (Basic)](js/SampleViewer/01_basic) - Loads a .3dm file and renders the geometry with [Three.js](https://threejs.org).
[![image](https://user-images.githubusercontent.com/1014562/68938619-05feca80-079f-11ea-8d15-354c3e82a261.png)](js/SampleViewer/01_basic)
- [Sample Viewer (Advanced)](js/SampleViewer/02_advanced) - Loads a .3dm file and renders the geometry and material with [Three.js](https://threejs.org).
[![image](https://user-images.githubusercontent.com/1014562/68938708-30e91e80-079f-11ea-9ad8-0de304d87327.jpg)](js/SampleViewer/02_advanced)
- [Python](py)
- [SampleSimple](py/SampleSimple.py)
- [SampleGetMeshes](py/SampleGetMeshes.py)
- [SampleRequestBoundingBox](py/SampleRequestBoundingBox.py)
- [SampleSphereLines](py/SampleSphereLines.py)
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 127f972

Please sign in to comment.