Skip to content

Add importStep class method to Shape#2061

Open
DavidMStraub wants to merge 1 commit into
CadQuery:masterfrom
DavidMStraub:shape_import_step
Open

Add importStep class method to Shape#2061
DavidMStraub wants to merge 1 commit into
CadQuery:masterfrom
DavidMStraub:shape_import_step

Conversation

@DavidMStraub

Copy link
Copy Markdown
Contributor

When using purely functional CadQuery, importStep is a bit awkward as it returns a Workplane, so val() or vals() has to be used to return to the world of Shapes.

Since Shape already has other import/export class methods, I thought it fitting to add an importStep method. Obviously, it needs to strictly return a Shape, so if the STEP doesn't contain one, it raises a ValueError.

Before:

import cadquery as cq

shape = cq.importers.importStep("plate.step").val()

After:

import cadquery as cq

shape = cq.Shape.importStep("plate.step")

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.79%. Comparing base (f69500e) to head (be774db).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2061   +/-   ##
=======================================
  Coverage   95.78%   95.79%           
=======================================
  Files          30       30           
  Lines        9427     9439   +12     
  Branches     1404     1407    +3     
=======================================
+ Hits         9030     9042   +12     
  Misses        242      242           
  Partials      155      155           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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