ThreadTracer NC-SIM
G-Code Simulation
NC-SIM is a custom G-code simulator built with Three.js with orthographic camera projection.
When NC-Sim is opened from the G-code Output window, it will first start with a fully rendered part, if you want to run as simulated steps, press the Play button at the bottom of the screen to start playback. You can also use the slider to jump forward or backward in the simulated g-code.

Keyboard Shortcuts
- Space — Play/pause
- i — toggle inspect mode
- t — tool settings overlay
- c — show camera coordinates
- g — G-code viewer
- s — settings
- p — parameter debug overlay
- z — reverse scroll zoom direction
- double-click canvas to view side
G-Code Parsing
- Auto-detects metric / inch units (G20 / G21)
- Parses G32/G33/G34 threading cycles with roughing and finishing passes
- Extracts thread metadata from header comments (pitch, diameters, tool shape, nose radius)
- Server-side parsing with responsive cancellation support
3D Workpiece Visualization
- Custom stock profiles via coordinate pairs or simple dimension editor
- Loads stock coordinates from directly from ThreadTracer if defined
- Auto-generated stock profile from G-code header when none provided
Playback Controls
- Step forward/back through individual thread passes
- Continuous play with configurable step size
- Pass slider for jumping to any point in the G-code
Tool Profiles
- Grooving insert, button insert, ISO-V 35°, ISO-D 55°, ISO-C 80°
- Editable nose radius, tool width, face relief, inscribed diameter
- Tool orientation (down/left/right) and position offset (left/center/right)
- Live 2D tool profile preview canvas
- Tool parameters are loaded from ThreadTracer. If not found uses tool data from G-code header, or manual entry
Tool Engagement & Cut Visualization
- Highlights which pass is actively cutting with configurable color
- Per-pass color mapping shows which cuts belong to which pass
- Simulates correct start helix phases, supports multistart threads, variable pitch and tapered threads
Cross-Section View
- Clip plane at Y0 showing internal thread profile
- Configurable section color
Spindle Rotation
- Continuous rotation with adjustable speed
- Direction from M03/M04 in G-code
- Rotation direction arrows overlay
G-Code Sync Viewer
- Side panel showing current simulated G-code
- Highlights current pass line (orange = roughing, green = finishing)
- Auto-scrolls G-code to keep sync with simulated position
Render Quality Settings
- Four presets: Draft, Medium, Fine, High
- Configurable angular segments and Z resolution
- Flat/smooth shading toggle
- HiDPI rendering toggle (1x or 3x pixel ratio)
- FPS limit (1–120, default 60)