canvas - How to get path of Bezier curves with coordinates of decimal value -



canvas - How to get path of Bezier curves with coordinates of decimal value -

i need path of vector shape transformed bezier curves. have 512x512 px canvas 350x350 px letter "r" in middle. need export somehow coordinates of points of bezier curves.

so have canvas coordinates 0,0 511,511 , shape in it. but, when save *.svg in path illustration (m 256.124 373.811 l-85.544 -46.3289 c -21.8516,33.0922 -34.017,54.9238).

i understand svg coordinate scheme differs carthesian system. real numbers close wanted decimal numbers why there negative numbers?

but need coordinates of pixels in decimal format , range 0,0 511,511. illustration (m 256 377 c 23 532 123 43 123 352)

is there way path that?

i decoded path in .svg coreldraw.

firstly, corel , graphic editors have carthesian coordinate scheme (point [0,0] in bottom-left corner). on other hand, svg has different scheme start point in top-left corner. this, when have canvas size 512x512 px , place mouse on it, see point coordinates illustration [128,312] in svg path point [128,200]. see pictures below.

next, path continues l-89,8385 -46,3289 c-22,9477,33,0922 -35,7249,54,9238 -38,4096,65,4971. mean line point, 89.84 px smaller on x-axis , 46.33 px smaller on y-axis. deduct numbers coordinates of current lastly point.

lastly, c mean curve to, cubic beziƩr curve. quite strange. -22,9477,33,0922 means -22.95 px on x-axis , +33.09 px on y-axis command point 1. mentioned computed lastly point on lastly curve. next -35,7249,54,9238 command point 2 computed lastly point of lastly curve not command point 1!! , -38,4096,65,4971 belongs endpoint of current curve. maybe noticed start point of curve not mentioned. start point of course of study end point of lastly curve/line/...

to ending, can see in svg path -1,95237,7,5638 -6,18545,13,9241 -12,7772,19,0808 -6,59057,5,07167 -11,3103,7,65002. these next curves. there no letter l,c,m or other curves because there c , no other letter point. need 3 numbers -1,95237,7,5638 next command point 1, command point 2 , end point.

hope help somebody.

canvas graphics coordinates bezier-curve coreldraw

Comments

Popular posts from this blog

php - Edges appear in image after resizing -

ios8 - iOS custom keyboard - preserve state between appearances -

Delphi change the assembly code of a running process -