small updates

This commit is contained in:
Mario Voigt 2021-04-04 01:51:59 +02:00
parent 3769e4d914
commit 1a921db33c
49 changed files with 52 additions and 52 deletions

View File

@ -432,7 +432,7 @@ class LineGeneratorForHorizontalCards(LineGeneratorBase):
return lines
class FoldedCardLayoutGuidesEffect(inkex.Effect):
class FoldedCardLayoutGuidesEffect(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)

View File

@ -40,7 +40,7 @@ def pts2curve(cplxs):
pth = [ '%.2f, %.2f '%z for z in data]
return 'M '+ ''.join(pth)
class AffineTorus(inkex.Effect): # choose a better name
class AffineSpirals(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
@ -96,4 +96,4 @@ class AffineTorus(inkex.Effect): # choose a better name
etree.SubElement(topgroup, inkex.addNS('path','svg'), curve_attribs)
if __name__ == '__main__':
AffineTorus().run()
AffineSpirals().run()

View File

@ -239,7 +239,7 @@ def projection(path_object,coords):
def complex2tulpe(complexNb):
return (complexNb.real,complexNb.imag)
'''
class AnotherPerspective(inkex.Effect):
class AnotherPerspective(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)

View File

@ -17,7 +17,7 @@ import inkex
from lxml import etree
from math import cos, sin, pi, log, sqrt
class Archimedes(inkex.Effect):
class Archimedes(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument('--r', type = int, default = '50')

View File

@ -17,7 +17,7 @@ element.attrib.pop("{http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd}absref",
import inkex
import sys
class AbsrefRemover(inkex.Effect):
class AbsrefRemover(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument("-a", "--removeAbsref", type=inkex.Boolean, default=True, help="Remove sodipodi:absref")

View File

@ -3,7 +3,7 @@
import inkex
import sys
class AttribEditor(inkex.Effect):
class AttribEditor(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument("-a", "--attributeName", help="attribute name to set")

View File

@ -2,7 +2,7 @@
import inkex
class AttribImport(inkex.Effect):
class AttribImport(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument("--data", default="", help="data file")

View File

@ -69,7 +69,7 @@ import sys
import ffgeom
class BezierEnvelope(inkex.Effect):
class BezierEnvelope(inkex.EffectExtension):
segmentTypes = ["move","line","quad","cubic","close"]

View File

@ -8,7 +8,7 @@ from simplestyle import *
import random
from lxml import etree
class blobsEffect(inkex.Effect):
class blobsEffect(inkex.EffectExtension):
"""
Creates a random blob from a convex hull over n points.
The expected degree of the polygon is sqrt(n). The corners

View File

@ -56,7 +56,7 @@ class bluePrintMakerData():
self.allowed_ids.append(current_id)
self.allowed_nodes.append(node)
class bluePrintMaker(inkex.Effect):
class bluePrintMaker(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)

View File

@ -4,7 +4,7 @@ import inkex
import math
from lxml import etree
class DrawBBoxes(inkex.Effect):
class DrawBBoxes(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument('--offset', type=float, default=0.0, help='Offset from object (all directions)')

View File

@ -38,7 +38,7 @@ import re
import inkex
from lxml import etree
class BouwkampCodeExtension(inkex.Effect):
class BouwkampCodeExtension(inkex.EffectExtension):
"""
This Inkscape extension allows you to generate squared squares and squared rectangles from
Bouwkamp codes and table codes.

View File

@ -34,7 +34,7 @@ def punkte_erstellen(punkte, x, y):
###Schreibt die aktuellen Koordinaten in die Punkteliste
punkte.append((x, y))
class Dose(inkex.Effect):
class Dose(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument("--height", type=int, default = 50, help="Höhe der Dose")

View File

@ -36,7 +36,7 @@ from inkex.paths import CubicSuperPath, Path
from optparse import SUPPRESS_HELP
debug = False
class ChainPaths(inkex.Effect):
class ChainPaths(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)

View File

@ -61,7 +61,7 @@ def draw_grid(x, y, rows, cols, size, color1, color2, parent):
id_ = 'cell{0}x{1}'.format(col, row)
draw_square(x + col * size, y + row * size, size, size, color, group, id_)
class Checkerboard(inkex.Effect):
class Checkerboard(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument("--tab")

View File

@ -75,7 +75,7 @@ global /inxGen/ =1 and run the file stand-alone.
- AK Sept 2018
"""
class noiseEffect(inkex.Effect):
class noiseEffect(inkex.EffectExtension):
"""
Creates visual noise. 3 kinds: Scratches, chips, specks.
50, 100, 100 instances are predefined. These are chosen

View File

@ -21,7 +21,7 @@ Based on coloreffect.py by Jos Hirth and Aaron C. Spike
import inkex
class Cleanup(inkex.Effect):
class Cleanup(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument("--stroke_width", type=float, default=0.1, help="Stroke width")

View File

@ -4,7 +4,7 @@ import math
import inkex
from lxml import etree
class clonesPerspectiveEffect(inkex.Effect):
class clonesPerspectiveEffect(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument('--num', type = int, default = 5, help = 'Drag out center of rotation before calling')

View File

@ -28,7 +28,7 @@ import inkex
import re
from inkex.paths import Path
class CloseCurves(inkex.Effect):
class CloseCurves(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
def effect(self):

View File

@ -32,7 +32,7 @@ import sys
import re
from lxml import etree
class ReplaceColorAlpha(inkex.Effect):
class ReplaceColorAlpha(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument("--from_color", default="000000", help="Replace color")

View File

@ -225,7 +225,7 @@ def gen_cercle(diametre, nombre_pas, epaisseur, xOffset, yOffset, parent):
index_pas += 1
path.GenPath()
class ConicalBox(inkex.Effect):
class ConicalBox(inkex.EffectExtension):
"""
Creates a new layer with the drawings for a parametrically generaded box.
"""

View File

@ -15,7 +15,7 @@ License: GNU GPL v3
import inkex
from inkex.paths import Path
class ConvertToPolylines(inkex.Effect):
class ConvertToPolylines(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)

View File

@ -57,7 +57,7 @@ def qhull(sample):
else:
return sample
class ConvexHull(inkex.Effect):
class ConvexHull(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.paths = {}

View File

@ -535,7 +535,7 @@ class MatcboxDrawer(BoxBase):
else:
self._CreateRectangleInMillimetres(self.Height, fudgeDepth, col5, row3)
class TuckboxCreateEffect(inkex.Effect):
class TuckboxCreateEffect(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument('-t', '--type', type = str, dest = 'BoxType')

View File

@ -30,7 +30,7 @@ def contains(outer, inner):
inner.br.x <= outer.br.x and inner.br.y <= outer.br.y
class DeleteAboveEffect(inkex.Effect):
class DeleteAboveEffect(inkex.EffectExtension):
""" Delete the selected node and everything above it """
node_info = None

View File

@ -28,7 +28,7 @@ import sys
from inkex.paths import Path
class DestructiveClip(inkex.Effect):
class DestructiveClip(inkex.EffectExtension):
def __init__(self):
self.tolerance = 0.0001 # arbitrary fudge factor

View File

@ -40,7 +40,7 @@ def rotate(tangentvec, point):
return 'rotate(' + str(angle/np.pi*180) + ',' + str(point[0]) + ',' + str(point[1]) + ')'
class Dimensioning(inkex.Effect):
class Dimensioning(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
# the options given in the dialouge

View File

@ -4,7 +4,7 @@ import inkex
from inkex import bezier
from inkex.paths import Path, CubicSuperPath
class DistortionExtension(inkex.Effect):
class DistortionExtension(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument("--lambda_coef", type=float, default=-5.0, help="command line help")

View File

@ -24,7 +24,7 @@ Foundation, Inc., 51 Fraanklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import inkex
class Pathpoints2Dots(inkex.Effect):
class Pathpoints2Dots(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument("--tab")

View File

@ -4,7 +4,7 @@ import inkex
from inkex.paths import Path
from inkex import Circle
class StartEndPoints(inkex.Effect):
class StartEndPoints(inkex.EffectExtension):
def drawCircle(self, group, color, point):
style = inkex.Style({'stroke': 'none', 'fill': color})

View File

@ -97,7 +97,7 @@ def draw_SVG_rect(x, y, w, h, c, t, fill, parent):
etree.SubElement(parent, inkex.addNS('rect', 'svg'), rect_attribs)
class Maze(inkex.Effect):
class Maze(inkex.EffectExtension):
"""
Each cell in the maze is represented using 9 bits:

View File

@ -249,7 +249,7 @@ def drawSine(cycles=8, rn=0, rm=0, nPoints=50, offset=None,
return path_data, path_desc
class SpiroSine(inkex.Effect):
class SpiroSine(inkex.EffectExtension):
nsURI = 'http://sample.com/ns'
nsPrefix = 'doof'

View File

@ -88,7 +88,7 @@ def distanceSquared(p1, p2):
return dx * dx + dy * dy
class Twist(inkex.Effect):
class Twist(inkex.EffectExtension):
def __init__(self):

View File

@ -31,7 +31,7 @@ from copy import deepcopy
import math
from math import sqrt
class EllipseSolveEffect(inkex.Effect):
class EllipseSolveEffect(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)

View File

@ -67,7 +67,7 @@ class inkcape_polar:
line_attribs = {'style': objStyle, 'd': self.Path}
etree.SubElement(self.group, inkex.addNS('path', 'svg'), line_attribs)
class EllConicalBox(inkex.Effect):
class EllConicalBox(inkex.EffectExtension):
"""
Creates a new layer with the drawings for a parametrically generaded box.
"""

View File

@ -32,7 +32,7 @@ import inkex
import sys
from lxml import etree
class EraserLayer(inkex.Effect):
class EraserLayer(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)

View File

@ -6,7 +6,7 @@ import math
import inkex
from inkex.paths import CubicSuperPath
class TransformExponential(inkex.Effect):
class TransformExponential(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
#self.arg_parser.add_argument('-a', '--axis', default='x', help='distortion axis. Valid values are "x", "y", or "xy". Default is "x"')

View File

@ -24,7 +24,7 @@ def warn(*args, **kwargs):
import warnings
warnings.warn = warn
class ExportXY(inkex.Effect):
class ExportXY(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
def effect(self):

View File

@ -63,7 +63,7 @@ def drawKthCircle(k,firstRadius,lastRadius,numNodes,spreadFactor,parent):
draw_SVG_ellipse(nodeRadiusTxt,nodeRadiusTxt,x,y,parent)
class FibonacciSpiral(inkex.Effect):
class FibonacciSpiral(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument("-f", "--FirstRadius", type=int, default="5", help="The radius of the first layer of circles in pixels.")

View File

@ -13,7 +13,7 @@
import inkex
from lxml import etree
def recup(selection,attrib):
def recup(selection, attrib):
l = []
for i in selection:
selec = i
@ -21,7 +21,7 @@ def recup(selection,attrib):
l.append(valr)
return l
def generCircle(y,x,r):
def generCircle(y, x, r):
circle = etree.Element('{http://www.w3.org/2000/svg}circle')
circle.set('cy',str(y))
circle.set('cx',str(x))
@ -36,7 +36,7 @@ def toFloat(l):
l[i] = float(l[i])
return l
class Circle(inkex.Effect):
class Circle(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument('--radius', type = float, default = 3.0, help = 'Radius to enter')

View File

@ -158,7 +158,7 @@ def d_str(self, useSandT=False, use_closed_attrib=False, rel=False):
s = ' '.join(parts)
return s if not rel else s.lower()
class FilletChamfer(inkex.Effect):
class FilletChamfer(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument("-t", "--fillet_type", default="fillet", help="Selects whether using fillet or chamfer")

View File

@ -31,7 +31,7 @@ import inkex
import sys
import re
class FilterAndLiveEffectsLayer(inkex.Effect):
class FilterAndLiveEffectsLayer(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)

View File

@ -12,7 +12,7 @@ from inkex.paths import Path
import sys
def pout(t): sys.exit((gettext.gettext(t)))
class root(inkex.Effect):
class root(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)

View File

@ -111,7 +111,7 @@ class Fretboard:
return hline_cross_path, vline_cross_path
class Inxfb(inkex.Effect):
class Inxfb(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument("-s", "--scale", default="25in", help="The fingerboard scalelenght")

View File

@ -346,7 +346,7 @@ def generate_spokes_path(root_radius, spoke_width, spoke_count, mount_radius, mo
return (path, messages)
class Gears(inkex.Effect):
class Gears(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
# an alternate way to get debug info:

View File

@ -108,7 +108,7 @@ def draw_ellipse_segment_rotated(cx,cy,rx,ry, width, fill, name, parent, rotatio
etree.SubElement(parent, inkex.addNS('path','svg'), circle_attribs)
class Globe(inkex.Effect):
class Globe(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument("--longitudeLineCount", type=int, default=15, help="Number of longitude lines")

View File

@ -49,7 +49,7 @@ def colorString(pickerColor):
longcolor = longcolor & 0xFFFFFFFF
return '#' + format(longcolor >> 8, '06X')
class Grid_Perspective(inkex.Effect):
class Grid_Perspective(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument("--size_unit", default="", help="Units for geometry")

View File

@ -29,7 +29,7 @@ from lxml import etree
def printDebug(string):
inkex.errormsg(string)
class GridStrip_Creator(inkex.Effect):
class GridStrip_Creator(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)

View File

@ -24,7 +24,7 @@
import inkex
class GroupToLayerEffect(inkex.Effect):
class GroupToLayerEffect(inkex.EffectExtension):
def __init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument('-d', '--depth', type = int, default = 1, help = 'Convert nested group up to DEPTH layers deep')