How can I obtain the vertices of a GeneralPath object? It seems like this should be possible, since the path is constructed from points (lineTo, curveTo, etc).
I’m trying to create a double[][] of point data (an array of x/y coordinates).
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can get the points back from the
PathIterator.I’m not sure what your constraints are, but if your shape always has just one closed subpath and has only straight edges (no curves) then the following will work:
If your path may contain curves, you can use the flattening version of
getPathIterator().