Table of Contents

Class StlSourceTopoBrick

Namespace
Hi.NcMech.Topo
Assembly
HiMech.dll

Represents a topological brick that sources its geometry from an STL file. Implements display, collision detection, and content update capabilities.

public class StlSourceTopoBrick : ITopoBrick, IGetSolid, IAnchoredDisplayee, IGetAnchor, IGetTopoIndex, IDisplayee, IExpandToBox3d, IAnchoredCollidableLeaf, IAnchoredCollidableNode, IAnchoredCollidableBased, ICollidable, IDisposable, IUpdateByContent, IClearCache
Inheritance
StlSourceTopoBrick
Implements
Inherited Members
Extension Methods

Constructors

StlSourceTopoBrick()

Initializes a new instance of the StlSourceTopoBrick class.

public StlSourceTopoBrick()

StlSourceTopoBrick(Anchor)

Initializes a new instance of the StlSourceTopoBrick class with the specified anchor.

public StlSourceTopoBrick(Anchor anchor)

Parameters

anchor Anchor

The anchor point for this brick.

StlSourceTopoBrick(Anchor, IGetStl)

Initializes a new instance of the StlSourceTopoBrick class with the specified anchor and geometry.

public StlSourceTopoBrick(Anchor anchor, IGetStl geom)

Parameters

anchor Anchor

The anchor point for this brick.

geom IGetStl

The STL geometry source.

StlSourceTopoBrick(Anchor, IGetStl, PolarResolution2d)

Initializes a new instance of the StlSourceTopoBrick class whose solid is born with the given mesh resolution (see PolarResolution2d).

public StlSourceTopoBrick(Anchor anchor, IGetStl geom, PolarResolution2d resolution)

Parameters

anchor Anchor

The anchor point for this brick.

geom IGetStl

The STL geometry source.

resolution PolarResolution2d

Mesh resolution the solid is born with; null lets the geometry apply its own default.

StlSourceTopoBrick(Anchor, Solid)

Initializes a new instance of the StlSourceTopoBrick class hosting an externally owned Solid. The brick does NOT dispose an injected solid: the provider keeps its lifecycle, so one solid instance can be shared by several hosts (e.g. two topology entities displaying the same machine part).

public StlSourceTopoBrick(Anchor anchor, Solid solid)

Parameters

anchor Anchor

The anchor point for this brick.

solid Solid

The externally owned solid to host.

Properties

Anchor

Gets the anchor point for this brick.

public Anchor Anchor { get; }

Property Value

Anchor

CollidableName

Gets the name of the collidable object.

public string CollidableName { get; }

Property Value

string

Geom

Gets or sets the STL geometry source.

public IGetStl Geom { get; set; }

Property Value

IGetStl

Solid

Gets the solid geometry instance. The instance is swapped — not mutated — when the mesh resolution changes (see RebuildSolid(PolarResolution2d)), so consumers must re-read this property instead of caching the solid.

public Solid Solid { get; }

Property Value

Solid

Methods

ClearCache()

Clears any cached data held by the implementing object.

public void ClearCache()

Display(Bind)

Display function called in DispEngine rendering loop.

public void Display(Bind bind)

Parameters

bind Bind

Bind with DispEngine. See Bind.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

Releases the unmanaged resources and optionally releases the managed resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

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

GetAnchor()

Get key anchor. (i.e. root anchor)

public Anchor GetAnchor()

Returns

Anchor

key anchor

GetAnchoredCollidableNode()

Gets the anchored collidable node associated with this object.

public IAnchoredCollidableNode GetAnchoredCollidableNode()

Returns

IAnchoredCollidableNode

The anchored collidable node.

GetCollidableAnchor()

Gets the anchor associated with this collidable leaf.

public Anchor GetCollidableAnchor()

Returns

Anchor

The anchor for this collidable leaf.

GetCollidee()

Get ICollidee.

public ICollidee GetCollidee()

Returns

ICollidee

ICollidee

GetSolid()

Gets the solid geometry object.

public Solid GetSolid()

Returns

Solid

The solid geometry object.

RebuildSolid(PolarResolution2d)

Swaps the hosted Solid for one born with resolution; the geometry and authored color carry over and the replaced solid is disposed. The resolution is part of a solid's identity, so a matching resolution keeps the current instance untouched. Only a brick that owns its solid may rebuild it.

public bool RebuildSolid(PolarResolution2d resolution)

Parameters

resolution PolarResolution2d

Target mesh resolution; null lets the geometry apply its own default.

Returns

bool

true if the solid was swapped; false if the resolution already matches.

UpdateByContent()

Updates the object based on its current content.

public void UpdateByContent()