技能 2026-07-14 10:40 UTC
cad-skillv0.8
版本【0.8】由提交人 nchourrout 提交,主要更新类型为:功能特性新增与扩展。提交说明:Add Gridfinity toolkit (#7)。为项目引入了新的能力与模块支持。
Commit提交信息原文
Add Gridfinity toolkit (#7) * Add Gridfinity toolkit design spec * Add Gridfinity bin generator module - gridfinity.py: spec-compatible GridfinityBin builder (base profile, stacking lip, magnet/screw holes, rounded and polygon pockets, compartments with scoop and label tab, finger notch), with parameter validation that fails loudly on unprintable configs - Base corner radii now follow the spec (0.8 -> 1.6 -> 3.75) and flow into the body fillet without a step - tests/test_gridfinity.py: config matrix, D110 cradle regression against the published STL, validation error coverage - examples/gridfinity_d110_bin.py: D110 cradle rebuilt on the module - SKILL.md: Gridfinity trigger + usage section (vendor the module, never hand-roll the base profile) * Clean up Gridfinity module after review - Batch OCC booleans: one cut for all cavities, one union for scoops and label shelves, translated copies of a single base cell instead of per-cell rebuilds and pairwise unions - Fuse magnet + screw cutters before cutting (overlapping tools in a compound left internal faces); covered by the watertight test - Resolve feature depth defaults once at add-time so validation and geometry can never desync - Replace feature dicts with NamedTuples; drop unused corner_r and top_chamfer constructor knobs (spec constants used directly) - add_compartments now raises if called twice - Split printability defaults out of the SPEC constants block - Tests: load STLs via mesh_io.load_mesh, compare volumes on the B-rep instead of exporting reference meshes - SKILL.md cheat sheet points at builder properties instead of hard-coding derived numbers * Add notch offset and cylinder pockets to Gridfinity module - add_finger_notch(offset=): slide the notch along its wall, validated against the usable wall span - add_cylinder_pocket(): round cavities (thumb wells, batteries, coins); overlapping pockets merge into one cavity - Fuse cavity cutters before the batched cut: cutting with a compound of overlapping tools leaves internal faces (caught by the watertight tests when a thumb well overlapped a polygon pocket) * Simplify boolean batching and check in outline extraction tool - _fused now checks cutter bounding boxes: disjoint cutters keep the cheap compound path, overlapping ones fuse (clean=False, the tool is discarded); _base_hole_cutter reuses it instead of its own loop - Wall-clearance validation deduplicated into _check_wall_clearance, shared by rect, polygon, and cylinder pockets - outline_from_scan.py: the scan-to-pocket-outline pipeline (PCA align, scale to spec dims, slice, union, optional min-bounding-square rotation) as a runnable CLI instead of session-only knowledge - SKILL.md teaches add_cylinder_pocket, notch offset, and the outline tool; README lists the tool * Cylinder pockets can tilt and have round bottoms (thumb scoops) - add_cylinder_pocket gains tilt (max 45 deg, supportless), tilt_dir, and round_bottom; the bore is a single revolved capsule (a cylinder unioned with a tangent sphere leaves a degenerate seam) - mesh_io.load_mesh drops zero-area triangles before checks: OCC's tessellator emits degenerate pole triangles on spherical faces whose zero-length open edges made closed meshes read as non-watertight - Validation: tilt range, tilt_dir required, round-bottom depth, bottom-tip wall clearance * Add MX Master 3 diagonal bin as a repo example Shows the scan-to-pocket pipeline end to end: outline_from_scan.py traces the mouse footprint from a 3D scan, min-bounding-square rotation fits it diagonally in a 3x3 grid, and a tilted round-bottom thumb scoop lifts it out. Print-verified on an MX Master 3 (the outline is the MX3 scan scaled to MX4 spec dims, a roomy fit; the real MX Master 4's footprint changed shape and does not fit). * Link the published MakerWorld model in the README example * Drop the design spec from the branch The durable content already lives in gridfinity.py (spec constants and sources), SKILL.md (workflow), and the commit messages. * Describe the example as MX Master 3 / 3S