cadquery
cadquery copied to clipboard
[SVG] The user should be able to provide the units of measurement for an svg
Closes: #1323
CC: @voneiden
How does this relate to this existing draft PR?
Codecov Report
Merging #1325 (c85154e) into master (3b9ead1) will decrease coverage by
0.11%. The diff coverage is100.00%.
:exclamation: Current head c85154e differs from pull request most recent head f63eccf. Consider uploading reports for the commit f63eccf to get more accurate results
@@ Coverage Diff @@
## master #1325 +/- ##
==========================================
- Coverage 94.24% 94.14% -0.11%
==========================================
Files 26 26
Lines 5495 5485 -10
Branches 932 929 -3
==========================================
- Hits 5179 5164 -15
- Misses 187 189 +2
- Partials 129 132 +3
| Impacted Files | Coverage Δ | |
|---|---|---|
| cadquery/occ_impl/exporters/svg.py | 91.81% <100.00%> (-4.85%) |
:arrow_down: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
I wasn't actually aware of that PR @jmwright
Since this is such a small and straightforward change should we get this merged? @voneiden, @jmwright
@lorenzncode what do you think? Do you want to finish your PR first?
I find this PR breaks SVG export with exporters.export. For example in the following width is not respected.
cq.exporters.export(result, "out.svg", opt={"width":100})
This PR adds a units parameter but I don't see where the units are put to use. In #1317 it looks like the idea is to influence scaling.
I'd also like to have optional control of the scale and that is one of the features of #1277.
Right now this has nothing to do with scaling. uom is used internally to set the scaling factor. What I changed here is the ability of the user to explicitly set the unit of measure instead of the current heuristic which works like this: <0.1 must be inches and >10 must be millimeter. I am preparing a separate PR for the scaling changing for which I will be taking a look at your PR to combine them @lorenzncode