Table of Contents

Class Stl

Namespace
Hi.Geom
Assembly
HiGeom.dll

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 Box3d

box

Stl(Stl)

Copy ctor.

public Stl(Stl stl)

Parameters

stl Stl

src 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

stream Stream

stl data stream

stlType Stl.StlType

stl data format

Stl(int)

Ctor with preserved triangle grid capacity.

public Stl(int cap = 16)

Parameters

cap int

Preserved triangle grid capacity

Stl(string, StlType)

ctor by file.

public Stl(string file, Stl.StlType stlType = StlType.UNKNOWN)

Parameters

file string

stl file

stlType Stl.StlType

stl file format

Properties

Area

Gets the total surface area of the STL model

public double Area { get; }

Property Value

double

Tris

public List<Tri3d> Tris { get; set; }

Property Value

List<Tri3d>

Triangle grid of this.

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 Box3d

Destination 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 Stream

stream

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 string

file

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 Mat4d

matrix

Returns

Stl

this

WriteBin(BinaryWriter)

Write this to the writer with binary format.

public void WriteBin(BinaryWriter writer)

Parameters

writer BinaryWriter

writer

WriteBin(string)

Write this to the file with binary format.

public void WriteBin(string file)

Parameters

file string

dst file