Skip to content

Feat/add loft sweep#16

Open
akaszynski wants to merge 3 commits into
hedless:developfrom
akaszynski:feat/add-loft-sweep
Open

Feat/add loft sweep#16
akaszynski wants to merge 3 commits into
hedless:developfrom
akaszynski:feat/add-loft-sweep

Conversation

@akaszynski

Copy link
Copy Markdown

Summary

Add loft and sweep feature tools. Add download artifacts.

Changes

  • New create_loft MCP tool and LoftBuilder — connects 2+ sketch profiles into a solid body, with optional closed/periodic flag and NEW/ADD/REMOVE/INTERSECT operation types.
  • New create_sweep MCP tool and SweepBuilder — sweeps a sketch profile along a sketch path, with optional keepProfileOrientation and operation type.
  • export_part_studio and export_assembly tools now support end-to-end export-to-disk: passing outputPath kicks off the translation, polls until it reaches a terminal state, and writes the binary result to the given path (previously the tool only kicked off the translation and returned a translation id).
  • OnshapeClient.get_bytes() added for binary downloads (translation results would otherwise be corrupted by the JSON parser in get()).
  • ExportManager gains download_external_data, wait_for_translation, export_part_studio_to_file, and export_assembly_to_file.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/CD or build changes

Testing

  • Tests pass locally (pytest -v) — 510 passed
  • New tests added for new functionality
    • tests/builders/test_loft.py — 4 tests (requires >=2 profiles, minimum shape, closed flag, operation type)
    • tests/builders/test_sweep.py — 3 tests (requires profile+path, minimum shape, keep orientation + op type)
    • tests/api/test_export.py — 6 tests (external data download, poll to DONE, poll to FAILED, write-to-file, skip-poll when already DONE, assembly path variant)
  • Coverage threshold maintained (80%+) — 85.24%

Loft and sweep builders were additionally live-validated against the Onshape API:

  • Sweep: circle profile on Front plane + line path on Right plane → featureStatus: OK.
  • Loft: schema confirmed by calling opLoft directly via FeatureScript. The feature JSON is accepted; errors only arise from geometrically invalid profile pairs (e.g., perpendicular planes sharing the origin produce LOFT_DIRECTION_ERROR, which is an Onshape regen error rather than a builder issue).

Checklist

  • Code follows project style (ruff check passes)
  • Self-reviewed the changes
  • No secrets or credentials included

@akaszynski
akaszynski requested a review from hedless as a code owner April 20, 2026 06:13
Circular pattern previously mapped set_axis("Z") to the FRONT plane
(whose normal is +Y), rotating patterned features around the wrong
axis; map Z/Y/X to Top/Front/Right and query their faces so the
rotation axis is the plane normal. Linear pattern entity list now
emits one qCreatedBy query per feature ID instead of a single query
with deterministicIds (which does not resolve feature children).
BooleanBuilder now emits featureType "booleanBodies" and parameterId
"operationType" to match the current Onshape API. CircularPattern
gains set_axis_query for callers that need a cylindrical-face axis
rather than a stock plane. Tests updated to match.
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