Seamless connection with SVG

I have a random set of dots and you want to create a smooth svg shape using raphaeljs. To connect the dots, I use catmull-rom splicing. The problem is that the point where the path is closed is not smooth.

This is an example of a path from my projcet:

M125,275R 125,325 175,325 225,325 275,325 225,275 175,275 125,275Z

I also created jsfiddle: http://jsfiddle.net/ry8kT/

Is it possible to do this using catmule curves? If not, can you give an example of how to get a fully smoothed shape?

Thanks a lot in advance, MacFarlane

+5
source share
2 answers

125 275 125 275 . "Z" , , . , , , .

:

M125,275R 125,325 175,325 225,325 275,325 225,275 175,275Z
+3

:

catmull rom . , , , , .

:

: , moveTo

M point1.x,point1.y M 

.

, , - :

mid.x,mid.y C next.x,next.y

M A B, :

M.x = (A.x-B.x)/2 + B.x
M.y = (A.y-B.y)/2 + B.y

, - :

C first.x,first.y mid.x, mid.y

, Z, :

Z

- moveTo .

, jsfiddle: http://jsfiddle.net/ry8kT/1/

+3

All Articles