- fixed ParseFont such that the output of the Text Plugin in the Geometry Editor can now be painted using the Paint Plugin
This commit is contained in:
committed by
Marius Stanciu
parent
cc8cf4ecbb
commit
61d19e0748
@@ -14,6 +14,7 @@ CHANGELOG for FlatCAM beta
|
|||||||
- created a new category in Preferences where only the Engraving Related preferences are located
|
- created a new category in Preferences where only the Engraving Related preferences are located
|
||||||
- added a new set of options in the Preferences for the Milling Plugin by taking them out of the Geometry section
|
- added a new set of options in the Preferences for the Milling Plugin by taking them out of the Geometry section
|
||||||
- fixed an error in the Subtract Plugin when working on Geometry objects
|
- fixed an error in the Subtract Plugin when working on Geometry objects
|
||||||
|
- fixed ParseFont such that the output of the Text Plugin in the Geometry Editor can now be painted using the Paint Plugin
|
||||||
|
|
||||||
22.03.2021
|
22.03.2021
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,8 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import glob
|
import glob
|
||||||
|
|
||||||
from shapely.geometry import Polygon
|
from shapely.geometry import Polygon, MultiPolygon
|
||||||
from shapely.affinity import translate, scale
|
from shapely.affinity import translate, scale
|
||||||
from shapely.geometry import MultiPolygon
|
|
||||||
|
|
||||||
import freetype as ft
|
import freetype as ft
|
||||||
from fontTools import ttLib
|
from fontTools import ttLib
|
||||||
@@ -351,4 +350,15 @@ class ParseFont:
|
|||||||
else:
|
else:
|
||||||
scaled_path.append(scale(item, 0.00031570066, 0.00031570066, origin=(coordx, coordy)))
|
scaled_path.append(scale(item, 0.00031570066, 0.00031570066, origin=(coordx, coordy)))
|
||||||
|
|
||||||
return MultiPolygon(scaled_path)
|
# determine if some polygons are completely inside the other
|
||||||
|
interiors = []
|
||||||
|
for idx, poly in enumerate(scaled_path):
|
||||||
|
try:
|
||||||
|
if scaled_path[idx + 1].within(poly):
|
||||||
|
interiors.append(scaled_path[idx + 1])
|
||||||
|
except IndexError:
|
||||||
|
break
|
||||||
|
|
||||||
|
ret_geo = MultiPolygon([x for x in scaled_path if x not in interiors]).difference(MultiPolygon(interiors))
|
||||||
|
|
||||||
|
return ret_geo
|
||||||
|
|||||||
Reference in New Issue
Block a user