Random point inside SVG <path> -


the problem simple describe. have simple svg closed shape, this:

<path d="m435.95,147.99l0.33,0.49l-0.11,1.07l-0.39,0.04l-0.29,-0.15l0.21,-1.4l0.25,-0.05z"></path> 

i want draw point @ random, somewhere inside shape.

how that? hoping solution simple possible.

you use getbbox bounding box of path , generate random point in range. use elementfrompoint random point check on shape.

if elements cover path set them pointer-events="none" ignored when this.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -