mirror of
https://github.com/eliasstepanik/OSCADSharpDotnet7.git
synced 2026-01-25 03:58:37 +00:00
+ Fix for a missing newline occurring for some solids in block statemants.
This commit is contained in:
parent
10e2ffb356
commit
160986eb95
@ -51,7 +51,7 @@ namespace OSCADSharp.UnitTests
|
|||||||
string script = cube.ToString();
|
string script = cube.ToString();
|
||||||
|
|
||||||
Assert.IsTrue(script.StartsWith("cube("));
|
Assert.IsTrue(script.StartsWith("cube("));
|
||||||
Assert.IsTrue(script.EndsWith(");"));
|
Assert.IsTrue(script.TrimEnd().EndsWith(");"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
|
|||||||
@ -51,7 +51,7 @@ namespace OSCADSharp.UnitTests
|
|||||||
string script = basicSphere.ToString();
|
string script = basicSphere.ToString();
|
||||||
|
|
||||||
Assert.IsTrue(script.StartsWith("sphere("));
|
Assert.IsTrue(script.StartsWith("sphere("));
|
||||||
Assert.IsTrue(script.EndsWith(");"));
|
Assert.IsTrue(script.TrimEnd().EndsWith(");"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
|
|||||||
@ -68,8 +68,9 @@ namespace OSCADSharp.Solids
|
|||||||
/// <returns>Script for this object</returns>
|
/// <returns>Script for this object</returns>
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return String.Format("cube(size = [{0}, {1}, {2}], center = {3});",
|
return String.Format("cube(size = [{0}, {1}, {2}], center = {3}); {4}",
|
||||||
this.Size.X.ToString(), this.Size.Y.ToString(), this.Size.Z.ToString(), this.Center.ToString().ToLower()); ;
|
this.Size.X.ToString(), this.Size.Y.ToString(), this.Size.Z.ToString(),
|
||||||
|
this.Center.ToString().ToLower(), Environment.NewLine); ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -125,9 +125,9 @@ namespace OSCADSharp.Solids
|
|||||||
/// <returns>Script for this object</returns>
|
/// <returns>Script for this object</returns>
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return String.Format("cylinder($fn = {0}, $fa = {1}, $fs = {2}, h = {3}, r1 = {4}, r2 = {5}, center = {6});",
|
return String.Format("cylinder($fn = {0}, $fa = {1}, $fs = {2}, h = {3}, r1 = {4}, r2 = {5}, center = {6}); {7}",
|
||||||
Resolution.ToString(), MinimumAngle.ToString(), MinimumCircumferentialLength.ToString(),
|
Resolution.ToString(), MinimumAngle.ToString(), MinimumCircumferentialLength.ToString(),
|
||||||
Height.ToString(), Radius1.ToString(), Radius2.ToString(), Center.ToString().ToLower());
|
Height.ToString(), Radius1.ToString(), Radius2.ToString(), Center.ToString().ToLower(), Environment.NewLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -69,9 +69,9 @@ namespace OSCADSharp.Solids
|
|||||||
/// <returns>Script for this object</returns>
|
/// <returns>Script for this object</returns>
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return String.Format("sphere($fn = {0}, $fa = {1}, $fs = {2}, r = {3});",
|
return String.Format("sphere($fn = {0}, $fa = {1}, $fs = {2}, r = {3});{4}",
|
||||||
this.Resolution.ToString(), this.MinimumAngle.ToString(),
|
this.Resolution.ToString(), this.MinimumAngle.ToString(),
|
||||||
this.MinimumFragmentSize.ToString(), this.Radius.ToString());
|
this.MinimumFragmentSize.ToString(), this.Radius.ToString(), Environment.NewLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -123,6 +123,7 @@ namespace OSCADSharp.Solids
|
|||||||
appendIfValueNotNullOrEmpty("language", this.Language?.ToString(), sb);
|
appendIfValueNotNullOrEmpty("language", this.Language?.ToString(), sb);
|
||||||
|
|
||||||
sb.Append(");");
|
sb.Append(");");
|
||||||
|
sb.Append(Environment.NewLine);
|
||||||
|
|
||||||
var formatter = new SingleBlockFormatter(String.Format("linear_extrude(height = {0})", 1), sb.ToString());
|
var formatter = new SingleBlockFormatter(String.Format("linear_extrude(height = {0})", 1), sb.ToString());
|
||||||
return formatter.ToString();
|
return formatter.ToString();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user