3

I have created below SVG using svg.js 2.7

Now I want to draw all possible polygons made based on lines intersection with other line and outer rectangle.

I have got all intersection points for lines and lines intersection with the outer rectangle using svg.js plugin svg-intersections-js

My requirement is, I want to display a hover effect for every possible polygon.

Edit 1: Line position and alignment are dynamic.

Is it possible?

enter image description here

  • Most likely, the answer to your question is `yes`. If you also want to know how, you have better chances by providing the code of the svg and your attempt at a solution. You can use the snippet tool for that. – vqf Jul 24 '20 at 09:04
  • @vqf, I have svg with an id for lines and outer rectangle, Can you let me know how can I identify the polygons forming by lines. Is there any javascript library available? – Nikunj Shekhada Jul 24 '20 at 12:37
  • What's stops you from just creating all the polygon elements and adding a css hover? – Fuzzyma Jul 24 '20 at 14:20
  • @Fuzzyma, these lines are not static, it is draggable and the user can also change its alignment, so need to calculate all dynamically. – Nikunj Shekhada Jul 24 '20 at 14:33
  • Is it possible to draw multiple polygons based on dynamic intersection points? – Nikunj Shekhada Jul 28 '20 at 05:23

0 Answers0