private void NoiseDemo() { Program.PrintTitle("RUNNING STEP 3"); var noise = new Func <Vec3, float>(p => Noise.PerlinNoise(p * 0.08f) * 4); var cube = new PolygonTriangulation.ImplicitObjects.Cube(50); var noisecube = new Displacement(cube, noise); var sphere = new PolygonTriangulation.ImplicitObjects.Sphere(25); var noisesphere = new Displacement(sphere, noise); var algo = new WeightedCubes(64); var algo2 = new WeightedCubes(64); var result = Triangulate(new[] { algo, algo2 }, new[] { noisecube, noisesphere }); if (!LaunchView(result)) { Export(result); } Console.WriteLine("\nStep 3 finished"); Console.WriteLine("\nPRESS ANY KEY TO CONTINUE"); }
private void CubeSphereIntersection() { Program.PrintTitle("RUNNING STEP 1"); var cube = new PolygonTriangulation.ImplicitObjects.Cube(60); var sphere = new PolygonTriangulation.ImplicitObjects.Sphere(35); var intersection = new Intersection(cube, sphere); var algo = new WeightedCubes(); var result = Triangulate(new[] { algo }, new[] { intersection }); if (!LaunchView(result)) { Export(result); } Console.WriteLine("\nStep 1 finished"); Console.WriteLine("\nPRESS ANY KEY TO CONTINUE"); }