Token导航 LogoToken导航TokenDH.com
前端设计只读github未标认证来源可访问许可证需确认审计通过

openscad-collision-detectionopenscad 碰撞检测

Agent Skill

openscad-collision-detection 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

451

周安装

19

GitHub Stars

1

下载量

158
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:openscad-collision-detection(openscad 碰撞检测)
来源仓库:https://github.com/dawiddutoit/custom-claude
仓库路径:skills/openscad-collision-detection
安装命令:
npx skills add https://github.com/dawiddutoit/custom-claude --skill openscad-collision-detection
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dawiddutoit/custom-claude --skill openscad-collision-detection

简介

openscad-collision-detection 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理的场景。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。
  • 该技能归类为前端设计,适合 OpenSCAD 碰撞检测相关的协作支持。

SKILL.md

OpenSCAD Collision Detection

Detect and visualize geometric intersections in OpenSCAD models for woodworking and assembly validation.

Quick Start

Add collision checking to any OpenSCAD model in 3 steps:

// 1. Create reusable checker module
module check_collision(show_overlap=true) {
    if (show_overlap) {
        color("red", 0.8) intersection() {
            children(0);
            children(1);
        }
    }
    %children(0);  // Ghost first object
    children(1);   // Solid second object
}

// 2. Apply to your objects
check_collision() {
    drawer();              // Moving part
    cabinet_interior();    // Fixed structure
}

// 3. Preview (F5) - red regions show collisions

Result: Transparent reference geometry + solid moving part + red overlap visualization.

Table of Contents

  1. When to Use This Skill
  2. What This Skill Does
  3. Core Techniques
  4. Reusable Patterns
  5. Woodworking Scenarios
  6. Debugging Workflow
  7. Supporting Files
  8. Expected Outcomes
  9. Integration Points
  10. Requirements
  11. Red Flags to Avoid

When to Use This Skill

Explicit Triggers

  • "Check collision between drawer and cabinet"
  • "Detect interference in door swing"
  • "Verify clearance for shelf spacing"
  • "Show overlaps in assembly"
  • "Check if drawer fits in cabinet"
  • "Door hinge collision check"
  • "Workbench against wall clearance"

Implicit Triggers

  • Designing cabinets with drawers
  • Creating furniture assemblies
  • Planning room layouts with furniture placement
  • Validating mechanical clearances
  • Debugging "won't fit" issues
  • Testing parametric designs with varying dimensions

Debugging Scenarios

  • Drawer won't close (hits back panel)
  • Door hits adjacent object when opening
  • Shelf spacing too tight for items
  • Hinge cup interferes with door panel
  • Workbench depth exceeds available space
  • Parametric model generates invalid dimensions

What This Skill Does

Provides systematic approach to collision detection:

  1. Visualize intersections using intersection() to reveal overlap volumes
  2. Ghost reference geometry using % modifier for transparent context
  3. Highlight collisions with color coding (red = problem, yellow = clearance)
  4. Measure clearances with echo statements and visual indicators
  5. Create reusable patterns for common woodworking scenarios
  6. Integrate with project libraries (woodworkers-lib, BOSL2, labels.scad)
  7. Validate assemblies before fabrication or room layout

Core Techniques

intersection() - Reveal Overlaps

Returns geometry only where objects overlap:

// Show collision volume
color("red") intersection() {
    drawer();
    cabinet_interior();
}
// If result has volume → collision exists

Debug Modifiers

ModifierEffectUse Case
%Transparent (ghost)Show reference geometry
#Highlight (red)Emphasize specific object
!Show onlyIsolate object for testing
*DisableTemporarily hide geometry
%cabinet_interior();  // Ghost
#drawer();           // Highlight

BOSL2 Utilities

include <BOSL2/std.scad>

debug_this() drawer();  // Shows bounding box + transparent object
ghost() cabinet();      // Semantic equivalent to %

Reusable Patterns

Pattern 1: Basic Collision Checker

module check_collision(show_overlap=true, overlap_color="red") {
    if (show_overlap) {
        color(overlap_color, 0.8) intersection() {
            children(0);
            children(1);
        }
    }
    %children(0);  // Ghost first object
    children(1);   // Solid second object
}

Usage:

check_collision() {
    drawer_extended();
    cabinet_side_panel();
}

Pattern 2: Clearance Visualization

module show_clearance(clearance=2, zones=true) {
    // Original objects
    %children(0);
    children(1);

    // Clearance zones
    if (zones) {
        color("yellow", 0.2)
            offset(r=clearance)
            projection(cut=false)
            children(0);
    }

    // Collision check
    color("red") intersection() {
        children(0);
        children(1);
    }
}

Pattern 3: Conditional Debug Mode

DEBUG_COLLISION = true;  // Toggle at file top

module conditional_check() {
    if (DEBUG_COLLISION) {
        color("red") intersection() {
            children(0);
            children(1);
        }
        %children(0);
        children(1);
    } else {
        children(0);
        children(1);
    }
}

Pattern 4: Assembly Interference Check

module assembly_check(explode=false) {
    spacing = explode ? 50 : 0;

    // Check overlaps when assembled (explode=false)
    if (!explode) {
        color("red", 0.8) intersection() {
            children(0);
            children(1);
        }
    }

    children(0);
    translate([spacing, 0, 0]) children(1);
}

// Usage
assembly_check(explode=$preview) {
    cabinet_shell();
    drawer_assembly();
}

Woodworking Scenarios

Drawer Clearance Check

include <woodworkers-lib/std.scad>

module drawer_clearance_check(cabinet_dim, drawer_dim, panel=18) {
    interior_w = cabinet_dim[0] - 2 * panel;
    interior_d = cabinet_dim[1] - panel;
    interior_h = cabinet_dim[2] - 2 * panel;

    // Ghost cabinet interior
    %color("blue", 0.2)
        translate([panel, 0, panel])
        cube([interior_w, interior_d, interior_h]);

    // Show drawer
    color("green", 0.5) cube(drawer_dim);

    // Highlight collision
    color("red") intersection() {
        translate([panel, 0, panel]) cube([interior_w, interior_d, interior_h]);
        cube(drawer_dim);
    }

    // Echo clearances
    side_clearance = (interior_w - drawer_dim[0]) / 2;
    echo(str("Side clearance: ", side_clearance, "mm per side"));
}

Door Swing Interference

module door_swing_check(door_width, swing_angle=90, adjacent_pos=500) {
    // Door sweep volume
    color("yellow", 0.3)
        rotate([0, 0, swing_angle])
        cube([door_width, 5, 720]);

    // Adjacent object
    translate([adjacent_pos, 0, 0])
        color("green", 0.5)
        cube([200, 400, 720]);

    // Check interference
    color("red") intersection() {
        rotate([0, 0, swing_angle]) cube([door_width, 5, 720]);
        translate([adjacent_pos, 0, 0]) cube([200, 400, 720]);
    }
}

Shelf Spacing Validation

module shelf_spacing_check(cabinet_dim, shelf_positions, item_height, panel=18) {
    // Draw shelves
    for (z = shelf_positions) {
        translate([0, 0, z])
            %planeBottom([cabinet_dim[0], cabinet_dim[1], panel]);
    }

    // Check spacing
    for (i = [0:len(shelf_positions)-2]) {
        spacing = shelf_positions[i+1] - shelf_positions[i] - panel;
        if (spacing < item_height) {
            echo(str("WARNING: Shelf ", i, " spacing (", spacing,
                     "mm) < item height (", item_height, "mm)"));

            // Highlight insufficient spacing
            translate([0, 0, shelf_positions[i] + panel])
                color("red", 0.5)
                cube([cabinet_dim[0], cabinet_dim[1], spacing]);
        }
    }
}

Debugging Workflow

Follow this systematic 5-step process:

Step 1: Isolate Components

!drawer();  // Show only drawer (use ! modifier)

Step 2: Ghost Reference Geometry

%cabinet_interior();
drawer();

Step 3: Check Intersection

color("red") intersection() {
    cabinet_interior();
    drawer();
}
// No volume = no collision

Step 4: Measure Clearance

drawer_width = 764;
interior_width = 782;
clearance = interior_width - drawer_width;
echo(str("Total clearance: ", clearance, "mm (", clearance/2, "mm per side)"));

if (clearance < 4) {
    echo("ERROR: Insufficient clearance!");
}

Step 5: Iterate with Parameters

DRAWER_CLEARANCE = 2;  // mm per side

module drawer_with_clearance(interior_width) {
    width = interior_width - 2*DRAWER_CLEARANCE;
    cube([width, 400, 100]);
}

Supporting Files

examples/examples.md

Comprehensive collision detection examples:

  • Drawer clearance checks (side, top, depth)
  • Door swing interference (hinges, adjacent objects)
  • Shelf spacing validation (item heights, bin clearance)
  • Hinge collision detection (cup-to-door, door-to-frame)
  • Room layout validation (workbench against wall)
  • Assembly interference (multi-part checking)

references/reference.md

Technical reference:

  • OpenSCAD boolean operations (intersection, difference, union)
  • Manifold vs CGAL engine comparison
  • Performance optimization techniques
  • Color coding standards for collision detection
  • Mathematical clearance calculations
  • Integration with BOSL2 and woodworkers-lib

Expected Outcomes

Successful Collision Detection

No collision:

ECHO: "Side clearance: 2.0mm per side"
ECHO: "Top clearance: 5.0mm"
ECHO: "Depth clearance: 10.0mm"

Preview shows no red regions.

Collision detected:

ECHO: "WARNING: Drawer collision detected!"
ECHO: "Overlap volume: 15mm × 18mm × 100mm"
ECHO: "Reduce drawer width by 15mm"

Preview shows red overlap region.

Visual Feedback

ColorMeaning
RedCollision/interference
YellowClearance zone
GreenMoving parts
BlueFixed structure
TransparentReference geometry

Integration Points

With woodworkers-lib

include <woodworkers-lib/std.scad>

module ww_collision_check(outer_dim, inner_dim) {
    // Outer box (cabinet)
    %color("blue", 0.2) {
        planeBottom(outer_dim);
        planeTop(outer_dim);
        planeLeft(outer_dim, t=-1, b=-1);
        planeRight(outer_dim, t=-1, b=-1);
    }

    // Inner box (drawer)
    color("green", 0.5) {
        planeBottom(inner_dim);
        // ... other planes
    }
}

With labels.scad

include <lib/labels.scad>

module labeled_collision_check() {
    labeled_cuboid([800, 400, 100],
        name="DRAWER",
        box_color="green"
    );

    translate([0, 0, 100])
    labeled_cuboid([800, 400, 18],
        name="SHELF",
        box_color="brown"
    );

    // Collision check
    color("red") intersection() {
        cube([800, 400, 100]);
        translate([0, 0, 100]) cube([800, 400, 18]);
    }
}

With BOSL2 Attachments

include <BOSL2/std.scad>

diff()
cuboid([100, 100, 50])
    attach(TOP) tag("remove")
        cyl(d=20, h=30);  // Check if penetrates too deep

Requirements

Tools

  • OpenSCAD 2025.x (Manifold engine for fast intersections)
  • BOSL2 library (optional, for debug_this/ghost utilities)
  • woodworkers-lib (optional, for cabinet/furniture patterns)

Knowledge

  • Basic OpenSCAD syntax (modules, translate, cube)
  • CSG operations (union, difference, intersection)
  • Debug modifiers (%, #,!, *)
  • Color syntax with alpha channel

Environment

  • Preview mode (F5) for fast iteration
  • Console output visible for echo statements

Red Flags to Avoid

  • Not checking clearances before fabrication - Always validate fits
  • Ignoring echo warnings - Console output reveals dimension problems
  • Using render (F6) for collision checks - Preview (F5) is 10-100x faster
  • Forgetting alpha channel in colors - color("red", 0.5) not color("red")
  • Testing only best-case scenarios - Check extreme parameter values
  • Nesting intersection() unnecessarily - Slows down renders significantly
  • Not parameterizing clearances - Hardcoded values make iteration difficult
  • Skipping validation in parametric designs - Add assert() statements
  • Assuming preview accuracy - Render (F6) for final validation if critical
  • Not documenting clearance requirements - Add comments explaining minimums

Notes

Manifold Engine: OpenSCAD 2025+ uses Manifold by default for 10-100x faster boolean operations. If intersection results look wrong, try --backend CGAL as fallback.

Preview vs Render: Collision detection is usually sufficient in preview mode (F5). Only use render (F6) for final validation of critical clearances.

Color Consistency: Use red for collisions, yellow for clearances, green for moving parts, blue for fixed structure throughout all models.

Documentation: Add echo statements for all clearance calculations. Future you will thank present you.

Parametric Validation: Use assert() to enforce clearance minimums:

assert(clearance >= 4, "Drawer clearance must be >= 4mm");

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.97%
按下载量换算57

Claude

29.45%
按下载量换算47

Cursor

19.4%
按下载量换算31

Gemini CLI

9.55%
按下载量换算15

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills