Class Stl
STL (stereolithography). Composed by Triangles. Provide Stl File R/W.
public class Stl : IGetStl, IExpandToBox3d
- Inheritance
-
Stl
- Implements
- Inherited Members
- Extension Methods
Constructors
Stl(Box3d)
Ctor by box.
public Stl(Box3d box)
Parameters
boxBox3dbox
Stl(Stl)
Copy ctor.
public Stl(Stl stl)
Parameters
stlStlsrc stl
Stl(params Stl[])
Ctor. Copy triangles from stls.
public Stl(params Stl[] stls)
Parameters
stlsStl[]source stls
Stl(IEnumerable<Tri3d>)
Ctor.
The content of tris is copied by this.tris = new List(tris).
public Stl(IEnumerable<Tri3d> tris)
Parameters
trisIEnumerable<Tri3d>triangles
Stl(Stream, StlType)
Ctor by stream.
public Stl(Stream stream, Stl.StlType stlType = StlType.UNKNOWN)
Parameters
Stl(int)
Ctor with preserved triangle grid capacity.
public Stl(int cap = 16)
Parameters
capintPreserved triangle grid capacity
Stl(string, StlType)
ctor by file.
public Stl(string file, Stl.StlType stlType = StlType.UNKNOWN)
Parameters
Properties
Area
Gets the total surface area of the STL model
public double Area { get; }
Property Value
Tris
public List<Tri3d> Tris { get; set; }
Property Value
Methods
ExpandToBox3d(Box3d)
Expands the destination box. This function is usually used to compute the bounding box of elements.
public void ExpandToBox3d(Box3d dst)
Parameters
dstBox3dDestination box
GetStl()
Gets the STL geometry data.
public Stl GetStl()
Returns
- Stl
The STL geometry object
IsAscii(Stream)
Is the stream ascii format stl.
public static bool IsAscii(Stream stream)
Parameters
streamStreamstream
Returns
- bool
true if the stream is ascii format stl; otherwise, return false.
IsAscii(string)
Is the file ascii format stl.
public static bool IsAscii(string file)
Parameters
filestringfile
Returns
- bool
true if the file is ascii format stl; otherwise, return false.
ReBuildNormal()
Re-build normal for all triangles.
public void ReBuildNormal()
Transform(Mat4d)
Trasnform all the triangles by the given matrix.
public Stl Transform(Mat4d mat)
Parameters
matMat4dmatrix
Returns
- Stl
this
WriteBin(BinaryWriter)
Write this to the writer with binary format.
public void WriteBin(BinaryWriter writer)
Parameters
writerBinaryWriterwriter
WriteBin(string)
Write this to the file with binary format.
public void WriteBin(string file)
Parameters
filestringdst file