buxtronix / living-hinge Goto Github PK
View Code? Open in Web Editor NEWInkscape plugin to create lasercut living hinges
License: GNU General Public License v3.0
Inkscape plugin to create lasercut living hinges
License: GNU General Public License v3.0
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:
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()))
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.
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.