GithubHelp home page GithubHelp logo

living-hinge's People

Contributors

buxtronix avatar igorangst avatar jondale avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

living-hinge's Issues

Bounding box selection incorrect

When objects are selected the script tries to fill their bounding boxes with the pattern.

That does not work correctly in Inkscape 1.2.2.


Your script converts the units using self.svg.unittouu().
However, that does not seem to be working as intended (anymore).

I am not knowledgeable with Inkscape extension programming but removing the conversion seems to work most of the time:

--- a/living_hinge.py
+++ b/living_hinge.py
@@ -471,11 +471,9 @@ class LivingHingeEffect(inkex.EffectExtension):
             for elem in self.svg.selected.values():
                 # Determine width and height based on the selected object's bounding box.
                 bbox = elem.bounding_box()
-                self.options.width = self.svg.unittouu(bbox.width)
-                self.options.height = self.svg.unittouu(bbox.height)
-                x = self.svg.unittouu(bbox.x.minimum)
-                y = self.svg.unittouu(bbox.y.minimum)
-                draw_one(x, y)
+                self.options.width = bbox.width
+                self.options.height = bbox.height
+                draw_one(bbox.x.minimum, bbox.y.minimum)

However, sometimes the pattern is drawn out of bounds. I am not sure if this is another problem due to the newer versions of Inkscape/inkex or a known problem.
See attached screenshot:

Screenshot from 2023-04-02 14-04-40

Deprecation warning in inkscape 1.1

When using the extension in inkscape 1.1, I get this message:

living_hinge.py:152: DeprecationWarning: inkex.deprecated.description -> elem.desc = value
link.description("%s hinge %s" % (self.name, self.parameter_text()))

Improve order of swatch drawing

Currently the swatch border is rendered before the pattern, which can be problematic wrt cut order.

Better to have the pattern (and hole) rendered prior to the outline/border.

Inkscape 1.1.1 (3bf5ae0d25, 2021-09-20) issues

Ahhh, I get: "C:\Users\chris\AppData\Roaming\inkscape\extensions\living_hinge.py:360: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser. You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar.
self.OptionParser.add_option(
C:\Users\chris\AppData\Roaming\inkscape\extensions\living_hinge.py:363: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser. You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar.
self.OptionParser.add_option(
C:\Users\chris\AppData\Roaming\inkscape\extensions\living_hinge.py:366: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser. You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar.
self.OptionParser.add_option(
C:\Users\chris\AppData\Roaming\inkscape\extensions\living_hinge.py:370: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser. You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar.
self.OptionParser.add_option(
C:\Users\chris\AppData\Roaming\inkscape\extensions\living_hinge.py:373: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser. You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar.
self.OptionParser.add_option(
C:\Users\chris\AppData\Roaming\inkscape\extensions\living_hinge.py:377: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser. You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar.
self.OptionParser.add_option(
C:\Users\chris\AppData\Roaming\inkscape\extensions\living_hinge.py:380: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser. You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar.
self.OptionParser.add_option(
C:\Users\chris\AppData\Roaming\inkscape\extensions\living_hinge.py:383: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser. You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar.
self.OptionParser.add_option(
C:\Users\chris\AppData\Roaming\inkscape\extensions\living_hinge.py:387: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser. You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar.
self.OptionParser.add_option(
C:\Users\chris\AppData\Roaming\inkscape\extensions\living_hinge.py:390: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser. You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar.
self.OptionParser.add_option(
C:\Users\chris\AppData\Roaming\inkscape\extensions\living_hinge.py:393: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser. You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar.
self.OptionParser.add_option(
C:\Users\chris\AppData\Roaming\inkscape\extensions\living_hinge.py:397: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser. You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar.
self.OptionParser.add_option(
C:\Users\chris\AppData\Roaming\inkscape\extensions\living_hinge.py:400: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser. You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar.
self.OptionParser.add_option(
C:\Users\chris\AppData\Roaming\inkscape\extensions\living_hinge.py:404: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser. You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar.
self.OptionParser.add_option(
C:\Users\chris\AppData\Roaming\inkscape\extensions\living_hinge.py:407: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser. You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar.
self.OptionParser.add_option(
C:\Users\chris\AppData\Roaming\inkscape\extensions\living_hinge.py:410: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser. You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar.
self.OptionParser.add_option(
C:\Users\chris\AppData\Roaming\inkscape\extensions\living_hinge.py:496: DeprecationWarning: Effect.affect is now Effect.run(). The output argument has changed.
LivingHingeEffect().affect()
C:\Users\chris\AppData\Roaming\inkscape\extensions\living_hinge.py:424: DeprecationWarning: Effect.unittouu is now a method in the SvgDocumentElement class. Use self.svg.unittouu(str) instead.
stroke_width = self.unittouu("0.2mm")
C:\Users\chris\AppData\Roaming\inkscape\extensions\living_hinge.py:415: DeprecationWarning: Effect.unittouu is now a method in the SvgDocumentElement class. Use self.svg.unittouu(str) instead.
return self.unittouu(str(value) + self.options.unit)
Select a valid pattern tab before rendering.
"

Inkscape 1.1.1 (3bf5ae0d25, 2021-09-20)

Any help out here is highly apreciated

Not working in Inkscape 1.3

Hi, to use with Inkscape 1.3 you must edit the living_hinge.inx file and remove the line "inkex.py" otherwise you get an error finding inkex.py file and a greyed out useless entry in the menu.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.