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
box
Box3dbox
Stl(Stl)
Copy ctor.
public Stl(Stl stl)
Parameters
stl
Stlsrc stl
Stl(params Stl[])
Ctor. Copy triangles from stls.
public Stl(params Stl[] stls)
Parameters
stls
Stl[]source stls
Stl(IEnumerable<Tri3d>)
Ctor.
The content of tris
is copied by this.tris = new List(tris)
.
public Stl(IEnumerable<Tri3d> tris)
Parameters
tris
IEnumerable<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
cap
intPreserved 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
dst
Box3dDestination 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
stream
Streamstream
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
file
stringfile
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
mat
Mat4dmatrix
Returns
- Stl
this
WriteBin(BinaryWriter)
Write this to the writer with binary format.
public void WriteBin(BinaryWriter writer)
Parameters
writer
BinaryWriterwriter
WriteBin(string)
Write this to the file with binary format.
public void WriteBin(string file)
Parameters
file
stringdst file