small adjustments in lasercheck

This commit is contained in:
Mario Voigt 2021-11-01 19:28:08 +01:00
parent 3781d3862a
commit a99ad07993

View File

@ -288,12 +288,17 @@ class LaserCheck(inkex.EffectExtension):
if style is not None: if style is not None:
stroke_width = re.search('stroke-width:(.*?)(;|$)', style) stroke_width = re.search('stroke-width:(.*?)(;|$)', style)
if stroke_width is not None: if stroke_width is not None:
strokeWidth = self.svg.unittouu(stroke_width[0].split("stroke-width:")[1].split(";")[0]) strokeWidth = stroke_width[0].split("stroke-width:")[1].split(";")[0] #possibly w/o units. could contain units from css
if strokeWidth not in strokeWidths: if strokeWidth not in strokeWidths:
strokeWidths.append(strokeWidth) strokeWidths.append(strokeWidth)
inkex.utils.debug("{} different stroke widths in total".format(len(strokeWidths))) inkex.utils.debug("{} different stroke widths in total".format(len(strokeWidths)))
for strokeWidth in strokeWidths: for strokeWidth in strokeWidths:
inkex.utils.debug("stroke width {}".format(strokeWidth)) swConverted = self.svg.uutounit(float(self.svg.unittouu(strokeWidth))) #possibly w/o units. we unify to some internal float
inkex.utils.debug("stroke width {}px ({}mm)".format(
round(self.svg.uutounit(swConverted, "px"),4),
round(self.svg.unittouu(str(swConverted) + "mm"),4)
)
)
''' '''