LineCut Optimizer is an application for generating cutting maps and production reports (MES) for steel profiles (beams, pipes, channels, angles, and more), as well as exporting FabTrol (XML) lists for automated nesting in ProNest (version 2021 and above).
The application solves the Cutting Stock Problem (also known as the bin packing problem) - a classic optimization problem in operations research. The problem involves cutting standard-sized stock materials (such as pipes, profiles, rebar, or sheet metal) into pieces of specified sizes while minimizing material waste.
It implements a greedy algorithm with pattern generation to find near-optimal cutting solutions and supports:
- Multiple stock lengths with quantity constraints
- Multiple part sizes with required quantities
- End cut and blade thickness parameters
- Mark and position tracking for parts
- Excel file import/export
- Visual cutting pattern representation
This tool is designed for industrial applications where material waste reduction directly impacts production costs and efficiency.
A web-based calculator for optimal linear material cutting (pipes, profiles, rebar, etc.) that solves the cutting stock problem using pattern generation and greedy optimization algorithms.
- β Multiple Stock Management: Define multiple stock lengths with quantity constraints (including unlimited)
- β Part Management: Add parts manually or import from Excel files
- β Mark & Position Tracking: Track part marks and positions for production planning
- β Excel Import/Export: Import cutting lists from Excel and export cutting patterns
- β Visual Cutting Patterns: Interactive visualization of cutting patterns with waste indicators
- β Optimization Parameters: Configure end cuts and blade thickness for accurate calculations
- β Real-time Statistics: View total waste, efficiency, and stock usage
- Next.js 16 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS 4 - Modern styling
- ExcelJS - Excel file parsing and generation
- jsPDF - PDF document generation
- Electron - Desktop application platform
- Capacitor - Android and iOS (WebView wrapper over static Next.js export)
- Cloudflare Workers - Trial API / license counter backend
npm installnpm run devThe application will be available at http://localhost:3000
npm run build
npm startnpm run mobile:apk:debug # debug APK (after next build + cap sync)
npm run mobile:apk:release # release APK
npm run mobile:android # open Android StudioOutput: android/app/build/outputs/apk/debug/app-debug.apk
Multi-platform release artifacts (.exe, .deb, .dmg, .apk, .aab, iOS simulator zip) are published to GitHub Releases on v* tag push. Latest: v1.0.8a.
make # Windows portable
npm run electron:linux
npm run electron:macThe application supports several import modes and integrations:
-
Standard Excel:
- Expects columns:
- LENGTH - Part length in millimeters
- QUANTITY - Number of parts required
- MARK - Optional part mark/identifier
- POSITION - Optional part position
- Extensions:
.xlsx,.xlsm
- Expects columns:
-
BlankβRZ (Excel template):
- Imports specifications in the BlankβRZ format (plates and profiles).
- Extensions:
.xlsx,.xlsm
-
Tekla Structures:
- Imports "Technological Map" (Π’Π΅Ρ Π½ΠΎΠ»ΠΎΠ³ΠΈΡΠ΅ΡΠΊΠ°Ρ ΠΊΠ°ΡΡΠ°) exports.
- Extensions:
.xlsx
-
Advance Steel:
- Imports BOM extracts (XML) or Excel lists.
- Extensions:
.xml,.xlsx - Supports hierarchical assemblies (beams/pipes + attached plates) and automatically separates fittings vs mounting elements.
-
IFC (Tekla / Advance Steel):
- Imports STEP IFC models (
.ifc) viaweb-ifc. - Extracts profiles (
ObjectType/Pset_ProfileProperties), lengths, marks (Tag), weights and assembly plates. - No 3D viewer β property extraction only.
- Imports STEP IFC models (
-
DWF (Navisworks / Advance Steel):
- Imports Navisworks lightweight models (
.dwf, ZIP +content.xml). - Reads Advance Steel properties: profile, length, mass, shipping mark, position.
- Assembly and plate grouping matches IFC / Advance Steel extract logic.
- Imports Navisworks lightweight models (
-
PowerFab / FabTrol / ProNest:
- Exports plate fittings grouped by steel grade to FabTrol XML
pronest-cutting-list.xmlfor ProNest / PowerFab.
- Exports plate fittings grouped by steel grade to FabTrol XML
The application uses a greedy algorithm with pattern generation:
- Generates all possible cutting patterns for each stock length
- Selects patterns with minimum waste
- Optimizes material usage by iteratively applying best patterns
- Tracks individual parts with marks and positions
- Configure Parameters: Set end cut and blade thickness
- Add Stock: Define stock lengths and quantities
- Add Parts: Manually enter parts or import from Excel
- Calculate: Run the optimization algorithm
- View Results: Review cutting patterns and statistics
- Visualize: Click "ΠΠΎΠΊΠ°Π·Π°ΡΡ ΡΠ°ΡΠΊΡΠΎΠΉ" to see visual cutting patterns
- Export: Save results to Excel file or PDF
line-cut-optimizer/
βββ app/ # Next.js App Router entry
β βββ layout.tsx # Root layout
β βββ page.tsx # Main page (mounts CuttingCalculator)
β βββ globals.css # Global styles
βββ components/ # React components / UI
β βββ mes/ # MES panel, orders, daily marks, PTO upload
β βββ CuttingCalculator.tsx # Main calculator + UI logic
β βββ CuttingVisualization.tsx # Cutting patterns visualization
β βββ AutomaticCuttingButton.tsx # One-click automatic cutting flow
β βββ AboutModal.tsx # Inβapp README / license viewer
β βββ TechCardComparison.tsx # Tekla tech card comparison UI
β βββ AppBootLoader.tsx # App bootstrap / loading screen
β βββ AppFooter.tsx # Footer with version and links
β βββ ThemeToggle.tsx # Light / dark theme toggle
β βββ TrialNoticeModal.tsx # Trial notice / limits UI
β βββ TrialApiStatusIndicator.tsx # Trial API connectivity status
β βββ IconLoader.tsx # Lazy icon loading
β βββ MobilePlatformInit.tsx # Capacitor mobile init
β βββ PrintConfirmDialog.tsx # Print / PDF confirmation dialog
β βββ VisualExportHint.tsx # Visual export hints
βββ lib/ # Core domain logic
β βββ mes/ # MES readiness, BOM ingest, Drive sync
β βββ trial/ # Trial license / fingerprint / API client
β βββ cutting-stock.ts # Cutting stock algorithm
β βββ long-part-splitter.ts # Long parts A/B splitter
β βββ excel-parser.ts # Standard Excel / BlankβRZ parser
β βββ tekla_tech_card.ts # Tekla tech card parser
β βββ tekla_1c_xml_generator.ts # Tekla β 1C XML export
β βββ tekla_plate_dims.ts # Tekla plate dimension helpers
β βββ advance_steel_parser.ts # Advance Steel XML / Excel parser
β βββ blank_rz.ts # BlankβRZ helpers and weight calc
β βββ tech_card_comparator.ts # Tekla tech card comparison logic
β βββ tech_card_comparison_pdf.ts # Comparison PDF export
β βββ fabtrol_generator.ts # FabTrol XML export for ProNest/PowerFab
β βββ fabtrol_parser.ts # FabTrol order / plate import
β βββ fabtrol_plates.ts # FabTrol plate helpers
β βββ fabtrol_inquiry_parser.ts # FabTrol inquiry (MRP) import
β βββ fabtrol_inquiry_generator.ts # FabTrol inquiry (MRP) export
β βββ fabtrol_nc_paths.ts # FabTrol NC path helpers
β βββ powerfab_parser.ts # PowerFab work order parser
β βββ pronest_cutting_list_parser.ts # ProNest cutting list import
β βββ pronest_cutting_list_generator.ts# ProNest cutting list export
β βββ pronest_pnl_generator.ts # ProNest PNL file generator
β βββ snl_generator.ts # SNL / metal demand export
β βββ pdf-font-loader.ts # PDF font preloading for jsPDF
β βββ pdf-layout.ts # PDF layout helpers
β βββ pdf-print.ts # PDF generation and print
β βββ capacitor-linecut-app.ts # Capacitor app bridge helpers
β βββ boot-loader.ts # Boot / splash loader helpers
β βββ asset-path.ts # Asset path helper (web/Electron)
β βββ format-utils.ts # Mark/label formatting helpers
β βββ app-links.ts # External links and store URLs
β βββ app-version.ts # App version metadata
β βββ platform-api.ts # Platform detection (web/Electron/mobile)
β βββ processing-tags.ts # Processing tag helpers
β βββ xml_escape.ts # XML escaping utilities
βββ types/ # Shared TypeScript types
β βββ gost_profiles.ts # GOST profile definitions
βββ electron/ # Electron desktop shell
β βββ main.ts # Main process
β βββ preload.ts # Preload bridge
β βββ fingerprint.ts # Desktop device fingerprint
β βββ print-pdf.ts # Native PDF print helper
βββ android/ # Capacitor Android project
βββ ios/ # Capacitor iOS project
βββ cloudflare/ # Cloudflare Workers (trial API)
βββ integrations/ # 1C / ERP processing integrations
βββ scripts/ # Build and verification scripts
β βββ build-android-apk.ts # Android APK build helper
β βββ copy-electron-assets.ts # Electron asset staging
β βββ generate-brand-icons.ts # App icon generation
β βββ stage-release-downloads.ts # Stage release assets for public/downloads
β βββ verify-*.ts # FabTrol / SNL / 1C format verification
βββ public/ # Static assets
β βββ icons/ # UI icons (Excel, Tekla, ADS, FabTrol, etc.)
β βββ assets/ # Images, fonts, and other assets
β βββ downloads/ # Release download links
βββ examples/ # Sample input files
β βββ advance/ # Advance Steel extracts (XML)
β βββ blank_rz/ # BlankβRZ Excel samples
β βββ FabTrol/ # FabTrol order / DLL samples
β βββ PowerFab/ # PowerFab work order examples
β βββ pronest/ # ProNest cutting list samples
β βββ tekla/ # Tekla tech card samples
β βββ mes/ # MES sample payloads
βββ docs/ # Additional documentation
βββ out/ # Static export / build artifacts
βββ capacitor.config.ts # Capacitor mobile config
βββ next.config.js # Next.js config (static export)
βββ package.json # Dependencies and scripts
MIT