-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to know the m or M point of path from all of points? #1135
Comments
If this is a one off, can't you take before the "m" (eg using some regex), and do Raphael.getTotalLength(firstPart) looping until the end of that ? |
Thank you very much for your idea, but if there are multiple m after M, then even if the regular expression can get each segment, then the points of the M segment is correct, and the following m is relative coordinates, so the point cannot be obtained correctly positions. |
I think in the case if there are multiple "m"s then you need to describe logically where you would make the cutoff. Typically if you can describe something clearly, you can program it. For example, you may be able to use something like getSubpath(from,to) by traversing the path from the start to an "m" grab it's length, move between the m's and repeat. I am assuming getSubpath returns and absolute rather than a relative path here. There is also Raphael.parsePathString(pathstring), but that could help. It may also be useful to describe the overall aim with the points, as there may be a slightly different solution that gives someone some ideas. |
Hello, I have an svg picture like this, with
M
andm
in the path. I can get all the points by callingRaphael.getTotalLength(path)
, but how can I know from which point is the path behindm
.I want to know all the absolute coordinate points of the inner border of the svg, so that I can get a data format similar to the following
[[points of the outer border], [points of the inner border]]
.Untitled-2.svg.zip
This is how I achieved it. I can get all the points, but I can’t distinguish which are the points of the inner frame and which are the points of the outer frame.
I really look forward to your answers, thank you!
The text was updated successfully, but these errors were encountered: