Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

260
Views
SVG path intersections respecting stroke width and stroke fill

I recently asked another question about SVG intersection here, to which I got some good answers. But I am now looking for a method to find if two paths intersect that respects stroke fill, and stroke size.

In my example, I am making an application for handwriting. I have an erase tool that can change its stroke width.

example 1: The red line in this photo represents the eraser, and the black line represents a stroke i want to erase. using the path intersection library and the methods from here (line intersects with absolute path) the intersection is not detected. Is there an easy way to do this?

example 2: I have a scissor tool in my application. The highlighted blue area intersects with the inner path because the fill overlaps with it. How do I determine if this type of event occurs? For another example, I also consider the below an intersection: example 3

My example code is very simple. I just have an SVG element with N paths inside of it. I want to have a script such that I can loop through all the paths and determine if any 2 intersect. If possible, I want to attach an event listener to each path to determine when it intersects with another. Is there an easy algorithm or solution for this?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!