Skip to content

feat: enhanced mate types with face-based geometry#11

Merged
hedless merged 7 commits intodevelopfrom
feature/enhanced-mate-types
Mar 2, 2026
Merged

feat: enhanced mate types with face-based geometry#11
hedless merged 7 commits intodevelopfrom
feature/enhanced-mate-types

Conversation

@hedless
Copy link
Copy Markdown
Owner

@hedless hedless commented Feb 24, 2026

Summary

  • Rewrite MateConnectorBuilder to use BTMInferenceQueryWithOccurrence-1083 with CENTROID inference type and face deterministicIds, replacing the old BTMIndividualOccurrenceQuery-626 approach that couldn't resolve geometry in assembly context
  • Add slider, cylindrical, and revolute mate types with configurable motion limits (inches for linear, degrees for rotational)
  • Add standalone mate connector tool with flip/secondary axis/translation/rotation options
  • Add assembly analysis tools: get_body_details, get_assembly_features, get_face_coordinate_system, get_assembly_positions, check_assembly_interference, align_instance_to_face, set_instance_position
  • Add delete_feature to AssemblyManager for assembly feature cleanup
  • Add comprehensive documentation: assembly workflow guide, cabinet assembly example, CLAUDE.md project instructions
  • Update README with all 45 tools, new architecture, and current roadmap

Changes

  • onshape_mcp/builders/mate.py - Complete rewrite of MateConnectorBuilder; MateBuilder gains limits support
  • onshape_mcp/server.py - Updated tool schemas to require face IDs; added 10 new tools with behavioral notes in descriptions
  • onshape_mcp/api/assemblies.py - Added delete_feature() method
  • onshape_mcp/api/client.py - Handle empty DELETE response bodies
  • onshape_mcp/analysis/face_cs.py - Face coordinate system query module
  • tests/builders/test_mate.py - Full rewrite matching new builder API
  • tests/test_server.py - Updated mate tool tests with face ID parameters
  • tests/analysis/test_face_cs.py - Tests for face CS module
  • knowledge_base/assembly_workflow_guide.md - Assembly methodology (positioning, mates, solver behavior, same-direction face technique)
  • examples/cabinet_assembly.md - Complete worked example with gotchas
  • CLAUDE.md - Project-level AI instructions
  • README.md - Updated tool tables, architecture, test count (497), roadmap

Verified

  • All 497 tests pass with 86% coverage
  • Live-tested on real Onshape assemblies:
    • Simple test cabinet: fastened, slider+limits, revolute+limits
    • Full 4-drawer cabinet: 25 instances, 66 features (fastened + slider), all OK

Test plan

  • All 497 unit tests pass
  • Live verification on real Onshape assemblies
  • Verify CI passes

🤖 Generated with Claude Code

hedless and others added 2 commits February 24, 2026 11:51
Expose create_slider_mate and create_cylindrical_mate tools (types already
existed in MateBuilder but weren't available as MCP tools). Add
create_mate_connector tool with axis orientation control for positioning
mate connectors on assembly instances. Add optional motion limits
(minLimit/maxLimit) to slider, revolute, and cylindrical mate tools.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rewrites MateConnectorBuilder to use BTMInferenceQueryWithOccurrence-1083
with CENTROID inference type and face deterministicIds, replacing the old
BTMIndividualOccurrenceQuery-626 approach that couldn't resolve geometry.

- MateConnectorBuilder now requires face_id + occurrence_path instead of
  origin coordinates and axis
- Add flip_primary, secondary_axis, translation, and rotation options
- Update all mate tool schemas to require firstFaceId/secondFaceId
- Add AssemblyManager.delete_feature() for assembly feature cleanup
- Handle empty DELETE response bodies in OnshapeClient
- Verified working with live Onshape assembly API

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hedless hedless changed the title feat: enhanced mate types with orientation and limits feat: enhanced mate types with face-based geometry Feb 25, 2026
hedless and others added 5 commits February 25, 2026 10:14
Slider/cylindrical linear limits use limitZMin/limitZMax (not
limitAxialZMin/limitAxialZMax). Revolute rotation limits use
limitAxialZMin/limitAxialZMax (not limitRotationMin/limitRotationMax).
Also use BTMParameterNullableQuantity-807 type with isNull field.

Verified all three mate types (fastened, slider+limits, revolute+limits)
working against live Onshape assembly API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… to get_assembly

Add MCP tools for face geometry inspection and assembly feature listing
to enable better mate placement workflows. Include elementId in assembly
instance output to distinguish parts from different Part Studios.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add firstOffsetX/Y/Z and secondOffsetX/Y/Z params to all mate tools
  (fastened, revolute, slider, cylindrical) for shifting mate connectors
  from face centroids - needed for box joints and edge alignment
- Add offsetX/Y/Z params to create_mate_connector tool
- Fix get_body_details handler case-sensitivity bug (API returns "PLANE"
  uppercase but handler compared against lowercase "plane")
- Add _extract_offsets helper to parse offset arguments

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add comprehensive documentation from live-testing a 25-instance cabinet
assembly with 66 features (fastened + slider mates). Key additions:

- Assembly workflow guide with same-direction face technique for
  fastened mates between free-floating parts
- Worked cabinet assembly example with gotchas and lessons learned
- CLAUDE.md project instructions for AI-assisted assembly workflows
- Updated tool descriptions with behavioral notes (direction, limits)
- README updated: 45 tools, new assembly analysis section, 497 tests
- Face coordinate system query tool and tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hedless hedless merged commit 7be8806 into develop Mar 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant