Comments (3)
I think I found that certain SVG viewers would clip geometry entirely if the stroked line was outside the viewBox and/or width/height, hence the comment:
(ptMax.x - ptMin.x) + 1, (ptMax.y - ptMin.y) + 1,
(ptMax.x - ptMin.x) + 1, (ptMax.y - ptMin.y) + 1);
// A little bit of extra space for the stroke width.
It was a long time ago, though, and I don't remember details. Vector export could presumably be changed to determine the exact bounds allowing for stroke width, but that would be more work.
And I can't immediately reproduce your 50.799999, but it doesn't surprise me; floating point math is inexact. Is the difference causing a problem for you?
from solvespace.
The 50.799999 is just of cosmetic interest, in the SVG file it actually reappears as 51.800 (round again). I don't know how much of an issue the "plus one" thing is in general, for me it matters because I'm importing the SVG into GCAM for milling (therefore I do actually need accurate origins and sizes and so can only use the manual export option to hope to preserve them) and, well, the big problem is that the SVG canvas is upside-down, with (0,0) in the top left corner, so my imported workpiece obviously jumps up a unit, "sticking" to the invisible top of the larger-than-expected box. It clearly is possible to work around this by adjusting the offset value appropriately before exporting, but IMHO it's needlessly confusing and easy to forget (and one would probably not notice a 1mm displacement until it's too late).
So, considering that manual canvas sizing can already easily screw up the canvas / viewbox size in the SVG file anyway (resulting in coordinates outside the declared box) - would it be perhaps possible to disable the "unit-adding" mechanism at least in manual canvas mode...?
from solvespace.
Seems not unreasonable, just pushed the change. Let me know if you see any trouble.
from solvespace.
Related Issues (20)
- Path to hierarchical parametric sketches HOT 14
- Please trigger a flatpak rebuild HOT 5
- I can not copy between two or more open windows/projects of Solvespace. HOT 1
- Ways to improve SolveSpace constraint Solver HOT 2
- Extrusion that includes Bezier spline behaves strangely HOT 6
- Add the option to export a specific group to the CLI
- Revolve body is always 360 degrees after changing 180 angle restriction to any value HOT 1
- Spiro splines as better bezier splines and better bezier splines with optimized parameters HOT 10
- Use 3rd degree NURBS surfaces for helix extrusions HOT 1
- Constraining entities from previous groups fails in a confusing way. [Was: Solver fails on constrain that just fixes current orientation if added after importing another object] HOT 8
- Add a clamped distance constraint HOT 3
- Naked edges with only rectangles and extrusion HOT 3
- glCreateShader fails on MacOS M1 HOT 11
- Solvespace crash on new group rotating and new group revolve... HOT 2
- "Via automated edge builds "can not be download for use HOT 2
- Document Constraint Performance/Efficiency HOT 4
- Potential solver improvements from Dune 3D HOT 1
- Font Kerning Not Working HOT 6
- "it can only be saved on the same volume." HOT 2
- "constraints are incompatible" error HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solvespace.