Table of Contents

Color Guide System

The Color Guide System allows you to assign colors and rendering priorities to visual elements based on machining steps or data states.

Overview

The IColorGuide interface defines the core functionality for color mapping, allowing different colors and rendering priorities to be returned based on various steps or states. This system is particularly suitable for scenarios requiring visual encoding based on data states, such as CNC machining path visualization.

Core Interface

IColorGuide Interface

IColorGuide is the core interface of the Color Guide System, inheriting from IMakeXmlSource and IGetColorGuide.

Methods

Method Description
GetRgb Returns RGB color value based on the step object
GetRgbWithPriority Returns RGB color and rendering priority

Priority Explanation

The attachmentPriority parameter controls the overlay priority during rendering:

  • Higher values take priority: Larger priority values are displayed first
  • Graph scaling for pixel consolidation: When multiple machining steps are rendered within the same pixel, higher priority colors take precedence

Effects on Rendering Systems

In CubeTree (CubeTree):

  • Color priorities determine which machining state is displayed when multiple operations overlap in 3D space
  • Higher priority colors (like collision detection) will override lower priority colors (like normal cutting)

Application Scenarios

The Color Guide System is suitable for the following scenarios:

  1. CNC Machining Visualization: Display different path colors based on machining states
  2. Data State Encoding: Convert numerical states to visual color representations
  3. Priority-based Graph Scaling: When zooming out or viewing dense data, higher priority colors (critical states) remain visible while lower priority colors may be consolidated
  4. Multi-resolution Rendering: Critical machining issues (collisions, safety violations) are always displayed regardless of zoom level or data density

Registering Color Guide in Project

To make the Color Guide effective in a project, implement the IColorGuide interface and register it in the project's color guide dictionary.

XML Serialization

See About XML IO for details on XML serialization implementation.

WPF Application Source And Sample Code Path

  • HiMech/Coloring/IColorGuide
  • HiNC-2025-win-desktop/Demo/DemoColorGuide

See this page for Git repository information.