shape paint and gaps



  • Hi,

    I'm trying to make a closed shape from an open path. I need to do this because I'm cleaning up line art in a vector rendering of a 3D object exported by a CAD program. The CAD program doesn't generate closed shapes, but I need closed shapes to do fills / masks / booleans.

    I tried Shape Builder and Shape Paint, but both seem to fail if there is even a tiny gap. Here's what I'm seeing with Shape Paint:

    https://www.dropbox.com/s/wavgznlcihblad9/shape_paint_gap.gif?dl=0

    I tried changing the Shape Paint Options "Detect Gaps", "Matching Gap", and "Close Shapes", but don't see any difference. I also tried increasing "Gaps" and "Close" when using Shape Builder, but also can't get that to work if there's a gap.

    How should I make a closed path from some overlapping paths that aren't connected and/or have tiny gaps?



  • @ti Welcome to VectorStyler!

    It's not exactly clear from the video but to me it looks like those are not closed shapes, which is why Shape Builder can't work.
    But since you mention this is a PDF exported from a CAD app, they are most definitely shapes exploded into separate paths.

    You should first select adjacent lines and join them with Cmd-J, then if the resulting closed shapes still need
    the Shape Builder tool, use that.

    If this doesn't help, upload the file to DB (with this part only).



  • Thanks for the warm welcome @b77!

    Here's something like what I showed in the GIF:

    https://www.dropbox.com/s/0jw18rf2nlz6w43/shape_paint_gap.vstyler?dl=0

    which can indeed be fixed with Cmd-J, since it's just a simple gap and so the ends on either side of the gap get joined into a continuous path.

    But, that doesn't work on a CAD rendering:

    https://www.dropbox.com/s/ohbn6xy97mg463t/CAD_export_after_Join.vstyler?dl=0

    In this rendering, my goal is to make a closed path from every region that looks closed.



  • @ti With the first file you need to separate the two rectangles from each other, and close the one that
    has a gap (with Cmd-J), then Shape Builder (and Shape Paint) works: https://recordit.co/to8X3hz6OD

    Regarding the second file:
    Separation of the individual lines is needed here as well (right-click > Convert / Expand > Expand Appearance),
    but you need to create closed shapes from the separate one-segment paths.

    To do that, you'll need to select the lines that make the drawers two by two, reverse the direction of
    one line (Ctrl-I) then hit Cmd-J two times.

    Then select the other lines that make the sides of the object and join them into closed shapes.

    I don't know any faster method… except maybe the file can be exported from the CAD app with
    different settings?



  • @ti OK, I was wrong. There is a faster way that feels like cheating: https://recordit.co/w8z5qF24oG 🙂



  • Thanks @b77 for your super-fast help! I’ll give that a try tomorrow.


  • administrators

    @ti Looks like this kind of gaps are not handled correctly. Added this to the backlog.



  • @VectorStyler Thanks for confirming there's a bug. Another issue that might be related is that the "Close Shapes" value in the "Shape Paint Options" dialog does not persist. It gets reset back to the same very small value whenever the dialog is closed and re-opened.

    @b77 That's a slick workaround you came up with!