Added builtin linear extrude on Text3D

This commit is contained in:
Mike Smith 2016-02-10 00:09:07 -08:00
parent b5d2160006
commit 152a63ee77
2 changed files with 14 additions and 4 deletions

View File

@ -35,8 +35,16 @@ namespace OSCADSharp.ConsoleTests
var combined = cube.Intersection(cylinder).Color("Blue");
combined = cube.Clone().Mirror(0, 0, 1).Union(combined);
var text = new Text3D()
{
Text = "Hello!"
}.Translate(-30, 0, 0);
combined = text.Union(combined);
string script = combined.ToString();
File.WriteAllLines("test.scad", new string[] { script });
File.WriteAllLines("test.scad", new string[] { script.ToString() });
Console.WriteLine(script);
Console.ReadKey();

View File

@ -1,4 +1,5 @@
using System;
using OSCADSharp.Scripting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -108,8 +109,9 @@ namespace OSCADSharp
appendIfValueNotNullOrEmpty("language", this.Language?.ToString(), sb);
sb.Append(");");
return sb.ToString();
var formatter = new BlockFormatter(String.Format("linear_extrude(height = {0})", 1), sb.ToString());
return formatter.ToString();
}
}
}