Skip to content

Commit

Permalink
Renamed project and related files from 'StereoLithography' to 'STL'.
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh McCullough committed Jul 23, 2013
1 parent e16eea4 commit 9c6d0e3
Show file tree
Hide file tree
Showing 11 changed files with 694 additions and 33 deletions.
661 changes: 661 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion StereoLithography.sln → STL.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StereoLithography", "StereoLithography\StereoLithography.csproj", "{F32F3151-1595-4211-A01E-2F7BEB34F88D}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "STL", "STL\STL.csproj", "{F32F3151-1595-4211-A01E-2F7BEB34F88D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{F8604512-723C-493E-BFD3-ECA49558CA72}"
EndProject
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("Stereo Lithography (STL) Format")]
[assembly: AssemblyTitle("STL Format Reader and Writer")]
[assembly: AssemblyDescription("Handles reading and writing the STL format.")]
[assembly: AssemblyCompany("Quantum Concepts Corporation")]
[assembly: AssemblyProduct("Stereo Lithography (STL) Format")]
[assembly: AssemblyProduct("STL Format Reader and Writer")]
[assembly: AssemblyCopyright("Copyright © Quantum Concepts Corporation")]
[assembly: AssemblyTrademark("Copyright © Quantum Concepts Corporation")]
[assembly: AssemblyVersion("1.0.0.0")]
Expand Down
6 changes: 3 additions & 3 deletions StereoLithography/StereoLithography.csproj → STL/STL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<ProjectGuid>{F32F3151-1595-4211-A01E-2F7BEB34F88D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>QuantumConcepts.Formats.StereoLithography</RootNamespace>
<AssemblyName>QuantumConcepts.Formats.StereoLithography</AssemblyName>
<RootNamespace>QuantumConcepts.Formats.STL</RootNamespace>
<AssemblyName>QuantumConcepts.Formats.STL</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>
Expand Down Expand Up @@ -49,7 +49,7 @@
<Compile Include="Facet.cs" />
<Compile Include="Normal.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="STL.cs" />
<Compile Include="STLDocument.cs" />
<Compile Include="Vertex.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
20 changes: 10 additions & 10 deletions StereoLithography/STL.cs → STL/STLDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@

namespace QuantumConcepts.Formats.StereoLithography
{
public class STL : IEquatable<STL>
public class STLDocument : IEquatable<STLDocument>
{
public string Name { get; set; }
public List<Facet> Facets { get; set; }

public STL()
public STLDocument()
{
this.Facets = new List<Facet>();
}

public STL(string name, IEnumerable<Facet> facets)
public STLDocument(string name, IEnumerable<Facet> facets)
: this()
{
this.Name = name;
this.Facets = facets.ToList();
}

public static STL Read(StreamReader reader)
public static STLDocument Read(StreamReader reader)
{
const string regexSolid = @"solid\s+(?<Name>[^\r\n]+)?";

Expand All @@ -35,15 +35,15 @@ public static STL Read(StreamReader reader)
//Read the header.
string header = reader.ReadLine();
Match headerMatch = Regex.Match(header, regexSolid);
STL stl = null;
STLDocument stl = null;
Facet currentFacet = null;

//Check the header.
if (!headerMatch.Success)
throw new FormatException("Invalid STL header, expected \"solid [name]\" but found \"{0}\".".FormatString(header));

//Create the STL and extract the name (optional).
stl = new STL()
stl = new STLDocument()
{
Name = headerMatch.Groups["Name"].Value
};
Expand All @@ -55,22 +55,22 @@ public static STL Read(StreamReader reader)
return stl;
}

public static STL Read(BinaryReader reader)
public static STLDocument Read(BinaryReader reader)
{
if (reader == null)
return null;

byte[] buffer = new byte[80];
string header = null;
STL stl = null;
STLDocument stl = null;
Facet currentFacet = null;

//Read the header.
buffer = reader.ReadBytes(80);
header = Encoding.ASCII.GetString(buffer);

//Create the STL.
stl = new STL();
stl = new STLDocument();

//Read (ignore) the number of triangles.
reader.ReadBytes(4);
Expand Down Expand Up @@ -114,7 +114,7 @@ public override string ToString()
return "solid {0}".FormatString(this.Name);
}

public bool Equals(STL other)
public bool Equals(STLDocument other)
{
return (string.Equals(this.Name, other.Name)
&& this.Facets.Count == other.Facets.Count
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions Test/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("Stereo Lithography (STL) Format Test")]
[assembly: AssemblyDescription("Stereo Lithography (STL) Format Test")]
[assembly: AssemblyTitle("STL Format Reader and Writer Test")]
[assembly: AssemblyDescription("Tests reading and writing the STL format.")]
[assembly: AssemblyCompany("Quantum Concepts Corporation")]
[assembly: AssemblyProduct("Stereo Lithography (STL) Format")]
[assembly: AssemblyProduct("STL Format Reader and Writer Test")]
[assembly: AssemblyCopyright("Copyright © Quantum Concepts Corporation")]
[assembly: AssemblyTrademark("Copyright © Quantum Concepts Corporation")]
[assembly: AssemblyVersion("1.0.0.0")]
Expand Down
24 changes: 12 additions & 12 deletions Test/STLTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ public class STLTests
[TestMethod]
public void FromString()
{
STL stl = null;
STLDocument stl = null;

using (Stream stream = GetData("ASCII.stl"))
{
using (StreamReader reader = new StreamReader(stream))
{
stl = STL.Read(reader);
stl = STLDocument.Read(reader);
}
}

Expand All @@ -36,14 +36,14 @@ public void FromString()
[TestMethod]
public void FromBinary()
{
STL stl = null;
STLDocument stl = null;

using (Stream stream = GetData("Binary.stl"))
{
using (BinaryReader reader = new BinaryReader(stream))
{
{
stl = STL.Read(reader);
stl = STLDocument.Read(reader);
}
}
}
Expand All @@ -58,7 +58,7 @@ public void FromBinary()
[TestMethod]
public void WriteString()
{
STL stl1 = new STL("WriteString", new List<Facet>()
STLDocument stl1 = new STLDocument("WriteString", new List<Facet>()
{
new Facet(new Normal( 0, 0, 1), new List<Vertex>()
{
Expand All @@ -67,7 +67,7 @@ public void WriteString()
new Vertex(-10, 0, 0)
}, 0)
});
STL stl2 = null;
STLDocument stl2 = null;
byte[] stl1Data = null;
string stl1String = null;
byte[] stl2Data = null;
Expand All @@ -88,7 +88,7 @@ public void WriteString()
{
using (StreamReader reader = new StreamReader(stream))
{
stl2 = STL.Read(reader);
stl2 = STLDocument.Read(reader);
}

stl2Data = stream.ToArray();
Expand All @@ -102,7 +102,7 @@ public void WriteString()
[TestMethod]
public void WriteBinary()
{
STL stl1 = new STL("WriteBinary", new List<Facet>()
STLDocument stl1 = new STLDocument("WriteBinary", new List<Facet>()
{
new Facet(new Normal( 0, 0, 1), new List<Vertex>()
{
Expand All @@ -111,7 +111,7 @@ public void WriteBinary()
new Vertex(-10, 0, 0)
}, 0)
});
STL stl2 = null;
STLDocument stl2 = null;
byte[] stl1Data = null;
byte[] stl2Data = null;

Expand All @@ -129,7 +129,7 @@ public void WriteBinary()
{
using (StreamReader reader = new StreamReader(stream))
{
stl2 = STL.Read(reader);
stl2 = STLDocument.Read(reader);
}

stl2Data = stream.ToArray();
Expand All @@ -142,15 +142,15 @@ public void WriteBinary()
[TestMethod]
public void Equality()
{
STL[] stls = new STL[2];
STLDocument[] stls = new STLDocument[2];

for (int i = 0; i < stls.Length; i++)
{
using (Stream stream = GetData("ASCII.stl"))
{
using (StreamReader reader = new StreamReader(stream))
{
stls[i] = STL.Read(reader);
stls[i] = STLDocument.Read(reader);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Test/Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@
<Compile Include="STLTests.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\StereoLithography\StereoLithography.csproj">
<ProjectReference Include="..\STL\STL.csproj">
<Project>{f32f3151-1595-4211-a01e-2f7beb34f88d}</Project>
<Name>StereoLithography</Name>
<Name>STL</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
Expand Down

0 comments on commit 9c6d0e3

Please sign in to comment.