fsmMLK / inkscapeDimensions

Inkscape extension to assist creating dimension annotations.
GNU General Public License v3.0
64 stars 10 forks source link

Error using angular dimension, message using linear #18

Open huanmario7 opened 2 years ago

huanmario7 commented 2 years ago

Started getting this error while trying to apply angular dimension

Traceback (most recent call last): File "C:\Users\buszt\AppData\Roaming\inkscape\extensions\inkscapeDimensions\dimensions.py", line 896, in <module> dimension.run() File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\base.py", line 231, in run self.save_raw(self.effect()) File "C:\Users\buszt\AppData\Roaming\inkscape\extensions\inkscapeDimensions\dimensions.py", line 246, in effect self.drawAngDim(root_layer, element, label='Dim', invertAngle=so.ANGinvertAngle, textType=so.AngContents_subtab, File "C:\Users\buszt\AppData\Roaming\inkscape\extensions\inkscapeDimensions\dimensions.py", line 334, in drawAngDim if auxElemType == '3points': UnboundLocalError: local variable 'auxElemType' referenced before assignment

Also this message while using linear dimension, though it creates the dimension `:671: ImportWarning: DynamicImporter.exec_module() not found; falling back to load_module()

:671: ImportWarning: DynamicImporter.exec_module() not found; falling back to load_module() C:\Users\buszt\AppData\Roaming\inkscape\extensions\textext\base.py:415: DeprecationWarning: inkex.deprecated.main.transform_imul -> Use @= operator instead full_layer_transform *= layer.transform C:\Users\buszt\AppData\Roaming\inkscape\extensions\textext\base.py:419: DeprecationWarning: inkex.deprecated.main.transform_mul -> Use @ operator instead tt_node.transform = (-full_layer_transform * # map to view coordinate system`
fsmMLK commented 2 years ago

The first error appears when your line segment contains a number of vertices different than 3 or 4.

The second warning is related to textext extension. I have no control over it, but you can manually fix that by going to base.py, line 419 and replace tt.node.transform = ( [LOTS of ARGUMENTS ]) by

                 tt_node.transform = (-full_layer_transform @               # map to view coordinate system
                                     Transform(translate=view_center) @    # place at view center
                                     Transform(scale=user_scale_factor) @  # scale
                                     Transform(translate=-node_center) @   # place node at origin
                                     tt_node.transform                     # use original node transform
                                     )