Table of Contents

Class MonoPiecePack

Namespace
Hi.NcOpt
Assembly
HiMech.dll

Mono raw piece optimization package: one optimizable piece adjusted as a whole.

public class MonoPiecePack : ISingleAdjustmentPack, INcOptPiecePack
Inheritance
MonoPiecePack
Implements
Inherited Members
Extension Methods

Remarks

Mirrors HiNc NcOptProc.MonoLinePack (frozen HardNc baseline).

Constructors

MonoPiecePack(SyntaxPiece, string, double, bool, bool, bool, ICutterOptOption, IndexSegment)

Ctor. Seeds StepAdjustment with an empty adjustment.

public MonoPiecePack(SyntaxPiece piece, string toolId, double srcFeedrate_mmds, bool isArc, bool hasArcMotionEvent, bool isRapid, ICutterOptOption cutterOptLimit, IndexSegment stepIndexSegment)

Parameters

piece SyntaxPiece

The classified syntax piece.

toolId string

The active tool id in text form.

srcFeedrate_mmds double

The piece's effective modal feedrate in mm/s.

isArc bool

Whether the piece runs under an arc command in the modal sense.

hasArcMotionEvent bool

Whether the piece carries one-shot arc data.

isRapid bool

Whether the piece is a rapid (G00-modal) line.

cutterOptLimit ICutterOptOption

Cutter optimization limit. May be null.

stepIndexSegment IndexSegment

The step index segment of the piece.

Properties

CutterOptLimit

Cutter optimization limit of the tool active on this piece. May be null.

public ICutterOptOption CutterOptLimit { get; set; }

Property Value

ICutterOptOption

HasArcMotionEvent

Whether the piece itself carries one-shot arc data: its MotionEvent section is an arc form (McArc/ClArc/McPolarArc, with the arc geometry ArcCenter/IsCcw). Distinct from IsArc, which is the modal latch: a zero-motion continuation line under a G02 modal has IsArc true and this false. The splition fragment engine reads this to know whether per-fragment I/J/K rebuilding applies.

public bool HasArcMotionEvent { get; set; }

Property Value

bool

IsArc

Whether the piece runs under an arc command in the MODAL sense: the effective Group-01 latch is G02/G03 — a zero-motion line under a G02/G03 modal is still “on arc” — or, for CL-sourced pieces (which carry no NC modal state), the one-shot motion event is an arc form. Replaces the HardNc NcFlagBitArray.IsOnArcCommand() gate (NcFlagUtil.cs:675-679: the modal G02/G03 flag bits).

public bool IsArc { get; set; }

Property Value

bool

IsRapid

Whether the piece is a rapid (G00-modal) line by the classifier's rapid predicate (one-shot MotionEvent.IsRapid or effective MotionState G00). On such a line the effective modal feedrate is the machine rapid feedrate, not SrcFeedrate_mmds (replaces the HardNc NcFlagBitArray.IsRapid() read that routes HardNcLine.Feedrate_mmds to RapidFeedrate_mmds, HardNcLine.cs:206-211).

public bool IsRapid { get; set; }

Property Value

bool

Remarks

Always false in practice: the classifier never classifies a rapid line as optimizable (opt-ability criterion 10).

Piece

The SoftNc syntax piece this pack was classified from.

public SyntaxPiece Piece { get; set; }

Property Value

SyntaxPiece

SrcFeedrate_mmds

The piece's effective modal feedrate in mm/s (replaces the HardNc ncLine.Feedrate_mmds read).

public double SrcFeedrate_mmds { get; set; }

Property Value

double

StepAdjustment

The single adjustment of this pack.

public StepAdjustment StepAdjustment { get; set; }

Property Value

StepAdjustment

Remarks

Compensation scope decision: the compensation stage (StepFeedSolver BuildCompensation) fills this adjustment's CompensationOnToolRunningCoordinate_mm too — cheap, and it mirrors the HardNc baseline's build side (mono branch, HiNc/NcOpt/NcOptProc.cs lines 1519-1534) — but the writeback deliberately ignores it: coordinate offsets are consumed on SPLITION fragments only, mirroring the baseline's consume side whose mono branch never read a compensation (only the splition branch had the offset code, lines 2249-2265). A mono line keeps its source endpoint text.

StepIndexSegment

Always not null.

public IndexSegment StepIndexSegment { get; set; }

Property Value

IndexSegment

Remarks

The length of the segment can be 0.

ToolId

The id (in text form) of the tool active on this piece, from the classifier's tool state machine. Used for tool house lookups.

public string ToolId { get; set; }

Property Value

string

Methods

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.