kishorkukreja/awesome-supply-chain/guillotine-cutting

Claude Code and agent skill by kishorkukreja/awesome-supply-chain

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

When the user wants to solve cutting problems with guillotine constraints, implement edge-to-edge cutting, or optimize guillotine cutting patterns. Also use when the user mentions "guillotine cuts," "edge-to-edge cutting," "straight cuts only," "two-stage cutting," "three-stage cutting," "n-stage guillotine," or "guillotine cutting stock problem." For general cutting, see 2d-cutting-stock or 1d-cutting-stock. For irregular shapes, see nesting-optimization.

Install

npx vskill@latest install kishorkukreja/awesome-supply-chain/guillotine-cutting

SKILL.md

Guillotine Cutting

You are an expert in guillotine cutting optimization and constrained cutting patterns. Your goal is to help solve cutting problems where all cuts must be guillotine cuts (straight cuts that go from one edge to the opposite edge), which is common in many manufacturing processes using shears, guillotine cutters, saws, and panel saws.

Initial Assessment

Before solving guillotine cutting problems, understand:

  1. Cutting Constraints
  • Must all cuts be guillotine? (edge-to-edge)
  • What stage structure? (two-stage, three-stage, unrestricted)
  • Can you mix horizontal and vertical cuts?
  • Any preferred cut sequence?
  • Maximum number of stages allowed?
  1. Equipment Characteristics
  • What cutting equipment? (guillotine shear, panel saw, CNC router)
  • Equipment bed size/capacity?
  • Can equipment rotate pieces?
  • Cut accuracy/tolerance?
  • Setup time per cut?
  1. Material and Items
  • Sheet/stock dimensions?
  • Item dimensions (all rectangular in guillotine cutting)?
  • Item quantities needed?
  • Can items be rotated 90 degrees?
  • Material grain direction constraints?
  1. Optimization Goals
  • Minimize number of sheets?
  • Minimize number of cuts?
  • Minimize cutting time?
  • Maximize material utilization?
  • Balance multiple objectives?
  1. Practical Considerations
  • Minimum cut length?
  • Minimum piece size?
  • Kerf (saw blade width)?
  • Need to track cutting sequence?
  • Real-time vs. batch optimization?

Guillotine Cutting Framework

Understanding Guillotine Cuts

Definition: A guillotine cut is a straight cut that goes completely from one edge of a rectangle to the opposite edge, dividing it into two smaller rectangles.

Properties:

  • Cut must be parallel to one of the sides
  • Cut extends fully across the material
  • Creates two rectangular sub-pieces
  • No partial cuts or L-shaped cuts

Guillotine vs. Non-Guillotine:

Guillotine Cut: Non-Guillotine:
┌────────────┐ ┌────────────┐
│ │ │ ┌──┐ │
│ │ │ │ │ │
├────────────┤ ✓ │ └──┘ ┌──┤ ✗
│ │ │ │ │
│ │ │ └──┘
└────────────┘ └────────────┘
Problem Classification

1. Two-Stage Guillotine Cutting

  • Stage 1: Cut sheet into strips (horizontal OR vertical)
  • Stage 2: Cut strips into items (perpendicular to stage 1)
  • Most restrictive but simplest
  • Common in industrial panel saws

2. Three-Stage Guillotine Cutting

  • Stage 1: Cut sheet into sections
  • Stage 2: Cut sections into strips
  • Stage 3: Cut strips into items
  • More flexible than two-stage
  • Can achieve better utilization

3. N-Stage Guillotine Cutting

  • Arbitrary number of stages
  • Each cut subdivides a rectangle
  • Recursive structure
  • Tree representation of cuts

4. Unrestricted Guillotine Cutting

  • No stage limit
  • All cuts must be guillotine
  • Most flexible guillotine variant
  • Harder to optimize

5. Exact Guillotine Cutting

  • No trim waste allowed
  • Items must exactly fill rectangles
  • Very restrictive
  • Rare in practice

Mathematical Formulation

Two-Stage Guillotine Problem

Given:

  • W × H = sheet dimensions
  • Items: {(w₁, h₁, d₁), (w₂, h₂, d₂), ..., (wₙ, hₙ, dₙ)}
  • wᵢ, hᵢ = item dimensions
  • dᵢ = demand quantity

Decision Variables:

  • Strip patterns for stage 1
  • Item patterns within strips for stage 2
  • Number of times each pattern is used

Stage 1 (Strips): For horizontal strips:

  • Strip height h
  • Number of strips with this height
  • Constraint: Σ(heights) ≤ H

Stage 2 (Items in strips): For each strip:

  • Items that fit in strip height
  • 1D cutting stock problem in strip width
  • Constraint: Σ(widths) ≤ W

Objective: Minimize number of sheets used

Complexity:

  • Still NP-hard but more tractable than general 2D cutting
  • Stage restriction reduces solution space
  • Can use 1D algorithms for strip packing

Algorithms and Solution Methods

Method 1: Two-Stage Guillotine with Dynamic Programming
python
import numpy as np
from typing import List, Tuple, Dict
class TwoStageGuillotine:
"""
Two-Stage Guillotine Cutting Solver
Stage 1: Cut sheet into horizontal strips
Stage 2: Cut strips into items using 1D algorithm
This is practical and widely used in industry
"""
def __init__(self, sheet_width, sheet_height, kerf=0):
"""
Initialize solver
Parameters:
- sheet_width: sheet width
- sheet_height: sheet height
- kerf: saw kerf (material lost per cut)
"""
self.sheet_width = sheet_width
self.sheet_height = sheet_height
self.kerf = kerf
self.items = []
def add_item(self, width, height, quantity, item_id=None):
"""Add rectangular item"""
if item_id is None:
item_id = f"Item_{len(self.items)}"
self.items.append({
'id': item_id,
'width': width,
'height': height,
'quantity': quantity,
'area': width * height
})
def generate_strip_types(self):
"""
Generate all feasible strip types
A strip type is defined by its height
"""
# Get unique heights from items
unique_heights = set()
for item in self.items:
# Can use item in normal or rotated orientation
unique_heights.add(item['height'])
unique_heights.add(item['width'])
# Filter heights that fit in sheet
strip_types = [h for h in unique_heights if h <= self.sheet_height]
return sorted(strip_types)
def solve_1d_cutting_for_strip(self, strip_height, strip_width):
"""
Solve 1D cutting stock for items that fit in a strip
Returns best patterns for this strip type
"""
# Get items that can fit in this strip height
eligible_items = []
for item in self.items:
# Try both orientations
if item['height'] <= strip_height:
eligible_items.append({
'id': item['id'],
'length': item['width'],
'height': item['height'],
'quantity': item['quantity'],
'rotated': False
})
if item['width'] <= strip_height and item['width'] != item['height']:
eligible_items.append({
'id': item['id'] + '_rot',
'length': item['height'],
'height': item['width'],
'quantity': item['quantity'],
'rotated': True
})
if not eligible_items:
return []
# Generate 1D patterns using dynamic programming
patterns = self._generate_1d_patterns_dp(eligible_items, strip_width)
return patterns
def _generate_1d_patterns_dp(self, items, width):
"""
Generate 1D cutting patterns using dynamic programming
For each item type, find maximum number that fits
"""
patterns = []
# Simple patterns: one item type per pattern
for item in items:
max_fit = int(width / (item['length'] + self.kerf))
if max_fit > 0:
pattern = {
'items': {item['id']: max_fit},
'waste': width - (max_fit * item['length'] + (max_fit - 1) * self.kerf)
}
patterns.append(pattern)
# Combined patterns: two item types
for i, item1 in enumerate(items):
for item2 in items[i:]:
# Try different combinations
for n1 in range(int(width / (item1['length'] + self.kerf)) + 1):
remaining = width - (n1 * item1['length'] + max(0, n1-1) * self.kerf)
n2 = int(remaining / (item2['length'] + self.kerf))
if n1 + n2 > 0:
pattern = {
'items': {},
'waste': 0
}
if n1 > 0:
pattern['items'][item1['id']] = n1
if n2 > 0:
pattern['items'][item2['id']] = n2
used = (n1 * item1['length'] + n2 * item2['length'] +
(n1 + n2 - 1) * self.kerf)
pattern['waste'] = width - used
if pattern not in patterns:
patterns.append(pattern)
return patterns
def solve_master_problem(self, strip_types, strip_patterns):
"""
Solve master problem: select strips to pack into sheets
This is simplified - full implementation uses integer programming
"""
from pulp import *
# Create problem
prob = LpProblem("Two_Stage_Guillotine", LpMinimize)
# Variables: number of each strip type pattern to use
strip_vars = {}
for strip_height in strip_types:
for pattern_idx, pattern in enumerate(strip_patterns[strip_height]):
var_name = f"strip_h{strip_height}_p{pattern_idx}"
strip_vars[(strip_height, pattern_idx)] = LpVariable(
var_name, lowBound=0, cat='Integer'
)
# Objective: minimize number of sheets
# Approximate: sum of strip heights / sheet height
prob += lpSum(
strip_vars[(h, p)] * h / self.sheet_height
for h in strip_types
for p in range(len(strip_patterns[h]))
)
# Demand constraints
for item in self.items:
item_id = item['id']
# Sum across all strips and patterns
prob += lpSum(
strip_vars[(h, p)] * pattern['items'].get(item_id, 0) +
strip_vars[(h, p)] * pattern['items'].get(item_id + '_rot', 0)
for h in strip_types
for p, pattern in enumerate(strip_patterns[h])
) >= item['quantity'], f"Demand_{item_id}"
# Solve
prob.solve(PULP_CBC_CMD(msg=0))
# Extract solution
solution = {
'status': LpStatus[prob.status],
'strip_usage': {}
}
for (h, p), var in strip_vars.items():
if var.varValue and var.varValue > 0.5:
if h not in solution['strip_usage']:
solution['strip_usage'][h] = []
solution['strip_usage'][h].append({
'pattern_index': p,
'pattern': strip_patterns[h][p],
'quantity': int(var.varValue)
})
return solution
def pack_strips_into_sheets(self, strip_usage):
"""
Pack strips into sheets using FFD height
Returns list of sheets with their strips
"""
# Expand strips
strips_to_pack = []
for strip_height, patterns in strip_usage.items():
for pattern_info in patterns:
for _ in range(pattern_info['quantity']):
strips_to_pack.append({
'height': strip_height,
'pattern': pattern_info['pattern']
})
# Sort by decreasing height
strips_to_pack.sort(key=lambda s: s['height'], reverse=True)
# Pack into sheets (FFD)
sheets = []
for strip in strips_to_pack:
placed = False

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
74
Repository forks
18
7-day trend score
22

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/kishorkukreja/awesome-supply-chain/guillotine-cutting/badge)](https://verified-skill.com/skills/kishorkukreja/awesome-supply-chain/guillotine-cutting)

Something wrong with this skill or its page? Tell us.