Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to export binary STL #1106

Merged
merged 10 commits into from Aug 16, 2022
Merged

Conversation

lorenzncode
Copy link
Member

  • exporters.export add "ascii" (or "ASCII") options dict
  • Shape.exportStl add "ascii" bool param
  • fix corrupt docstrings/typos in shapes.py

* exporters.export add "ascii" (or "ASCII") options dict
* Shape.exportStl add "ascii" bool param
* fix corrupt docstrings/typos in shapes.py
@codecov
Copy link

codecov bot commented Jun 18, 2022

Codecov Report

Merging #1106 (24d09b2) into master (f3b0b09) will decrease coverage by 2.42%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1106      +/-   ##
==========================================
- Coverage   96.32%   93.90%   -2.43%     
==========================================
  Files          40       25      -15     
  Lines        9672     5328    -4344     
  Branches     1280      979     -301     
==========================================
- Hits         9317     5003    -4314     
+ Misses        210      193      -17     
+ Partials      145      132      -13     
Impacted Files Coverage Δ
cadquery/occ_impl/exporters/__init__.py 91.81% <100.00%> (+0.22%) ⬆️
cadquery/occ_impl/shapes.py 92.55% <100.00%> (+0.01%) ⬆️
tests/test_exporters.py
tests/test_cadquery.py
tests/test_cqgi.py
tests/test_sketch.py
tests/naca.py
tests/test_importers.py
tests/test_workplanes.py
tests/test_utils.py
... and 7 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@lorenzncode
Copy link
Member Author

Initially I thought I would clean up some of the docstrings since I was already touching shapes.py. I've removed the unrelated docstring cleanup changes to simplify this PR.

@lorenzncode lorenzncode marked this pull request as ready for review July 26, 2022 00:32
Copy link
Member

@adam-urbanczyk adam-urbanczyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor suggestion to improve readability.

NB: I excluded tests from overage calculation to prevent false positive on the relative coverage delta.

cadquery/occ_impl/exporters/__init__.py Outdated Show resolved Hide resolved
lorenzncode and others added 4 commits July 26, 2022 22:17
Improve readability

Co-authored-by: AU <adam-urbanczyk@users.noreply.github.com>
@adam-urbanczyk
Copy link
Member

@lorenzncode which default value did you have in mind?

@lorenzncode
Copy link
Member Author

@adam-urbanczyk I had left the default as ascii mostly to maintain the current behavior and defer the decision. If you agree, let's change to binary in master. If a problem is raised prior to the next release, it can be reverted back to ascii.

@adam-urbanczyk
Copy link
Member

I'm OK with changing to binary, let's see what others will say.

Copy link
Member

@jmwright jmwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lorenzncode

@jmwright
Copy link
Member

Feel free to merge after the change to binary as the default is made.

@lorenzncode
Copy link
Member Author

The behavior of deprecated exportShape is unchanged. Binary STL format support is not added to exportShape. It continues to export ASCII format.

@lorenzncode lorenzncode linked an issue Aug 12, 2022 that may be closed by this pull request
@jmwright
Copy link
Member

@lorenzncode Is this ready to merge?

@lorenzncode
Copy link
Member Author

@jmwright Yes, in summary:

Provide binary STL export format option
Binary is now the default for STL export

@lorenzncode
Copy link
Member Author

also tests excluded from coverage calculation

@jmwright
Copy link
Member

@lorenzncode Thanks!

@jmwright jmwright merged commit d4cdeeb into CadQuery:master Aug 16, 2022
@lorenzncode lorenzncode deleted the stl-binary branch October 2, 2022 17:37
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.

Allow STL export in binary format in addition to ASCII
3 participants