-
Notifications
You must be signed in to change notification settings - Fork 334
/
Copy pathProgram.cs
47 lines (42 loc) · 938 Bytes
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.IO;
using System.Reflection;
using Rhino.Runtime.InProcess;
using Rhino.Geometry;
namespace HelloWorld
{
class Program
{
#region Program static constructor
static Program()
{
RhinoInside.Resolver.Initialize();
}
#endregion
[System.STAThread]
static void Main(string[] args)
{
try
{
using (new RhinoCore(args))
{
MeshABrep();
Console.WriteLine("press any key to exit");
Console.ReadKey();
}
}
catch (Exception ex)
{
Console.Error.WriteLine(ex.Message);
}
}
static void MeshABrep()
{
var sphere = new Sphere(Point3d.Origin, 12);
var brep = sphere.ToBrep();
var mp = new MeshingParameters(0.5);
var mesh = Mesh.CreateFromBrep(brep, mp);
Console.WriteLine($"Mesh with {mesh[0].Vertices.Count} vertices created");
}
}
}