Giter Site home page Giter Site logo

Comments (5)

tatarize avatar tatarize commented on September 12, 2024 1

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.

 avatar commented on September 12, 2024

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.

tatarize avatar tatarize commented on September 12, 2024

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.

vistuleB avatar vistuleB commented on September 12, 2024

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.

tatarize avatar tatarize commented on September 12, 2024

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.