Glyphs-Scripts icon indicating copy to clipboard operation
Glyphs-Scripts copied to clipboard

Interpolation > Short Segment Finder for G3

Open mekkablue opened this issue 3 years ago • 2 comments

Throws a lot of errors like this in G3:

😬 ERROR in germandbls (layer: Black): Possible single-node path.
SEGMENT: "C: |(307,27)--(340,-2), (401,-16)--(483,-16)| >176,-43)0 obj:2"
SEGMENT LENGTH: 4
Traceback (most recent call last):
  File "Short Segment Finder.py", line 138, in approxLengthOfSegment
    p0,p1,p2,p3 = [p.pointValue() for p in segment]
  File "Short Segment Finder.py", line 138, in <listcomp>
    p0,p1,p2,p3 = [p.pointValue() for p in segment]
AttributeError: 'NSPoint' object has no attribute 'pointValue'

mekkablue avatar May 04 '21 07:05 mekkablue

Path.segments did return a list of NSArrays that contained NSValues. In G3 those segments are GSPathSegment that contains the NSPoints directly. So remove all .pointValue().

schriftgestalt avatar May 04 '21 08:05 schriftgestalt

removed, but unfortunately, another very weird thing happened: at least on my copy of G3 it freezes the app. I've made debugging checkpoints in the code (in code they are print statements) and tried to find any place that could cause the freeze.

So far no clue Short Segment Finder.py.zip

RafalBuchner avatar May 04 '21 11:05 RafalBuchner