Request: Button for combined offset operations to close shapes

Or better yet, put it under Tools as an option for Close Selected Paths.

Close Path (no tolerance) has no effect on any of these

Close Path with Tolerance rarely works for me. It will break if the vectors are created out of order, and doesn’t do what most people want which is extend/trim to intersection.

Note the below. For each figure, the top left corner is coincident endpoints.
Bottom left corner is corners crossing over, which need to Trim.
Bottom right has one vector which needs to Extend to intersect the other first, but then other vector needs to be Trimmed past the intersection after that intersection is created
Top right needs both vectors to Extend simultaneously until they intersect and stop there
Then we have similar examples, created in order but made of curves

The Join with Tolerance just doesn’t work most of the time. This seems to be due to inability to handle out-of-order vectors, but there is no control over vector order so it may be irreparable. It ended up out-of-order even when I tried to be sure it wasn’t. If anyone knows how to fix this please let me know.

Rather, Offset Shapes turns out to work with non-closed shapes, and it’s awesomely useful, but you have to pull multiple steps and adjust Offset so the gap creates a simple corner, but a large enough offset can break small or acute angle features.

The first examples:

  1. Do Offset (inward or outward does not matter, since it’s lines not a closed shape it will create both) with Delete Original.
  2. Ungroup and Delete the outer path
  3. Do Offset Outward by SAME amount with Delete Original

Then we do the same but use the outer path, in 2. Delete the inner, in 3. Offset Inward

It’s not ideal with curves, but the Join operation just isn’t reliable enough and pretty essential

Why not have an option to do all 3 ops at once?

But really, high priority here- why not fix Close Path? I’ll cover this in another post

The way to fix Close Path:

Remove any dependency on vector order

Here’s VCarve’s answer to some difficult cases. I chose close with curve as it’s easier to see what it’s doing, this is to illustrate which vectors it tries to join. But VCarve doesn’t have an automatic Extend mechanism for some odd reason, it’s manual.

What Close Path needs to do is grab one open endpoint (one that does not connect to another vector), and use the closest selected open endpoint in the selected content that can converge. If doing Extend, nonconvergent options will not be ignored and the algorithm searches for the next closest open vector. Nonconvergent vectors may be left open at the end of this operation, as it can be fixed by other methods based on what the user is thinking.

I don’t think it should matter whether a second vector only has one open endpoint but already connects directly or indirectly through the other endpoint (“C” shape). Grab one open endpoint, find the next closest.

Always try to Extend until intersect and Trim anything past the intersection first. This presumes that two open vectors actually converge, sometimes they won’t and intersection is impossible.

Close with curve, move endpoints, or straight line are other options. The only thing is, they need to prioritize finding the next open endpoint by proximity, not creation order.

Programming-wise, this can then be a difficult question as to what to do in some odd cases. Here’s what VCarve did. I chose Join with Curve as it’s more visible what it’s trying to do. Then show what the ideal should be IMHO. Of those, “E” cannot be fixed or improved via Extend, as the two vectors diverge in the open direction. But if the algorithm finds the closest open endpoint won’t converge, it will move on to the next closest open endpoint. If that happens to be the other endpoint of a vector rejected for nonconvergence, that’s fine it’s just going to reverse the direction it Extends in.

Now “D” is an interesting trouble case. The 2-point vector cannot converge with the vector with the open endpoint on bottom. But it CAN intersect with another vector, and Trim off an entire vector. IMHO that’s fine as long as the distance it uses for Extend is within the Max Join distance. If you don’t want that result you’d trim that number down and fix it with another method after the rest of the design gets fixed.

Curves are another story. AFAIK these are Bezier Curve constructs. If so, Extend should just extrapolate for t<0 and t>1 as the primary option. But straight-line should also be an option.

Some other algorithm options on the last line

“A” should actually Extend the almost-a-rectangle to the closest point, as I described, and just leave the other vector unresolved. Actually, the algorithm I just outlined would have done this, not what I drew under “Ideal Extend” which would only happen if there’s a requirement to join every open endpoint within the Max Join distance.

“H” is a troublesome corner case. I’m saying Extending the two-endpoint vector in either direction would be beyond the Max Join range. So, it can’t join this completely. “Ideal Extend” does show the one thing it can do, extend one vector in the almost-a-rectangle to intersect the two-endpoint vector. But that’s all. It can’t even do Trim because it doesn’t know which way to go.

Actually, “A” gives me pause for thought on a couple of fronts. One, it’s not just looking for the nearest endpoint, it’s the nearest intersection if it were to Extend. Second would be that the order of consideration matters, and ideally it shouldn’t. The algorithm could pick up the almost-a-rectangle first and try to find what the nearest to connect with is, but it could also pick up the two-endpoint-vector first and that would give a different result. I cannot think of a simple resolution, it could try different things and grade them against one another but that goes all Traveling Salesman real quick

Maybe those last details aren’t that important, most jobs wouldn’t get that critical with corner cases.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.