-
Notifications
You must be signed in to change notification settings - Fork 336
/
Copy pathProgram.cs
33 lines (27 loc) · 1.01 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using Rhino.Compute;
namespace MakeAMesh
{
class Program
{
static void Main(string[] args)
{
ComputeServer.WebAddress = "http://localhost:8081/";
// ComputeServer.ApiKey = "";
// Use standard Rhino3dm methods locally
var sphere = new Rhino.Geometry.Sphere(Rhino.Geometry.Point3d.Origin, 12);
var sphereAsBrep = sphere.ToBrep();
// The following function calls your Rhino.Compute server to get access to something not
// available in Rhino3dm
var meshes = MeshCompute.CreateFromBrep(sphereAsBrep);
// Back to regular Rhino3dmIO local calls
Console.WriteLine($"Got {meshes.Length} meshes");
for (int i = 0; i < meshes.Length; i++)
{
Console.WriteLine($" {i + 1} mesh has {meshes[i].Vertices.Count} vertices");
}
Console.WriteLine("Press any key to exit");
Console.ReadKey();
}
}
}