Class Workpiece
- Namespace
- Hi.NcMech.Workpieces
- Assembly
- HiMech.dll
Workpiece.
public class Workpiece : IDisplayee, IExpandToBox3d, IDisposable, IGetAnchor, IGetTopoIndex, IGetAnchoredDisplayeeList, IAnchoredCollidableLeaf, IAnchoredCollidableNode, IAnchoredCollidableBased, ICollidable, IGetCuttingPara, IMakeXmlSource
- Inheritance
-
Workpiece
- Implements
- Inherited Members
- Extension Methods
Constructors
Workpiece()
Initializes a new instance of the Workpiece class.
public Workpiece()
Workpiece(XElement, string, string)
Initializes a new instance of the Workpiece class.
public Workpiece(XElement src, string baseDirectory, string relFile)
Parameters
src
XElementXML element source.
baseDirectory
stringBase directory.
relFile
stringRelative file path.
Properties
Asmb
Asmb.
public Asmb Asmb { get; }
Property Value
BottomResolution
Resolution.
public double BottomResolution { get; }
Property Value
CollidableName
Gets the name of the collidable object.
public string CollidableName { get; }
Property Value
CollisionFlag
Gets or sets the collision flag.
public CollisionFlag CollisionFlag { get; set; }
Property Value
CuttingPara
Milling parameters.
public ICuttingPara CuttingPara { get; set; }
Property Value
CuttingParaFile
File path for milling parameters.
public string CuttingParaFile { get; set; }
Property Value
DiffRangeColorRule
Internal used.
public RangeColorRule DiffRangeColorRule { get; set; }
Property Value
DiffVisualRadius_mm
Visual radius for difference visualization.
public double DiffVisualRadius_mm { get; set; }
Property Value
FixtureBuckle
Buckle anchor.
public Anchor FixtureBuckle { get; }
Property Value
FixtureToProgramZeroMat4d
Matrix transformation from fixture to program zero.
public Mat4d FixtureToProgramZeroMat4d { get; }
Property Value
GeomAnchor
Anchor of workpiece geometry.
public Anchor GeomAnchor { get; }
Property Value
HasDiff
Indicates whether there are differences between ideal and actual geometry.
public bool HasDiff { get; }
Property Value
IdealGeom
Ideal geometry representation.
public IGetStl IdealGeom { get; set; }
Property Value
IdealSolid
Gets the drawing representing the ideal geometry faces of the workpiece. The derived solid from IdealGeom.
public Solid IdealSolid { get; }
Property Value
InitGeom
Raw geometry for initiate.
public IMakeXmlSource InitGeom { get; set; }
Property Value
InitResolution
Resolution for initialization.
public double InitResolution { get; set; }
Property Value
InitSolid
The derived solid from InitGeom.
public Solid InitSolid { get; }
Property Value
IsRuntimeGeomInit
Indicates whether the runtime geometry is initialized.
public bool IsRuntimeGeomInit { get; }
Property Value
ProgramZeroAnchor
Anchor of geometry zero and cutter location zero.
public Anchor ProgramZeroAnchor { get; }
Property Value
WorkpieceGeomToFixtureBuckleBranch
Branch connecting workpiece geometry to fixture buckle.
public Branch WorkpieceGeomToFixtureBuckleBranch { get; }
Property Value
WorkpieceGeomToFixtureBuckleTransformer
Transformer connecting workpiece geometry to fixture buckle.
public ITransformer WorkpieceGeomToFixtureBuckleTransformer { get; set; }
Property Value
WorkpieceGeomToProgramZeroBranch
Branch connecting workpiece geometry to program zero.
public Branch WorkpieceGeomToProgramZeroBranch { get; }
Property Value
WorkpieceGeomToProgramZeroTransformer
Transformer connecting workpiece geometry to program zero.
public ITransformer WorkpieceGeomToProgramZeroTransformer { get; set; }
Property Value
WorkpieceMaterial
Workpiece material.
public WorkpieceMaterial WorkpieceMaterial { get; set; }
Property Value
WorkpieceMaterialFile
File path for workpiece material.
public string WorkpieceMaterialFile { get; set; }
Property Value
XName
Name for XML IO.
public static string XName { get; }
Property Value
Methods
ClearIdealGeomCache()
Clears the ideal geometry cache.
public void ClearIdealGeomCache()
ClearRawGeomCache()
Clears the raw geometry cache.
public void ClearRawGeomCache()
Diff(double, CancellationToken, Progress<IProgressReport>)
Calculates the difference between ideal and actual geometry.
public void Diff(double detectionRadius, CancellationToken token, Progress<IProgressReport> progress = null)
Parameters
detectionRadius
doubleDetection radius.
token
CancellationTokenCancellation token.
progress
Progress<IProgressReport>Progress reporting interface.
Display(Bind)
Display function called in DispEngine rendering loop.
public void Display(Bind bind)
Parameters
bind
BindBind with DispEngine. See Bind.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
protected virtual void Dispose(bool disposing)
Parameters
disposing
bool
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
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.
GetAnchoredDisplayeeList()
Gets a list of anchored displayable objects.
public List<IAnchoredDisplayee> GetAnchoredDisplayeeList()
Returns
- List<IAnchoredDisplayee>
A list of IAnchoredDisplayee objects
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
GetCuttingPara()
Get ICuttingPara.
public ICuttingPara GetCuttingPara()
Returns
GetRuntimeGeom(CancellationToken, IProgress<IProgressReport>)
Gets the runtime geometry.
public CubeTree GetRuntimeGeom(CancellationToken token, IProgress<IProgressReport> progress = null)
Parameters
token
CancellationTokenCancellation token.
progress
IProgress<IProgressReport>Progress reporting interface.
Returns
- CubeTree
Cube tree representing the runtime geometry.
MakeXmlSource(string, string, bool)
Creates an XML representation of the object. This method may also generate additional resources such as related files.
public XElement MakeXmlSource(string baseDirectory, string relFile, bool exhibitionOnly)
Parameters
baseDirectory
stringThe base directory for resolving relative paths
relFile
stringThe relative file path for the XML source
exhibitionOnly
boolif true, the extended file creation is suppressed.
Returns
- XElement
An XML element representing the object's state
Remarks
For the demand of easy moving source folder (especially project folder) without configuration file path corruption, the relative file path is applied.
The baseDirectory
is typically the folder at the nearest configuration file folder.
Since the folder can be moving with the configuration file.
ReadRuntimeGeom(string)
Reads the runtime geometry from a file.
public void ReadRuntimeGeom(string file)
Parameters
file
stringSource file path.
ResetRuntimeGeom(ClStrip)
Resets the runtime geometry.
public void ResetRuntimeGeom(ClStrip clStrip)
Parameters
clStrip
ClStripCutter location strip.
WriteRuntimeGeom(string, CancellationToken, Progress<IProgressReport>)
Writes the runtime geometry to a file.
public void WriteRuntimeGeom(string file, CancellationToken token, Progress<IProgressReport> progress = null)
Parameters
file
stringTarget file path.
token
CancellationTokenCancellation token.
progress
Progress<IProgressReport>Progress reporting interface.