Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Linear Cutting Stock Optimizer

Release v1.0.8a TypeScript React Next.js Tailwind CSS jsPDF ExcelJS

Electron Capacitor Android iOS Deploy to Cloudflare Русский

πŸ“‹ Abstract

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.


πŸ” Overview

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.

✨ Features

  • βœ… 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

πŸ› οΈ Technology Stack

  • 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

πŸ“¦ Installation

npm install

πŸš€ Development

npm run dev

The application will be available at http://localhost:3000

πŸ—οΈ Build for Production

npm run build
npm start

πŸ“± Mobile build (Android)

npm run mobile:apk:debug    # debug APK (after next build + cap sync)
npm run mobile:apk:release  # release APK
npm run mobile:android      # open Android Studio

Output: 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.

πŸ–₯️ Desktop (Electron)

make                  # Windows portable
npm run electron:linux
npm run electron:mac

πŸ“Š File Import / Export Formats

Excel / Blank‑RZ
Standard Excel / Blank‑RZ
Import / export of simple cutting lists and Blank‑RZ templates.
Tekla Structures
Tekla Structures
Import of Tech Cards with automatic profile / fitting parsing.
Advance Steel
Advance Steel
Import of BOM extracts (`.xml`, `.xlsx`) with assemblies and fittings.
PowerFab / FabTrol / ProNest
PowerFab / FabTrol / ProNest
Import of PowerFab/FabTrol orders and export of plate fittings to FabTrol XML for ProNest.
IFC
IFC (Tekla / Advance Steel)
Import of IFC models (`.ifc`) with profile, length, mark and weight extraction.
DWF
DWF (Navisworks / Advance Steel)
Import of Navisworks lightweight models (`.dwf`) with BOM from content.xml.

The application supports several import modes and integrations:

  1. 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
  2. Blank‑RZ (Excel template):

    • Imports specifications in the Blank‑RZ format (plates and profiles).
    • Extensions: .xlsx, .xlsm
  3. Tekla Structures:

    • Imports "Technological Map" (ВСхнологичСская ΠΊΠ°Ρ€Ρ‚Π°) exports.
    • Extensions: .xlsx
  4. 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.
  5. IFC (Tekla / Advance Steel):

    • Imports STEP IFC models (.ifc) via web-ifc.
    • Extracts profiles (ObjectType / Pset_ProfileProperties), lengths, marks (Tag), weights and assembly plates.
    • No 3D viewer β€” property extraction only.
  6. 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.
  7. PowerFab / FabTrol / ProNest:

    • Exports plate fittings grouped by steel grade to FabTrol XML pronest-cutting-list.xml for ProNest / PowerFab.

βš™οΈ Algorithm

The application uses a greedy algorithm with pattern generation:

  1. Generates all possible cutting patterns for each stock length
  2. Selects patterns with minimum waste
  3. Optimizes material usage by iteratively applying best patterns
  4. Tracks individual parts with marks and positions

πŸ“– Usage

  1. Configure Parameters: Set end cut and blade thickness
  2. Add Stock: Define stock lengths and quantities
  3. Add Parts: Manually enter parts or import from Excel
  4. Calculate: Run the optimization algorithm
  5. View Results: Review cutting patterns and statistics
  6. Visualize: Click "ΠŸΠΎΠΊΠ°Π·Π°Ρ‚ΡŒ раскрой" to see visual cutting patterns
  7. Export: Save results to Excel file or PDF

πŸ“ Project Structure

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

πŸ“œ License

MIT

About

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)

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages