Page 1 of 1

Union of curves

Posted: Wed Feb 24, 2021 1:53 pm
by PJMiller
Sometimes when trying to merge contours I get an error message.


Re: Union of curves

Posted: Wed Feb 24, 2021 2:57 pm
by Bhikkhu Pesala
I haven't seen that one before, but the solution is to move a node or two by a few pixels and try again.

Re: Union of curves

Posted: Wed Feb 24, 2021 3:34 pm
by Erwin Denissen
Do send us the font project, as that is the only way we can reproduce the issue and see if we can fix it.

Re: Union of curves

Posted: Thu Feb 25, 2021 1:35 am
by PJMiller
I have attached the font file but I don't know how useful it will be to you. It has been modified and saved many times since that error occurred.

The error seems to happen infrequently and randomly. Sometimes it is the illegal midpoint call, sometimes the program just says this is too complex and doesn't do the union but there is another error message which happens extremely infrequently and I will take a note of it the next time it happens, but don't hold your breath.

This error happened when I was sticking a tail on a copy of 'O' to make it into a 'Q', it was what I thought was a simple union with two points of intersection and a small crescent of overlap so I thought there wouldn't be any problem. The tail had a straight path within the 'O' and the 'O' had a curved path within the tail, there were only two crossover points. Both contours were simple contours not composites.

As Bhikkhu Pesala said these problems can often be solved by moving one or other of the contours or by reversing their direction (and then reversing them back once the union is done). But this one didn't respond to either of those solutions so I moved the tail down by 20 steps so there was no intersection and placed an overlapping rectangle between them. Once the union was done I moved the tail up by 20 steps and cleaned up the resultant mess of interior points.

The union function seems to have most problems when two contours follow the same curved path. If the coincident path is along a straight line then union usually has no problems. If two shapes overlap but the paths cross only at two points then there is usually no problem, which is why this error was a surprise.

If you need any more information just ask.

Re: Union of curves

Posted: Thu Feb 25, 2021 11:57 am
by Erwin Denissen
Thank you for the project, but we need a clear reproducible example. So let us know if it happens again.

Re: Union of curves

Posted: Thu Feb 25, 2021 1:10 pm
by PJMiller
Sorry I wasn't much help.

It may seem like a lot of work but you could get the program to log errors like this either in the project file or in a separate log file stored somewhere. Then when the program generates an error message it would log the error along with any diagnostic information you think appropriate and you could ask the user to upload the error log or the project file (depending on where you store it).

I'm sure you have already thought of this.

It might be an idea for the beta test versions at least.