cadquery icon indicating copy to clipboard operation
cadquery copied to clipboard

Add option to export binary STL

Open lorenzncode opened this issue 3 years ago • 6 comments

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

lorenzncode avatar Jun 17 '22 20:06 lorenzncode

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%) :arrow_up:
cadquery/occ_impl/shapes.py 92.55% <100.00%> (+0.01%) :arrow_up:
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

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

codecov[bot] avatar Jun 18 '22 13:06 codecov[bot]

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 avatar Jul 26 '22 00:07 lorenzncode

@lorenzncode which default value did you have in mind?

adam-urbanczyk avatar Jul 29 '22 18:07 adam-urbanczyk

@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.

lorenzncode avatar Jul 29 '22 21:07 lorenzncode

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

adam-urbanczyk avatar Jul 30 '22 08:07 adam-urbanczyk

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

jmwright avatar Jul 31 '22 12:07 jmwright

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

lorenzncode avatar Aug 12 '22 16:08 lorenzncode

@lorenzncode Is this ready to merge?

jmwright avatar Aug 16 '22 10:08 jmwright

@jmwright Yes, in summary:

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

lorenzncode avatar Aug 16 '22 22:08 lorenzncode

also tests excluded from coverage calculation

lorenzncode avatar Aug 16 '22 22:08 lorenzncode

@lorenzncode Thanks!

jmwright avatar Aug 16 '22 23:08 jmwright