Comments (5)
I think the nicer solution is to add a Move object and a Close object. Then you can still define the subpaths as series of PathSegments which is what you should want since that's actually how SVG does it. See: https://github.com/meerk40t/svg.elements for my implementation. Also the author of svg.path did it that way at my suggestion. Basically rather than subpaths you just define Move and Close as objects. Then subpaths come naturally from that. And it doesn't do weird stuff when you reverse it or whatever.
from svgpathtools.
It looks good, I'll give it a try in the next couple of weeks. And hopefully the new features will get merged to the project.
from svgpathtools.
Although there are some obvious subpath friendly operations like reverse just that subpath that are helpful with the other implementation which is why svg.elements
has a Subpath class that works as a window into a proper class to let you perform some of these operations that make mores sense as subpaths.
from svgpathtools.
When you insert a segment into a path, how does it know on which side of the Move object to be inserted?
Anyway, I've given up the idea of a pull request. I'm happily using/maintaining my fork on my own. If ever somebody wants it just give me a shout & I'll send you the latest version.
By the way, YANG2020 folks! Let's get this man to the white house :)
from svgpathtools.
@vistuleB The segment you add inserts where you told it to insert.
>>> from svg.elements import *
>>> p = Path("M0,0L40,40ZM17,4 v 20 z")
>>> print(p)
M 0,0 L 40,40 Z M 17,4 L 17,24 Z
>>> p.insert(3,Line((2,2),(25,25)))
>>> print(p)
M 0,0 L 40,40 Z L 25,25 M 17,4 L 17,24 Z
It's up on pypi so pip install svg.elements
if you'd want to play with it.
Some of your own fork actually is sort of needed. I am certainly going to look into your implementations of supports <defs>
and <use>
supports <text>
and <textPath>
. I haven't gotten around to correcting those in my fork. I'm going around looking at the various versions and features people added and checking how they are used.
from svgpathtools.
Related Issues (20)
- Faster Approximate Intersections Code HOT 4
- Converting from CubicBezier to Poly1D doesnt work correctly
- Is `svgpathtools` officially dead? HOT 1
- Cannot get the intersection between two Bezier Curves HOT 3
- closed paths d() method does not write a final "z" HOT 1
- isclosed() suffers from rounding errors when reading paths HOT 3
- negative scale breaks arc sweep
- Deprecated escape sequences
- bpoints2bezier() does not always return a value HOT 4
- Path.point() might not return a value due to numerical errors HOT 2
- Path parsing floating point issue HOT 2
- Crash if Bad Polyline HOT 2
- Provide Access to Parents and Other Tags (diff)
- Order is Not Preserved HOT 1
- Intersection is not counted properly HOT 1
- Any plan for path boolean operations and path simplification? HOT 1
- baseunit ignored in disvg when viewbox parameter is provided
- Create new svg from code
- Reading in dpaths introduces a lot of floating point approximation noise
- ARC Start and End Angles
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 svgpathtools.