svg2gcode 4.1.0__tar.gz → 4.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/PKG-INFO +3 -3
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/README.md +1 -1
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/pyproject.toml +1 -1
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/__init__.py +1 -1
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_examples/nonzero_evenodd.svg +1 -1
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/compiler/_compiler.py +15 -14
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/geometry/_line_segment_chain.py +8 -8
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/LICENSE +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/__main__.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_examples/README.md +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_examples/abcdefghijklmnop.svg +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_examples/gcode_output.zip +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_examples/kye_circle_paws_orig copy.svg +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_examples/kye_circle_paws_orig.svg +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_examples/letter_B.svg +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_examples/lettersandsigns.svg +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/LICENSE +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/__init__.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/compiler/__init__.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/compiler/interfaces/__init__.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/compiler/interfaces/_abstract_interface.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/compiler/interfaces/_fan_controlled_gcode.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/compiler/interfaces/_gcode.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/compiler/last_compiler.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/compiler/ttt.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/css_color.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/formulas.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/geometry/__init__.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/geometry/_abstract_chain.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/geometry/_abstract_curve.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/geometry/_circular_arc.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/geometry/_cubic_bazier.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/geometry/_elliptical_arc.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/geometry/_line.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/geometry/_matrix.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/geometry/_quadratic_bazier.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/geometry/_raster_image.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/geometry/_smooth_arc_chain.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/geometry/_vector.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/svg_parser/__init__.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/svg_parser/_parser_methods.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/svg_parser/_path.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/svg_parser/_transformation.py +0 -0
- {svg2gcode-4.1.0 → svg2gcode-4.1.2}/svg2gcode/svg_to_gcode/svg_parser/debug_methods.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: svg2gcode
|
|
3
|
-
Version: 4.1.
|
|
3
|
+
Version: 4.1.2
|
|
4
4
|
Summary: svg2gcode: convert an SVG (Scalable Vector Graphic) image to gcode.
|
|
5
5
|
Keywords: scalable vector graphics,svg,image,laser cutter,laser engraving
|
|
6
6
|
Author-email: Johannes Noordanus <mailjohannes.mailnoordanus@gmail.com>
|
|
@@ -10,7 +10,7 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
10
10
|
License-File: LICENSE
|
|
11
11
|
Requires-Dist: numpy >= 1.24.3, <= 2.4.6
|
|
12
12
|
Requires-Dist: Pillow >= 12.2.0
|
|
13
|
-
Requires-Dist: image2gcode >= 2.9.
|
|
13
|
+
Requires-Dist: image2gcode >= 2.9.18
|
|
14
14
|
Project-URL: Home, https://github.com/johannesnoordanus/svg2gcode
|
|
15
15
|
Import-Name: svg2gcode
|
|
16
16
|
|
|
@@ -27,7 +27,7 @@ This all from one command.
|
|
|
27
27
|
|
|
28
28
|
--
|
|
29
29
|
|
|
30
|
-
Exciting times as I have discovered that deep black laser engravings are possible on polished (stainless)steel using a 10W 0.08 mm<sup>
|
|
30
|
+
Exciting times as I have discovered that deep black laser engravings are possible on polished (stainless)steel using a 10W 0.08 mm<sup>2</sup> - practically 0.1 mm<sup>2</sup> - beam laser. Settings: speed 200mm/min and intensity 1000 (full power).<br>
|
|
31
31
|
I can get incredible detail in text and have good images.
|
|
32
32
|
|
|
33
33
|
### Version 4.1 is out now!
|
|
@@ -11,7 +11,7 @@ This all from one command.
|
|
|
11
11
|
|
|
12
12
|
--
|
|
13
13
|
|
|
14
|
-
Exciting times as I have discovered that deep black laser engravings are possible on polished (stainless)steel using a 10W 0.08 mm<sup>
|
|
14
|
+
Exciting times as I have discovered that deep black laser engravings are possible on polished (stainless)steel using a 10W 0.08 mm<sup>2</sup> - practically 0.1 mm<sup>2</sup> - beam laser. Settings: speed 200mm/min and intensity 1000 (full power).<br>
|
|
15
15
|
I can get incredible detail in text and have good images.
|
|
16
16
|
|
|
17
17
|
### Version 4.1 is out now!
|
|
@@ -234,14 +234,16 @@ class Compiler:
|
|
|
234
234
|
return False
|
|
235
235
|
|
|
236
236
|
# check file extentions
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
logger.error(f"Error: unknown input file extension '{Path(svg_file_name).suffix}', vector file extension should be one of '{suffixes}', exit ...")
|
|
237
|
+
if Path(svg_file_name).suffix == Path(file_name).suffix:
|
|
238
|
+
logger.error("Input extension is same as output extension, exit ...")
|
|
240
239
|
sys.exit(1)
|
|
241
|
-
|
|
240
|
+
|
|
241
|
+
suffixes = '.svg,.xml'
|
|
242
|
+
if not ext_check(suffixes, svg_file_name):
|
|
243
|
+
logger.warning(f"Unknown input file extension '{Path(svg_file_name).suffix}', Scalable Vector Graphics file extensions usually are: '{suffixes}'")
|
|
244
|
+
suffixes = '.gc,.gcode,.gco,.g,.nc,.cnc'
|
|
242
245
|
if not ext_check(suffixes, file_name):
|
|
243
|
-
logger.
|
|
244
|
-
sys.exit(1)
|
|
246
|
+
logger.warning(f"Unknown output file extension '{Path(file_name).suffix}', gcode file extensions extensions usually are: '{suffixes}'")
|
|
245
247
|
|
|
246
248
|
# generate gcode for 'path' and 'image' svg tags (calculate bbox)
|
|
247
249
|
# results accumulate in:
|
|
@@ -726,7 +728,7 @@ class Compiler:
|
|
|
726
728
|
Generates gcode for images and stroke and fill of paths.
|
|
727
729
|
"""
|
|
728
730
|
|
|
729
|
-
def correct_fill_lines(delta_chain: LineSegmentChain, fill_lines: list[list[tuple
|
|
731
|
+
def correct_fill_lines(delta_chain: LineSegmentChain, fill_lines: list[list[tuple[float,float],tuple[float,float]]]):
|
|
730
732
|
"""
|
|
731
733
|
Correct fill line boundaries to account for stroke_width.
|
|
732
734
|
"""
|
|
@@ -926,12 +928,12 @@ class Compiler:
|
|
|
926
928
|
|
|
927
929
|
# assume style info is the same for paths with the same id
|
|
928
930
|
(stroke_width,
|
|
929
|
-
|
|
930
|
-
|
|
931
|
+
_unused,
|
|
932
|
+
_unused,
|
|
931
933
|
fill_color,
|
|
932
934
|
fill_alpha,
|
|
933
935
|
fill_rule,
|
|
934
|
-
|
|
936
|
+
_unused) = get_style_info_of_line_chain(path_curves[name_id][0])
|
|
935
937
|
|
|
936
938
|
if fill_color is not None and len(fill_color):
|
|
937
939
|
# Get fill alpha channel (opacity)
|
|
@@ -1021,9 +1023,9 @@ class Compiler:
|
|
|
1021
1023
|
(stroke_width,
|
|
1022
1024
|
stroke_color,
|
|
1023
1025
|
stroke_alpha,
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1026
|
+
_unused,
|
|
1027
|
+
_unused,
|
|
1028
|
+
_unused,
|
|
1027
1029
|
style_pathcut) = get_style_info_of_line_chain(path_curves[name_id][0])
|
|
1028
1030
|
|
|
1029
1031
|
if (style_pathcut is not None and style_pathcut == 'true') or self.settings["pathcut"]:
|
|
@@ -1173,4 +1175,3 @@ class Compiler:
|
|
|
1173
1175
|
|
|
1174
1176
|
# Render 'stroke' attribute
|
|
1175
1177
|
render_stroke_attribute(path_curves, name_id, boundingbox)
|
|
1176
|
-
|
|
@@ -20,22 +20,22 @@ class LineSegmentChain(Chain):
|
|
|
20
20
|
def __repr__(self):
|
|
21
21
|
return f"{type(self)}({len(self._curves)} curves: {[line.__repr__() for line in self._curves[:2]]}...)"
|
|
22
22
|
|
|
23
|
-
def append(self,
|
|
23
|
+
def append(self, new_curve: Line):
|
|
24
24
|
if self._curves:
|
|
25
|
-
|
|
25
|
+
line = self._curves[-1]
|
|
26
26
|
|
|
27
27
|
# Assert continuity
|
|
28
|
-
if abs(
|
|
28
|
+
if abs(line.end - new_curve.start) > TOLERANCES['input']:
|
|
29
29
|
warnings.warn(f"The end of the last line is different from the start of the new line"
|
|
30
|
-
f" |{
|
|
30
|
+
f" |{line.end} - {new_curve.start}| >= {TOLERANCES['input']}")
|
|
31
31
|
|
|
32
32
|
# Join lines
|
|
33
|
-
|
|
33
|
+
new_curve.start = line.end
|
|
34
34
|
|
|
35
|
-
self._curves.append(
|
|
35
|
+
self._curves.append(new_curve)
|
|
36
36
|
|
|
37
37
|
@staticmethod
|
|
38
|
-
def clockwise(line_chains:
|
|
38
|
+
def clockwise(line_chains: list[Chain]) -> bool | None:
|
|
39
39
|
"""
|
|
40
40
|
Return true when line chain rotates clockwise
|
|
41
41
|
|
|
@@ -46,7 +46,7 @@ class LineSegmentChain(Chain):
|
|
|
46
46
|
if line_chains:
|
|
47
47
|
for line_chain in line_chains:
|
|
48
48
|
for line in line_chain:
|
|
49
|
-
if leftmost_line
|
|
49
|
+
if leftmost_line is None or leftmost_line.start.x > line.start.x:
|
|
50
50
|
leftmost_line = line
|
|
51
51
|
|
|
52
52
|
if leftmost_line is not None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|