├── svg-flatten ├── README.rst ├── upstream ├── testdata │ ├── blank.png │ ├── cross.png │ ├── two-px.png │ ├── white.png │ ├── letter-e.png │ ├── single-px.png │ ├── two-blobs.png │ ├── two-px-inv.png │ ├── blob-border-w.png │ ├── blobs-borders.png │ ├── blobs-corners.png │ ├── paper-example.png │ ├── single-px-inv.png │ ├── blobs-crossing.png │ ├── paper-example-inv.png │ ├── contour_tracing_demo_input.png │ ├── chain-approx-teh-chin-chromosome.png │ └── svg │ │ ├── empty.svg │ │ ├── circle_simple.svg │ │ ├── last_dash.svg │ │ ├── stroke_dashes_comparison.svg │ │ ├── doc_unit_scale.svg │ │ ├── empty_inkscape.svg │ │ ├── shear.svg │ │ ├── rect.svg │ │ ├── rotation_90.svg │ │ ├── rotation.svg │ │ ├── stroke.svg │ │ ├── rect_xform.svg │ │ ├── rect_occlusion.svg │ │ ├── circles.svg │ │ ├── stroke_joins.svg │ │ ├── stroke_caps.svg │ │ ├── pattern_stroke.svg │ │ ├── pattern_stroke_dashed.svg │ │ └── scale.svg ├── src │ ├── wasi_exception_workaround.cpp │ ├── util.h │ ├── lambda_sink.cpp │ ├── svg_path.h │ ├── vec_grid.h │ ├── svg_geom.h │ ├── svg_pattern.h │ ├── svg_import_util.h │ ├── svg_color.h │ ├── svg_import_defs.h │ ├── vec_core.h │ ├── svg_import_util.cpp │ └── out_dilater.cpp ├── svg-flatten-wasi-ci.yml ├── setup.py ├── geom_test.py └── include │ └── flatten.hpp ├── gerbolyze ├── tests │ ├── __init__.py │ ├── resources │ │ ├── test_gerber_8seg.zip │ │ └── layers-gerber │ │ │ └── layers-Cmts.User.gbr │ └── test_regression.py └── __main__.py ├── .gitignore ├── pytest.ini ├── pics ├── sample1.jpg ├── sample2.jpg ├── sample3.jpg ├── ex-strokes.png ├── ex-svg-joins.png ├── ex-flattening.png ├── ex-svg-strokes.png ├── ex-svg-winding.png ├── ex-intersections.png ├── fr4_comparison2.jpg ├── process-overview.png ├── subtract_example.png ├── pcbway_sample_01_small.jpg ├── pcbway_sample_02_small.jpg ├── pcbway_sample_03_small.jpg ├── vec_hexgrid_composited.png ├── vec_poisson_composited.png ├── vec_square_composited.png ├── vec_contours_composited.png └── test_svg_readme_composited.png ├── testdata ├── test.svg.png ├── led_drv.GKO ├── chibi_2024-Edge.Cuts.gbr └── led_drv.TXT ├── gerboweb ├── ansible │ ├── tmpfiles-gerboweb.conf.j2 │ ├── gerboweb.cfg.j2 │ ├── uwsgi-gerboweb.ini │ ├── gerboweb-job-processor.service.j2 │ ├── vector.sh.j2 │ ├── render.sh.j2 │ └── gerboweb.yml ├── static │ ├── bg.jpg │ ├── bg10.jpg │ ├── favicon.png │ ├── sample1.jpg │ ├── sample2.jpg │ ├── sample3.jpg │ ├── favicon-128.png │ ├── favicon-16.png │ ├── favicon-256.png │ ├── favicon-32.png │ ├── favicon-48.png │ ├── favicon-512.png │ ├── favicon-64.png │ └── favicon-1024.png ├── gerboweb-develop.cfg ├── gerboweb_prod.cfg ├── run-develop.sh ├── uwsgi-gerboweb.ini ├── Containerfile.develop ├── develop-startup.sh └── Containerfile ├── screenshots ├── 03paste.png ├── 01import01.png ├── 02import02.png ├── 05position.png ├── 09retouch.png ├── 04scale_cut.png ├── 06grayscale.png ├── 08curve_cut.png ├── 10retouched.png ├── 11newsprint.png ├── 12newsprint.png ├── 13newsprint.png ├── 14newsprint.png ├── 14result_cut.png ├── 15result_cut.png ├── 16result_cut.png ├── 17caveat_cut.png ├── 18caveat_cut.png ├── 07curve_settings.png └── 11newsprint_settings.png ├── tox.ini ├── upstream └── clipper-6.4.2 │ ├── README │ ├── cpp │ ├── clipper.cpp │ ├── cpp_cairo │ │ ├── libcairo-2.lib │ │ ├── cairo_clipper.o │ │ ├── Cairo Resources.txt │ │ ├── cairo.sln │ │ └── cairo_clipper.hpp │ ├── polyclipping.pc.cmakein │ └── CMakeLists.txt │ ├── Documentation │ ├── Scripts │ │ ├── SyntaxHighlighter │ │ │ ├── compass │ │ │ │ ├── shCoreEmacs.scss │ │ │ │ ├── shCoreRDark.scss │ │ │ │ ├── shCoreDefault.scss │ │ │ │ ├── shCoreDjango.scss │ │ │ │ ├── shCoreEclipse.scss │ │ │ │ ├── shCoreMDUltra.scss │ │ │ │ ├── shCoreMidnight.scss │ │ │ │ ├── shCoreFadeToGrey.scss │ │ │ │ ├── shThemeDefault.scss │ │ │ │ ├── config.rb │ │ │ │ ├── shThemeMDUltra.scss │ │ │ │ ├── shThemeEmacs.scss │ │ │ │ ├── shThemeMidnight.scss │ │ │ │ ├── shThemeRDark.scss │ │ │ │ ├── shThemeDjango.scss │ │ │ │ ├── shThemeFadeToGrey.scss │ │ │ │ └── shThemeEclipse.scss │ │ │ ├── index.html │ │ │ └── scripts │ │ │ │ ├── shBrushPlain.js │ │ │ │ ├── shBrushDiff.js │ │ │ │ ├── shAutoloader.js │ │ │ │ ├── shBrushJScript.js │ │ │ │ ├── shLegacy.js │ │ │ │ ├── shBrushErlang.js │ │ │ │ ├── shBrushScala.js │ │ │ │ ├── shBrushXml.js │ │ │ │ ├── shBrushJava.js │ │ │ │ ├── shBrushRuby.js │ │ │ │ ├── shBrushJavaFX.js │ │ │ │ ├── shBrushVb.js │ │ │ │ ├── shBrushDelphi.js │ │ │ │ ├── shBrushAS3.js │ │ │ │ ├── shBrushPython.js │ │ │ │ ├── shBrushCSharp.js │ │ │ │ └── shBrushBash.js │ │ ├── bootstrap.js │ │ └── menu_data.js │ ├── clipper.chm │ ├── Images │ │ ├── int.png │ │ ├── wn.png │ │ ├── xor.png │ │ ├── _Home.gif │ │ ├── _Unit.gif │ │ ├── union.png │ │ ├── zfill.png │ │ ├── _Class.gif │ │ ├── _buttons.gif │ │ ├── clean1.png │ │ ├── clean2.png │ │ ├── cliptype.png │ │ ├── evenodd.png │ │ ├── negative.png │ │ ├── nonzero.png │ │ ├── offset1.png │ │ ├── polytree.png │ │ ├── positive.png │ │ ├── sample1.png │ │ ├── simplify.png │ │ ├── difference.png │ │ ├── endtypes1.png │ │ ├── endtypes2.png │ │ ├── jointypes.png │ │ ├── linesdemo.png │ │ ├── minkowski.png │ │ ├── minkowski2.png │ │ ├── miterlimit.png │ │ ├── simplify2.png │ │ ├── simplify3.png │ │ ├── _BranchEmpty.gif │ │ ├── _BranchRight.gif │ │ ├── _BranchVert.gif │ │ ├── _Project_Logo.gif │ │ ├── common_edges.png │ │ ├── intersection.png │ │ ├── line_clipping.png │ │ ├── orientation.png │ │ ├── kangaroo_small.png │ │ ├── line_clipping2.png │ │ ├── winding_number.png │ │ ├── _BranchVertRight.gif │ │ ├── clipper_rounding.png │ │ ├── clipper_rounding2.png │ │ ├── clipper_rounding3.png │ │ └── clipper_rounding4.png │ ├── Docs │ │ ├── Overview │ │ │ ├── Changes.htm │ │ │ ├── Rounding.htm │ │ │ └── Deprecated.htm │ │ └── Units │ │ │ └── ClipperLib │ │ │ ├── Functions │ │ │ ├── ReversePaths.htm │ │ │ ├── ReversePath.htm │ │ │ └── PolyTreeToPaths.htm │ │ │ └── Classes │ │ │ ├── ClipperOffset │ │ │ └── Methods │ │ │ │ └── Clear.htm │ │ │ ├── ClipperBase │ │ │ └── Methods │ │ │ │ └── Clear.htm │ │ │ └── PolyNode │ │ │ └── Properties │ │ │ └── Contour.htm │ └── index.htm │ └── License.txt ├── bin └── gerbolyze ├── podman ├── testdata │ ├── gerbolyze-2.0.0.tar.gz │ └── testscript.sh ├── fedora-testenv ├── arch-testenv ├── ubuntu-testenv └── debian-testenv ├── TODO ├── MANIFEST.in ├── gerboweb.service ├── export_previews.py ├── export_protoboards.py ├── .gitmodules ├── run-tests.sh ├── kicad_mod_template.svg └── setup.py /svg-flatten/README.rst: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gerbolyze/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /svg-flatten/upstream: -------------------------------------------------------------------------------- 1 | ../upstream -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | dist 3 | gerbolyze.egg-info 4 | -------------------------------------------------------------------------------- /gerbolyze/__main__.py: -------------------------------------------------------------------------------- 1 | import gerbolyze 2 | gerbolyze.cli() 3 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | testpaths = gerbolyze/tests 3 | norecursedirs=* 4 | -------------------------------------------------------------------------------- /pics/sample1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/sample1.jpg -------------------------------------------------------------------------------- /pics/sample2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/sample2.jpg -------------------------------------------------------------------------------- /pics/sample3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/sample3.jpg -------------------------------------------------------------------------------- /pics/ex-strokes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/ex-strokes.png -------------------------------------------------------------------------------- /pics/ex-svg-joins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/ex-svg-joins.png -------------------------------------------------------------------------------- /testdata/test.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/testdata/test.svg.png -------------------------------------------------------------------------------- /gerboweb/ansible/tmpfiles-gerboweb.conf.j2: -------------------------------------------------------------------------------- 1 | d {{gerboweb_cache}} 770 uwsgi-gerboweb uwsgi 2d 2 | -------------------------------------------------------------------------------- /gerboweb/static/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/gerboweb/static/bg.jpg -------------------------------------------------------------------------------- /pics/ex-flattening.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/ex-flattening.png -------------------------------------------------------------------------------- /pics/ex-svg-strokes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/ex-svg-strokes.png -------------------------------------------------------------------------------- /pics/ex-svg-winding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/ex-svg-winding.png -------------------------------------------------------------------------------- /screenshots/03paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/03paste.png -------------------------------------------------------------------------------- /gerboweb/static/bg10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/gerboweb/static/bg10.jpg -------------------------------------------------------------------------------- /pics/ex-intersections.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/ex-intersections.png -------------------------------------------------------------------------------- /pics/fr4_comparison2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/fr4_comparison2.jpg -------------------------------------------------------------------------------- /pics/process-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/process-overview.png -------------------------------------------------------------------------------- /pics/subtract_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/subtract_example.png -------------------------------------------------------------------------------- /screenshots/01import01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/01import01.png -------------------------------------------------------------------------------- /screenshots/02import02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/02import02.png -------------------------------------------------------------------------------- /screenshots/05position.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/05position.png -------------------------------------------------------------------------------- /screenshots/09retouch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/09retouch.png -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = py38, py312 3 | 4 | [testenv] 5 | deps = pytest 6 | commands = pytest 7 | -------------------------------------------------------------------------------- /gerboweb/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/gerboweb/static/favicon.png -------------------------------------------------------------------------------- /gerboweb/static/sample1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/gerboweb/static/sample1.jpg -------------------------------------------------------------------------------- /gerboweb/static/sample2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/gerboweb/static/sample2.jpg -------------------------------------------------------------------------------- /gerboweb/static/sample3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/gerboweb/static/sample3.jpg -------------------------------------------------------------------------------- /screenshots/04scale_cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/04scale_cut.png -------------------------------------------------------------------------------- /screenshots/06grayscale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/06grayscale.png -------------------------------------------------------------------------------- /screenshots/08curve_cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/08curve_cut.png -------------------------------------------------------------------------------- /screenshots/10retouched.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/10retouched.png -------------------------------------------------------------------------------- /screenshots/11newsprint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/11newsprint.png -------------------------------------------------------------------------------- /screenshots/12newsprint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/12newsprint.png -------------------------------------------------------------------------------- /screenshots/13newsprint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/13newsprint.png -------------------------------------------------------------------------------- /screenshots/14newsprint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/14newsprint.png -------------------------------------------------------------------------------- /screenshots/14result_cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/14result_cut.png -------------------------------------------------------------------------------- /screenshots/15result_cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/15result_cut.png -------------------------------------------------------------------------------- /screenshots/16result_cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/16result_cut.png -------------------------------------------------------------------------------- /screenshots/17caveat_cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/17caveat_cut.png -------------------------------------------------------------------------------- /screenshots/18caveat_cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/18caveat_cut.png -------------------------------------------------------------------------------- /gerboweb/static/favicon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/gerboweb/static/favicon-128.png -------------------------------------------------------------------------------- /gerboweb/static/favicon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/gerboweb/static/favicon-16.png -------------------------------------------------------------------------------- /gerboweb/static/favicon-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/gerboweb/static/favicon-256.png -------------------------------------------------------------------------------- /gerboweb/static/favicon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/gerboweb/static/favicon-32.png -------------------------------------------------------------------------------- /gerboweb/static/favicon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/gerboweb/static/favicon-48.png -------------------------------------------------------------------------------- /gerboweb/static/favicon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/gerboweb/static/favicon-512.png -------------------------------------------------------------------------------- /gerboweb/static/favicon-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/gerboweb/static/favicon-64.png -------------------------------------------------------------------------------- /pics/pcbway_sample_01_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/pcbway_sample_01_small.jpg -------------------------------------------------------------------------------- /pics/pcbway_sample_02_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/pcbway_sample_02_small.jpg -------------------------------------------------------------------------------- /pics/pcbway_sample_03_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/pcbway_sample_03_small.jpg -------------------------------------------------------------------------------- /pics/vec_hexgrid_composited.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/vec_hexgrid_composited.png -------------------------------------------------------------------------------- /pics/vec_poisson_composited.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/vec_poisson_composited.png -------------------------------------------------------------------------------- /pics/vec_square_composited.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/vec_square_composited.png -------------------------------------------------------------------------------- /svg-flatten/testdata/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/svg-flatten/testdata/blank.png -------------------------------------------------------------------------------- /svg-flatten/testdata/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/svg-flatten/testdata/cross.png -------------------------------------------------------------------------------- /svg-flatten/testdata/two-px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/svg-flatten/testdata/two-px.png -------------------------------------------------------------------------------- /svg-flatten/testdata/white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/svg-flatten/testdata/white.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/README -------------------------------------------------------------------------------- /gerboweb/static/favicon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/gerboweb/static/favicon-1024.png -------------------------------------------------------------------------------- /pics/vec_contours_composited.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/vec_contours_composited.png -------------------------------------------------------------------------------- /screenshots/07curve_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/07curve_settings.png -------------------------------------------------------------------------------- /svg-flatten/testdata/letter-e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/svg-flatten/testdata/letter-e.png -------------------------------------------------------------------------------- /pics/test_svg_readme_composited.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/pics/test_svg_readme_composited.png -------------------------------------------------------------------------------- /screenshots/11newsprint_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/screenshots/11newsprint_settings.png -------------------------------------------------------------------------------- /svg-flatten/testdata/single-px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/svg-flatten/testdata/single-px.png -------------------------------------------------------------------------------- /svg-flatten/testdata/two-blobs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/svg-flatten/testdata/two-blobs.png -------------------------------------------------------------------------------- /svg-flatten/testdata/two-px-inv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/svg-flatten/testdata/two-px-inv.png -------------------------------------------------------------------------------- /bin/gerbolyze: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | if __name__ == '__main__': 4 | import gerbolyze 5 | gerbolyze.cli() 6 | -------------------------------------------------------------------------------- /podman/testdata/gerbolyze-2.0.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/podman/testdata/gerbolyze-2.0.0.tar.gz -------------------------------------------------------------------------------- /svg-flatten/testdata/blob-border-w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/svg-flatten/testdata/blob-border-w.png -------------------------------------------------------------------------------- /svg-flatten/testdata/blobs-borders.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/svg-flatten/testdata/blobs-borders.png -------------------------------------------------------------------------------- /svg-flatten/testdata/blobs-corners.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/svg-flatten/testdata/blobs-corners.png -------------------------------------------------------------------------------- /svg-flatten/testdata/paper-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/svg-flatten/testdata/paper-example.png -------------------------------------------------------------------------------- /svg-flatten/testdata/single-px-inv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/svg-flatten/testdata/single-px-inv.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/cpp/clipper.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/cpp/clipper.cpp -------------------------------------------------------------------------------- /svg-flatten/testdata/blobs-crossing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/svg-flatten/testdata/blobs-crossing.png -------------------------------------------------------------------------------- /svg-flatten/testdata/paper-example-inv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/svg-flatten/testdata/paper-example-inv.png -------------------------------------------------------------------------------- /gerbolyze/tests/resources/test_gerber_8seg.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/gerbolyze/tests/resources/test_gerber_8seg.zip -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/compass/shCoreEmacs.scss: -------------------------------------------------------------------------------- 1 | @import "shCore.scss"; 2 | @import "shThemeEmacs.scss"; 3 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/compass/shCoreRDark.scss: -------------------------------------------------------------------------------- 1 | @import "shCore.scss"; 2 | @import "shThemeRDark.scss"; 3 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/clipper.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/clipper.chm -------------------------------------------------------------------------------- /svg-flatten/testdata/contour_tracing_demo_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/svg-flatten/testdata/contour_tracing_demo_input.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/int.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/int.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/wn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/wn.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/xor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/xor.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/compass/shCoreDefault.scss: -------------------------------------------------------------------------------- 1 | @import "shCore.scss"; 2 | @import "shThemeDefault.scss"; 3 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/compass/shCoreDjango.scss: -------------------------------------------------------------------------------- 1 | @import "shCore.scss"; 2 | @import "shThemeDjango.scss"; 3 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/compass/shCoreEclipse.scss: -------------------------------------------------------------------------------- 1 | @import "shCore.scss"; 2 | @import "shThemeEclipse.scss"; 3 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/compass/shCoreMDUltra.scss: -------------------------------------------------------------------------------- 1 | @import "shCore.scss"; 2 | @import "shThemeMDUltra.scss"; 3 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/compass/shCoreMidnight.scss: -------------------------------------------------------------------------------- 1 | @import "shCore.scss"; 2 | @import "shThemeMidnight.scss"; 3 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/cpp/cpp_cairo/libcairo-2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/cpp/cpp_cairo/libcairo-2.lib -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/_Home.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/_Home.gif -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/_Unit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/_Unit.gif -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/union.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/union.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/zfill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/zfill.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/compass/shCoreFadeToGrey.scss: -------------------------------------------------------------------------------- 1 | @import "shCore.scss"; 2 | @import "shThemeFadeToGrey.scss"; 3 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/bootstrap.js: -------------------------------------------------------------------------------- 1 | // This file may be used to bootstrap the DOM via JavaScript... 2 | SyntaxHighlighter.all(); 3 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/cpp/cpp_cairo/cairo_clipper.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/cpp/cpp_cairo/cairo_clipper.o -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/_Class.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/_Class.gif -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/_buttons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/_buttons.gif -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/clean1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/clean1.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/clean2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/clean2.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/cliptype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/cliptype.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/evenodd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/evenodd.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/negative.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/negative.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/nonzero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/nonzero.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/offset1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/offset1.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/polytree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/polytree.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/positive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/positive.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/sample1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/sample1.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/simplify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/simplify.png -------------------------------------------------------------------------------- /svg-flatten/testdata/chain-approx-teh-chin-chromosome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/svg-flatten/testdata/chain-approx-teh-chin-chromosome.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/difference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/difference.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/endtypes1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/endtypes1.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/endtypes2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/endtypes2.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/jointypes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/jointypes.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/linesdemo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/linesdemo.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/minkowski.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/minkowski.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/minkowski2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/minkowski2.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/miterlimit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/miterlimit.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/simplify2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/simplify2.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/simplify3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/simplify3.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/_BranchEmpty.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/_BranchEmpty.gif -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/_BranchRight.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/_BranchRight.gif -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/_BranchVert.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/_BranchVert.gif -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/_Project_Logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/_Project_Logo.gif -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/common_edges.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/common_edges.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/intersection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/intersection.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/line_clipping.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/line_clipping.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/orientation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/orientation.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Docs/Overview/Changes.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Docs/Overview/Changes.htm -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Docs/Overview/Rounding.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Docs/Overview/Rounding.htm -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/kangaroo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/kangaroo_small.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/line_clipping2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/line_clipping2.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/winding_number.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/winding_number.png -------------------------------------------------------------------------------- /gerboweb/gerboweb-develop.cfg: -------------------------------------------------------------------------------- 1 | MAX_CONTENT_LENGTH=50000000 2 | SECRET_KEY="development mode" 3 | UPLOAD_PATH="/var/cache/upload" 4 | JOB_QUEUE_DB="/var/cache/job_queue.sqlite3" 5 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/_BranchVertRight.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/_BranchVertRight.gif -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/clipper_rounding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/clipper_rounding.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/clipper_rounding2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/clipper_rounding2.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/clipper_rounding3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/clipper_rounding3.png -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Images/clipper_rounding4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaseg/gerbolyze/HEAD/upstream/clipper-6.4.2/Documentation/Images/clipper_rounding4.png -------------------------------------------------------------------------------- /gerboweb/gerboweb_prod.cfg: -------------------------------------------------------------------------------- 1 | MAX_CONTENT_LENGTH=10000000 2 | UPLOAD_PATH="/var/cache/gerboweb/upload" 3 | JOB_QUEUE_DB="/var/cache/gerboweb/job_queue.sqlite3" 4 | APPLICATION_ROOT="/gerboweb/" 5 | -------------------------------------------------------------------------------- /gerboweb/run-develop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | cd "$(dirname $0)" 6 | podman build -f Containerfile.develop --tag gerbolyze-develop 7 | podman run -p 127.0.0.1:5000:5000 -v ..:/gerbolyze -ti gerbolyze-develop 8 | -------------------------------------------------------------------------------- /gerboweb/ansible/gerboweb.cfg.j2: -------------------------------------------------------------------------------- 1 | MAX_CONTENT_LENGTH=50000000 2 | SECRET_KEY="{{lookup('password', 'gerboweb_flask_secret.txt length=32')}}" 3 | UPLOAD_PATH="{{gerboweb_cache}}/upload" 4 | JOB_QUEUE_DB="{{gerboweb_cache}}/job_queue.sqlite3" 5 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/compass/shThemeDefault.scss: -------------------------------------------------------------------------------- 1 | // Default Syntax Highlighter theme. 2 | 3 | @import "_theme_template.scss"; 4 | 5 | .syntaxhighlighter { 6 | .keyword { font-weight: bold !important; } 7 | } 8 | -------------------------------------------------------------------------------- /podman/fedora-testenv: -------------------------------------------------------------------------------- 1 | 2 | FROM docker.io/fedora:latest 3 | MAINTAINER gerbolyze@jaseg.de 4 | RUN dnf update --refresh -y 5 | RUN dnf install -y python3 make clang opencv-devel pugixml-devel pango-devel cairo-devel rust cargo 6 | RUN cargo install resvg 7 | 8 | -------------------------------------------------------------------------------- /gerboweb/ansible/uwsgi-gerboweb.ini: -------------------------------------------------------------------------------- 1 | [uwsgi] 2 | master = True 3 | cheap = True 4 | die-on-idle = False 5 | manage-script-name = True 6 | plugins = python3 7 | chdir = /var/lib/gerboweb 8 | mount = /=gerboweb:app 9 | env = GERBOWEB_SETTINGS=gerboweb_prod.cfg 10 | mule = job_processor.py 11 | 12 | -------------------------------------------------------------------------------- /gerboweb/ansible/gerboweb-job-processor.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Gerboweb gerber job processor 3 | 4 | [Service] 5 | WorkingDirectory=/var/lib/gerboweb 6 | ExecStart=/usr/bin/python3 job_processor.py {{gerboweb_cache}}/job_queue.sqlite3 7 | 8 | [Install] 9 | WantedBy=uwsgi-app@gerboweb.service 10 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/cpp/cpp_cairo/Cairo Resources.txt: -------------------------------------------------------------------------------- 1 | http://cairographics.org/ 2 | 3 | The Windows dynamic linked libraries necessary to run Cairo can be downloaded from 4 | http://www.gtk.org/download/win32.php 5 | All the dlls listed under the heading "Required third party dependencies" are 6 | required except gettext-runtime.dll. 7 | -------------------------------------------------------------------------------- /gerboweb/uwsgi-gerboweb.ini: -------------------------------------------------------------------------------- 1 | [uwsgi] 2 | master = True 3 | cheap = True 4 | die-on-idle = False 5 | manage-script-name = True 6 | plugins = python 7 | chdir = /gerboweb 8 | chmod-socket=666 9 | mount = /gerboweb=gerboweb:app 10 | env = GERBOWEB_SETTINGS=gerboweb.cfg 11 | mule = job_processor.py /var/cache/gerboweb/job_queue.sqlite3 12 | static-map = /static=/gerboweb/static 13 | -------------------------------------------------------------------------------- /svg-flatten/src/wasi_exception_workaround.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | using namespace std; 5 | 6 | void __cxa_allocate_exception(size_t size) { 7 | (void) size; 8 | abort(); 9 | } 10 | 11 | void __cxa_throw(void* thrown_exception, struct std::type_info * tinfo, void (*dest)(void*)) { 12 | (void) thrown_exception, (void) tinfo, (void) dest; 13 | abort(); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /svg-flatten/testdata/svg/empty.svg: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/compass/config.rb: -------------------------------------------------------------------------------- 1 | environment = :production 2 | project_type = :stand_alone 3 | http_path = "/" 4 | css_dir = "../styles" 5 | sass_dir = "." 6 | images_dir = "images" 7 | sass_options = { 8 | :line_numbers => false, 9 | :debug_info => false 10 | } 11 | 12 | # output_style = :compressed 13 | # output_style = :compact 14 | output_style = :expanded 15 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/cpp/polyclipping.pc.cmakein: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=@CMAKE_INSTALL_PREFIX@ 3 | libdir=@CMAKE_INSTALL_LIBDIR@ 4 | sharedlibdir=@CMAKE_INSTALL_LIBDIR@ 5 | includedir=@CMAKE_INSTALL_INCDIR@ 6 | 7 | Name: polyclipping 8 | Description: polygon clipping library 9 | Version: @VERSION@ 10 | 11 | Requires: 12 | Libs: -L${libdir} -L${sharedlibdir} -lpolyclipping 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /podman/arch-testenv: -------------------------------------------------------------------------------- 1 | 2 | FROM docker.io/archlinux:latest 3 | MAINTAINER gerbolyze@jaseg.de 4 | RUN pacman --noconfirm -Syu 5 | RUN pacman --noconfirm -Sy pugixml opencv pango cairo git python make clang rustup cargo python-pip base-devel gerbv rsync 6 | RUN python3 -m pip install pytest-parallel setuptools wasmtime 7 | RUN rustup install stable 8 | RUN rustup default stable 9 | RUN cargo install resvg 10 | RUN python3 -m pip install --upgrade gerbonara 11 | -------------------------------------------------------------------------------- /podman/testdata/testscript.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | rsync -a /data/git/ git/ 5 | cd git 6 | 7 | git config --global --add safe.directory $(realpath git) 8 | 9 | cp svg-flatten/build/svg-flatten.wasm svg-flatten/svg_flatten_wasi/ 10 | cd svg-flatten 11 | python3 setup.py install 12 | cd .. 13 | 14 | pip install --upgrade --no-cache-dir 'gerbonara>=0.11.0' 15 | python3 setup.py install 16 | 17 | export WASMTIME_BACKTRACE_DETAILS=1 18 | python3 -m pytest $@ 19 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | [ ] Do not just return "error 255" if usvg is not installed 2 | [ ] Straighten up svg-flatten input unit handling 3 | [x] split up python code into modules 4 | [x] Add backwards-compatible vectorize drop-in 5 | [x] Figure out handling of drill layers 6 | [x] Re-publish my own pcb-tools, pcb-tools-extension forks with actual maintenance 7 | [ ] For pattern rendering: validate pattern origin aligns with what the svg spec expects 8 | [ ] Invert SVG color interpretation (use saturation maybe? or sat * val?) 9 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/index.htm: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | Redirect 8 | 9 | 10 | If the documentation doesn't open automatically, click here. 11 | 12 | 13 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | # setuptools'es default strategy of packing everything into the archive that is in git is really the opposite of smart 2 | # here, especially because AFAICT after hours of googling there is no way to turn it off. Meh. Why is python packaging 3 | # like this? what is so hard about putting a few files in a zip?! 4 | global-exclude * 5 | 6 | include README.rst 7 | include LICENSE 8 | include MANIFEST.in 9 | include setup.py 10 | recursive-include gerbolyze *.py 11 | recursive-include bin * 12 | recursive-include gerbolyze.egg-info * 13 | -------------------------------------------------------------------------------- /gerboweb/ansible/vector.sh.j2: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | [ $# != 2 ] && exit 1 4 | ID=$1 5 | egrep -x -q '^[-0-9A-Za-z]{36}$'<<<"$ID" || exit 2 6 | LAYER=$2 7 | egrep -x -q '^(top|bottom)$'<<<"$LAYER" || exit 2 8 | 9 | systemd-nspawn \ 10 | -D {{gerboweb_root}} \ 11 | -x --bind={{gerboweb_cache}}/upload/$ID:/mnt \ 12 | /bin/sh -c "set -euo pipefail 13 | cd /tmp 14 | unzip -j -d gerber_in /mnt/gerber.zip 15 | gerbolyze paste "--"$LAYER /mnt/overlay.svg gerber_in gerber 16 | rm -f /mnt/gerber_out.zip 17 | zip -r /mnt/gerber_out.zip gerber" 18 | 19 | -------------------------------------------------------------------------------- /testdata/led_drv.GKO: -------------------------------------------------------------------------------- 1 | G04 Layer_Color=16711935* 2 | %FSLAX25Y25*% 3 | %MOIN*% 4 | G70* 5 | G01* 6 | G75* 7 | %ADD26C,0.01000*% 8 | D26* 9 | X354331Y177165D02* 10 | G03* 11 | X334646Y196850I-19685J0D01* 12 | G01* 13 | Y0D02* 14 | G03* 15 | X354331Y19685I0J19685D01* 16 | G01* 17 | X0D02* 18 | G03* 19 | X19685Y0I19685J0D01* 20 | G01* 21 | Y196850D02* 22 | G03* 23 | X0Y177165I0J-19685D01* 24 | G01* 25 | X354331Y19685D02* 26 | Y177165D01* 27 | X19685Y196850D02* 28 | X334646D01* 29 | X19685Y0D02* 30 | X334646D01* 31 | X0Y19685D02* 32 | Y177165D01* 33 | M02* 34 | -------------------------------------------------------------------------------- /podman/ubuntu-testenv: -------------------------------------------------------------------------------- 1 | 2 | FROM docker.io/ubuntu:latest 3 | MAINTAINER gerbolyze@jaseg.de 4 | RUN env DEBIAN_FRONTEND=noninteractive apt update -y 5 | RUN env DEBIAN_FRONTEND=noninteractive apt install -y libopencv-dev libpugixml-dev libpangocairo-1.0-0 libpango1.0-dev libcairo2-dev clang make python3 git python3-wheel curl python3-pip python3-venv cargo rsync gerbv 6 | RUN cargo install resvg 7 | RUN python3 -m pip install numpy slugify lxml click pillow scipy sphinx pytest beautifulsoup4 pytest-parallel wasmtime 8 | RUN python3 -m pip install --upgrade gerbonara 9 | -------------------------------------------------------------------------------- /gerboweb/Containerfile.develop: -------------------------------------------------------------------------------- 1 | FROM docker.io/archlinux:latest 2 | MAINTAINER gerbolyze@jaseg.de 3 | RUN pacman --noconfirm -Syu 4 | RUN pacman --noconfirm -Sy pugixml opencv pango cairo git python make clang rustup cargo python-pip base-devel gerbv rsync tmux 5 | RUN rustup install stable 6 | RUN rustup default stable 7 | RUN cargo install usvg resvg 8 | RUN mkdir /app /gerbolyze 9 | RUN python3 -m pip install pip==21.3.1 10 | RUN python3 -m pip install flask numpy lxml wasmtime svg_flatten_wasi resvg_wasi flask_wtf 11 | COPY develop-startup.sh /app/ 12 | ENTRYPOINT /app/develop-startup.sh 13 | -------------------------------------------------------------------------------- /podman/debian-testenv: -------------------------------------------------------------------------------- 1 | 2 | FROM docker.io/debian:latest 3 | MAINTAINER gerbolyze@jaseg.de 4 | RUN env DEBIAN_FRONTEND=noninteractive apt update -y 5 | RUN env DEBIAN_FRONTEND=noninteractive apt install -y libopencv-dev libpugixml-dev libpangocairo-1.0-0 libpango1.0-dev libcairo2-dev clang make python3 git python3-wheel curl python3-pip python3-venv 6 | 7 | RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y 8 | RUN sh -c '. ~/.cargo/env && rustup install stable' 9 | RUN sh -c '. ~/.cargo/env && rustup default stable' 10 | RUN sh -c '. ~/.cargo/env && cargo install resvg' 11 | 12 | -------------------------------------------------------------------------------- /gerboweb.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Gerboweb server service 3 | Documentation=https://gitlab.com/gerbolyze/gerbolyze 4 | Wants=network-online.target 5 | Wants=nginx.service 6 | After=nginx.service 7 | RequiresMountsFor=/var/run/container/storage 8 | 9 | [Service] 10 | ExecStart=/usr/bin/podman run --secret=gerboweb --conmon-pidfile=%t/container-gerboweb.pid --volume=${RUNTIME_DIRECTORY}:/run/uwsgi --detach gerboweb 11 | ExecStop=/usr/bin/podman stop --time 2 gerboweb 12 | Type=forking 13 | PIDFile=%t/container-gerboweb.pid 14 | RuntimeDirectory=gerboweb-uwsgi 15 | 16 | [Install] 17 | WantedBy=default.target 18 | -------------------------------------------------------------------------------- /testdata/chibi_2024-Edge.Cuts.gbr: -------------------------------------------------------------------------------- 1 | G04 #@! TF.FileFunction,Profile,NP* 2 | %FSLAX46Y46*% 3 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 4 | G04 Created by KiCad (PCBNEW 4.0.6) date Mon Sep 18 11:29:53 2017* 5 | %MOMM*% 6 | %LPD*% 7 | G01* 8 | G04 APERTURE LIST* 9 | %ADD10C,0.100000*% 10 | %ADD11C,0.150000*% 11 | G04 APERTURE END LIST* 12 | D10* 13 | D11* 14 | X149000000Y-43750000D02* 15 | X49000000Y-43750000D01* 16 | X149000000Y-121750000D02* 17 | X149000000Y-43750000D01* 18 | X49000000Y-121750000D02* 19 | X149000000Y-121750000D01* 20 | X49000000Y-43750000D02* 21 | X49000000Y-121750000D01* 22 | M02* 23 | -------------------------------------------------------------------------------- /gerbolyze/tests/resources/layers-gerber/layers-Cmts.User.gbr: -------------------------------------------------------------------------------- 1 | G04 Gerber file generated by Gerbonara* 2 | %MOMM*% 3 | %FSLAX46Y46*% 4 | %IPPOS*% 5 | G75 6 | %LPD*% 7 | %AMGNC* 8 | 1,1,$1,0,0,-57.29578X$4* 9 | 1,0,$2,0,0,0* 10 | 21,0,$2,$3,0,0,-57.29578X$4* 11 | % 12 | %AMGNR* 13 | 21,1,$1,$2,0,0,$5X-57.29578* 14 | 1,0,$3,0,0,0* 15 | 21,0,$3,$4,0,0,$5X-57.29578* 16 | % 17 | %AMGNO* 18 | 21,1,$1,$2,0,0,$5X-57.29578* 19 | 1,1,$2,$1/2,0,$5X-57.29578* 20 | 1,1,$2,(0-$1)/2,0,$5X-57.29578* 21 | 1,0,$3,0,0,0* 22 | 21,0,$3,$4,0,0,$5X-57.29578* 23 | % 24 | %AMGNP* 25 | 5,1,$2,0,0,$1,$3X-57.29578* 26 | 1,0,$4,0,0,0* 27 | % 28 | %ADD10C,0.05*% 29 | M02* -------------------------------------------------------------------------------- /svg-flatten/testdata/svg/circle_simple.svg: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 21 | 22 | -------------------------------------------------------------------------------- /svg-flatten/testdata/svg/last_dash.svg: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 21 | 22 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/menu_data.js: -------------------------------------------------------------------------------- 1 | td_1 = "Overview" 2 | td_1_1 = "Library Overview" 3 | url_1_1 = "Overview/_Body.htm" 4 | td_1_2 = "Changes" 5 | url_1_2 = "Overview/Changes.htm" 6 | td_1_3 = "Example" 7 | url_1_3 = "Overview/Example.htm" 8 | td_1_4 = "FAQ" 9 | url_1_4 = "Overview/FAQ.htm" 10 | td_1_5 = "Rounding" 11 | url_1_5 = "Overview/Rounding.htm" 12 | td_1_6 = "Deprecated" 13 | url_1_6 = "Overview/Deprecated.htm" 14 | td_1_7 = "License" 15 | url_1_7 = "Overview/License.htm" 16 | 17 | td_2 = "Internet" 18 | td_2_1 = "Clipper at SourceForge" 19 | url_2_1 = "%http://sourceforge.net/projects/polyclipping/" 20 | td_2_2 = "Clipper at angusj.com" 21 | url_2_2 = "%http://www.angusj.com/delphi/clipper.php" 22 | -------------------------------------------------------------------------------- /gerboweb/ansible/render.sh.j2: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | [ $# != 1 ] && exit 1 4 | ID=$1 5 | egrep -x -q '^[-0-9A-Za-z]{36}$'<<<"$ID" || exit 2 6 | 7 | systemd-nspawn \ 8 | -D {{gerboweb_root}} \ 9 | -x --bind={{gerboweb_cache}}/upload/$ID:/mnt \ 10 | /bin/sh -c "set -euo pipefail 11 | unzip -j -d /tmp/gerber /mnt/gerber.zip 12 | rm -f /mnt/template_top.svg /mnt/template_bottom.svg /mnt/template_top.preview.png /mnt/template_bottom.preview.png 13 | date; echo 'Rendering' 14 | gerbolyze template --top /mnt/template_top.svg --bottom /mnt/template_bottom.svg /tmp/gerber 15 | date; echo 'Scaling down' 16 | convert /mnt/template_top.svg -resize 500x500 -negate -brightness-contrast 30x30 -colorspace gray /mnt/template_top.preview.png 17 | convert /mnt/template_bottom.svg -resize 500x500 -negate -brightness-contrast 30x30 -colorspace gray /mnt/template_bottom.preview.png 18 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hello SyntaxHighlighter 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |

Hello SyntaxHighlighter

15 |
16 | function helloSyntaxHighlighter()
17 | {
18 | 	return "hi!";
19 | }
20 | 
21 | 22 | 23 | -------------------------------------------------------------------------------- /gerboweb/develop-startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | cd /gerbolyze/gerbonara 6 | echo "### Setting up gerbonara ###" 7 | # newer pip is buggy and just crashes so we pinned an old version. 8 | # python packaging infrastructure is such an incoherent, buggy mess 9 | # also ignore the running pip as root warning, it's dumb and here we actually want to do just that. 10 | python3 -m pip --disable-pip-version-check install . 11 | cd /gerbolyze 12 | echo "### Setting up gerbolyze ###" 13 | python3 -m pip --disable-pip-version-check install . 14 | 15 | export PATH=$PATH:$HOME/.cargo/bin 16 | cd /gerbolyze/gerboweb 17 | echo "### Launching app ###" 18 | tmux new-session -d -s dev env GERBOWEB_SETTINGS=gerboweb-develop.cfg FLASK_APP=gerboweb.py flask run -h 0.0.0.0 19 | tmux bind -n C-q kill-session 20 | tmux rename-window gerboweb 21 | tmux split-window -t 0 -v python3 job_processor.py /var/cache/job_queue.sqlite3 22 | tmux attach 23 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/scripts/shBrushPlain.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | }; 25 | 26 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 27 | Brush.aliases = ['text', 'plain']; 28 | 29 | SyntaxHighlighter.brushes.Plain = Brush; 30 | 31 | // CommonJS 32 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 33 | })(); 34 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/cpp/cpp_cairo/cairo.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual C++ Express 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cairo", "cairo.vcxproj", "{6AFBCA2B-9262-6D28-7506-E13747347388}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {6AFBCA2B-9262-6D28-7506-E13747347388}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {6AFBCA2B-9262-6D28-7506-E13747347388}.Debug|Win32.Build.0 = Debug|Win32 14 | {6AFBCA2B-9262-6D28-7506-E13747347388}.Release|Win32.ActiveCfg = Release|Win32 15 | {6AFBCA2B-9262-6D28-7506-E13747347388}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /svg-flatten/svg-flatten-wasi-ci.yml: -------------------------------------------------------------------------------- 1 | 2 | build:svg-flatten-wasi: 3 | stage: build 4 | image: "registry.gitlab.com/gerbolyze/build-containers/archlinux:latest" 5 | script: 6 | - git config --global --add safe.directory "$CI_PROJECT_DIR" 7 | - cd svg-flatten # we start out in the repo's root 8 | - make -j 2 build/svg-flatten.wasm 9 | - cp build/svg-flatten.wasm svg_flatten_wasi/ 10 | - python3 setup.py bdist_wheel 11 | - cd .. 12 | artifacts: 13 | name: "gerbolyze-$CI_COMMIT_REF_NAME-svg-flatten-wasi" 14 | paths: 15 | - svg-flatten/dist/*.whl 16 | 17 | publish:svg-flatten-wasi: 18 | stage: publish 19 | variables: 20 | GIT_SUBMODULE_STRATEGY: none 21 | image: "registry.gitlab.com/gerbolyze/build-containers/archlinux:latest" 22 | cache: {} 23 | script: 24 | - pip install -U --user --break-system-packages twine 25 | - export TWINE_USERNAME TWINE_PASSWORD 26 | - twine upload svg-flatten/dist/* 27 | dependencies: 28 | - build:svg-flatten-wasi 29 | only: 30 | - /^v.*$/ 31 | -------------------------------------------------------------------------------- /export_previews.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import multiprocessing as mp 4 | import subprocess 5 | import pathlib 6 | 7 | import click 8 | from tqdm import tqdm 9 | 10 | def process_file(indir, outdir, inpath): 11 | outpath = outdir / inpath.relative_to(indir).with_suffix('.png') 12 | outpath.parent.mkdir(parents=True, exist_ok=True) 13 | subprocess.run(['resvg', '--export-id', 'g-top-copper', '--width', '1000', inpath, outpath], 14 | check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) 15 | 16 | @click.command() 17 | @click.argument('indir', type=click.Path(exists=True, file_okay=False, dir_okay=True, path_type=pathlib.Path)) 18 | def export(indir): 19 | jobs = list(indir.glob('svg/**/*.svg')) 20 | with tqdm(total = len(jobs)) as tq: 21 | with mp.Pool() as pool: 22 | results = [ pool.apply_async(process_file, (indir / 'svg', indir / 'png', path), callback=lambda _res: tq.update(1)) for path in jobs ] 23 | results = [ res.get() for res in results ] 24 | 25 | if __name__ == '__main__': 26 | export() 27 | -------------------------------------------------------------------------------- /gerboweb/Containerfile: -------------------------------------------------------------------------------- 1 | FROM docker.io/archlinux:latest 2 | MAINTAINER gerbolyze@jaseg.de 3 | RUN pacman --noconfirm -Syu 4 | RUN pacman --noconfirm -Sy pugixml opencv pango cairo git python make clang cargo python-pip base-devel gerbv rsync tmux uwsgi uwsgi-plugin-python 5 | RUN cargo install usvg resvg 6 | RUN python3 -m pip install pip==21.3.1 7 | RUN python3 -m pip install flask numpy lxml wasmtime svg_flatten_wasi resvg_wasi flask_wtf 8 | RUN --mount=type=bind,rw,destination=/git \ 9 | cd /git/gerbonara && \ 10 | python3 -m pip --disable-pip-version-check install . && \ 11 | cd /git && \ 12 | python3 -m pip --disable-pip-version-check install . 13 | RUN mkdir /gerboweb 14 | ADD ["gerboweb/uwsgi-gerboweb.ini","gerboweb/gerboweb.py","gerboweb/job_processor.py","gerboweb/job_queue.py","/gerboweb/"] 15 | ADD ["gerboweb/static","/gerboweb/static"] 16 | ADD ["gerboweb/templates","/gerboweb/templates"] 17 | ADD gerboweb/gerboweb_prod.cfg /gerboweb/gerboweb.cfg 18 | RUN mkdir /var/cache/gerboweb 19 | ENTRYPOINT uwsgi --ini /gerboweb/uwsgi-gerboweb.ini --chmod-socket=660 --socket=/run/uwsgi/socket 20 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0) 2 | PROJECT(polyclipping) 3 | 4 | SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Release type") 5 | # The header name clipper.hpp is too generic, so install in a subdirectory 6 | SET(CMAKE_INSTALL_INCDIR "${CMAKE_INSTALL_PREFIX}/include/polyclipping") 7 | SET(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") 8 | SET(CMAKE_INSTALL_PKGCONFIGDIR "${CMAKE_INSTALL_PREFIX}/share/pkgconfig") 9 | SET(PCFILE "${CMAKE_CURRENT_BINARY_DIR}/polyclipping.pc") 10 | 11 | SET(BUILD_SHARED_LIBS ON CACHE BOOL 12 | "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)") 13 | ADD_LIBRARY(polyclipping clipper.cpp) 14 | 15 | CONFIGURE_FILE (polyclipping.pc.cmakein "${PCFILE}" @ONLY) 16 | 17 | INSTALL (FILES clipper.hpp DESTINATION "${CMAKE_INSTALL_INCDIR}") 18 | INSTALL (TARGETS polyclipping LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") 19 | INSTALL (FILES "${PCFILE}" DESTINATION "${CMAKE_INSTALL_PKGCONFIGDIR}") 20 | 21 | SET_TARGET_PROPERTIES(polyclipping PROPERTIES VERSION 22.0.0 SOVERSION 22 ) 22 | -------------------------------------------------------------------------------- /svg-flatten/src/util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gerbolyze, a vector image preprocessing toolchain 3 | * Copyright (C) 2021 Jan Sebastian Götte 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Affero General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Affero General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace gerbolyze { 25 | int run_cargo_command(const char *cmd_name, std::vector &cmdline, const char *envvar); 26 | } 27 | 28 | -------------------------------------------------------------------------------- /export_protoboards.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import multiprocessing as mp 4 | import subprocess 5 | import pathlib 6 | 7 | import click 8 | from tqdm import tqdm 9 | 10 | def process_file(indir, outdir, inpath): 11 | outpath = outdir / inpath.relative_to(indir).with_suffix('.zip') 12 | outpath.parent.mkdir(parents=True, exist_ok=True) 13 | subprocess.run('python3 -m gerbolyze convert --zip --pattern-complete-tiles-only --use-apertures-for-patterns'.split() + [inpath, outpath], 14 | check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) 15 | 16 | @click.command() 17 | @click.argument('indir', type=click.Path(exists=True, file_okay=False, dir_okay=True, path_type=pathlib.Path)) 18 | def export(indir): 19 | jobs = list(indir.glob('svg/**/*.svg')) 20 | with tqdm(total = len(jobs)) as tq: 21 | with mp.Pool() as pool: 22 | results = [ pool.apply_async(process_file, (indir / 'svg', indir / 'gerber', path), callback=lambda _res: tq.update(1)) for path in jobs ] 23 | results = [ res.get() for res in results ] 24 | 25 | if __name__ == '__main__': 26 | export() 27 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/compass/shThemeMDUltra.scss: -------------------------------------------------------------------------------- 1 | // MDUltra SyntaxHighlighter theme based on Midnight Theme 2 | // http://www.mddev.co.uk/ 3 | 4 | $background: #222222 !default; 5 | 6 | $line_highlighted_background: #253e5a !default; 7 | $line_highlighted_number: white !default; 8 | 9 | $gutter_text: #38566f !default; 10 | $gutter_border_color: #435a5f !default; 11 | 12 | $toolbar_collapsed_a: #428bdd !default; 13 | $toolbar_collapsed_a_hover: lime !default; 14 | $toolbar_collapsed_background: black !default; 15 | 16 | $toolbar_a: #aaaaff !default; 17 | $toolbar_a_hover: #9ccff4 !default; 18 | 19 | $code_plain: lime !default; 20 | $code_comments: #428bdd !default; 21 | $code_string: lime !default; 22 | $code_keyword: #aaaaff !default; 23 | $code_preprocessor: #8aa6c1 !default; 24 | $code_variable: aqua !default; 25 | $code_value: #f7e741 !default; 26 | $code_functions: #ff8000 !default; 27 | $code_constants: yellow !default; 28 | $code_color1: red !default; 29 | $code_color2: yellow !default; 30 | $code_color3: #ffaa3e !default; 31 | 32 | @import "_theme_template.scss"; 33 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/compass/shThemeEmacs.scss: -------------------------------------------------------------------------------- 1 | // Emacs SyntaxHighlighter theme based on theme by Joshua Emmons 2 | // http://www.skia.net/ 3 | 4 | $background: black !default; 5 | 6 | $line_highlighted_background: #2A3133 !default; 7 | $line_highlighted_number: white !default; 8 | 9 | $gutter_text: #d3d3d3 !default; 10 | $gutter_border_color: #990000 !default; 11 | 12 | $toolbar_collapsed_a: #ebdb8d !default; 13 | $toolbar_collapsed_a_hover: #ff7d27 !default; 14 | $toolbar_collapsed_background: black !default; 15 | 16 | $toolbar_a: #fff !default; 17 | $toolbar_a_hover: #9ccff4 !default; 18 | 19 | $code_plain: #d3d3d3 !default; 20 | $code_comments: #ff7d27 !default; 21 | $code_string: #ff9e7b !default; 22 | $code_keyword: aqua !default; 23 | $code_preprocessor: #aec4de !default; 24 | $code_variable: #ffaa3e !default; 25 | $code_value: #009900 !default; 26 | $code_functions: #81cef9 !default; 27 | $code_constants: #ff9e7b !default; 28 | $code_color1: #ebdb8d !default; 29 | $code_color2: #ff7d27 !default; 30 | $code_color3: #aec4de !default; 31 | 32 | @import "_theme_template.scss"; 33 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/compass/shThemeMidnight.scss: -------------------------------------------------------------------------------- 1 | // Midnight SyntaxHighlighter theme based on theme by J.D. Myers 2 | // http://webdesign.lsnjd.com/ 3 | 4 | $background: #0f192a !default; 5 | 6 | $line_highlighted_background: #253e5a !default; 7 | $line_highlighted_number: #38566f !default; 8 | 9 | $gutter_text: #afafaf !default; 10 | $gutter_border_color: #435a5f !default; 11 | 12 | $toolbar_collapsed_a: #428bdd !default; 13 | $toolbar_collapsed_a_hover: #1dc116 !default; 14 | $toolbar_collapsed_background: #000 !default; 15 | 16 | $toolbar_a: #D1EDFF !default; 17 | $toolbar_a_hover: #8aa6c1 !default; 18 | 19 | $code_plain: #d1edff !default; 20 | $code_comments: #428bdd !default; 21 | $code_string: #1dc116 !default; 22 | $code_keyword: #b43d3d !default; 23 | $code_preprocessor: #8aa6c1 !default; 24 | $code_variable: #ffaa3e !default; 25 | $code_value: #f7e741 !default; 26 | $code_functions: #ffaa3e !default; 27 | $code_constants: #e0e8ff !default; 28 | $code_color1: #f8bb00 !default; 29 | $code_color2: white !default; 30 | $code_color3: #ffaa3e !default; 31 | 32 | @import "_theme_template.scss"; 33 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/compass/shThemeRDark.scss: -------------------------------------------------------------------------------- 1 | // RDark SyntaxHighlighter theme based on theme by Radu Dineiu 2 | // http://www.vim.org/scripts/script.php?script_id=1732 3 | 4 | $background: #1b2426 !default; 5 | 6 | $line_highlighted_background: #323E41 !default; 7 | $line_highlighted_number: #b9bdb6 !default; 8 | 9 | $gutter_text: #afafaf !default; 10 | $gutter_border_color: #435a5f !default; 11 | 12 | $toolbar_collapsed_a: #5ba1cf !default; 13 | $toolbar_collapsed_a_hover: #5ce638 !default; 14 | $toolbar_collapsed_background: #000 !default; 15 | 16 | $toolbar_a: #fff !default; 17 | $toolbar_a_hover: #e0e8ff !default; 18 | 19 | $code_plain: #b9bdb6 !default; 20 | $code_comments: #878a85 !default; 21 | $code_string: #5ce638 !default; 22 | $code_keyword: #5ba1cf !default; 23 | $code_preprocessor: #435a5f !default; 24 | $code_variable: #ffaa3e !default; 25 | $code_value: #009900 !default; 26 | $code_functions: #ffaa3e !default; 27 | $code_constants: #e0e8ff !default; 28 | $code_color1: #e0e8ff !default; 29 | $code_color2: white !default; 30 | $code_color3: #ffaa3e !default; 31 | 32 | @import "_theme_template.scss"; 33 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "upstream/cpp-base64"] 2 | path = upstream/cpp-base64 3 | url = https://gitlab.com/gerbolyze/gerbolyze-cpp-base64.git 4 | [submodule "upstream/voronoi"] 5 | path = upstream/voronoi 6 | url = https://github.com/JCash/voronoi 7 | [submodule "upstream/poisson-disk-sampling"] 8 | path = upstream/poisson-disk-sampling 9 | url = https://github.com/thinks/poisson-disk-sampling 10 | [submodule "upstream/argagg"] 11 | path = upstream/argagg 12 | url = https://gitlab.com/gerbolyze/gerbolyze-argagg.git 13 | [submodule "upstream/CavalierContours"] 14 | path = upstream/CavalierContours 15 | url = https://github.com/jbuckmccready/CavalierContours 16 | [submodule "upstream/subprocess.h"] 17 | path = upstream/subprocess.h 18 | url = https://github.com/sheredom/subprocess.h 19 | [submodule "svg-flatten/upstream/minunit"] 20 | path = upstream/minunit 21 | url = https://github.com/siu/minunit 22 | [submodule "upstream/stb"] 23 | path = upstream/stb 24 | url = https://github.com/nothings/stb 25 | [submodule "upstream/filesystem"] 26 | path = upstream/filesystem 27 | url = https://github.com/gulrak/filesystem 28 | [submodule "upstream/pugixml"] 29 | path = upstream/pugixml 30 | url = https://github.com/zeux/pugixml 31 | -------------------------------------------------------------------------------- /run-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | while [ $# -gt 0 ]; do 6 | case $1 in 7 | --parallel) 8 | CONTAINER_ARGS="--workers auto $CONTAINER_ARGS" 9 | shift;; 10 | -x) 11 | CONTAINER_ARGS="-x $CONTAINER_ARGS" 12 | shift;; 13 | --no-cache) 14 | NO_CACHE=--no-cache 15 | shift;; 16 | *) 17 | echo "Unknown argument \"$1\"" 18 | exit 1 19 | shift;; 20 | esac 21 | done 22 | 23 | make -C svg-flatten -j build/svg-flatten.wasm 24 | 25 | rm -rf podman/testdata/git 26 | mkdir -p podman/testdata/git 27 | git clone --depth 1 . podman/testdata/git 28 | git ls-tree --full-tree -r HEAD --name-only | rsync -lptgoD --delete . --files-from - podman/testdata/git/ 29 | rsync -a --delete svg-flatten/build/svg-flatten.wasm podman/testdata/git/svg-flatten/build/ 30 | 31 | for distro in ubuntu arch 32 | do 33 | podman build $NO_CACHE -t gerbonara-$distro-testenv -f podman/$distro-testenv 34 | mkdir -p /tmp/gerbonara-test-out 35 | podman run --mount type=bind,src=podman/testdata,dst=/data,ro --mount type=bind,src=/tmp/gerbonara-test-out,dst=/out gerbonara-$distro-testenv /data/testscript.sh $CONTAINER_ARGS 36 | done 37 | 38 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/compass/shThemeDjango.scss: -------------------------------------------------------------------------------- 1 | // Django SyntaxHighlighter theme 2 | 3 | $background: #0a2b1d !default; 4 | 5 | $line_highlighted_background: #233729 !default; 6 | $line_highlighted_number: white !default; 7 | 8 | $gutter_text: #497958 !default; 9 | $gutter_border_color: #41a83e !default; 10 | 11 | $toolbar_collapsed_a: #96dd3b !default; 12 | $toolbar_collapsed_a_hover: #fff !default; 13 | $toolbar_collapsed_background: #000 !default; 14 | 15 | $toolbar_a: #fff !default; 16 | $toolbar_a_hover: #ffe862 !default; 17 | 18 | $code_plain: #f8f8f8 !default; 19 | $code_comments: #336442 !default; 20 | $code_string: #9df39f !default; 21 | $code_keyword: #96dd3b !default; 22 | $code_preprocessor: #91bb9e !default; 23 | $code_variable: #ffaa3e !default; 24 | $code_value: #f7e741 !default; 25 | $code_functions: #ffaa3e !default; 26 | $code_constants: #e0e8ff !default; 27 | $code_color1: #eb939a !default; 28 | $code_color2: #91bb9e !default; 29 | $code_color3: #edef7d !default; 30 | 31 | @import "_theme_template.scss"; 32 | 33 | .syntaxhighlighter { 34 | .comments { font-style: italic !important; } 35 | .keyword { font-weight: bold !important; } 36 | } 37 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/compass/shThemeFadeToGrey.scss: -------------------------------------------------------------------------------- 1 | // Fade to Grey SyntaxHighlighter theme based on theme by Brasten Sager 2 | // :http//www.ibrasten.com/ 3 | 4 | $background: #121212 !default; 5 | 6 | $line_highlighted_background: #2C2C29 !default; 7 | $line_highlighted_number: white !default; 8 | 9 | $gutter_text: #afafaf !default; 10 | $gutter_border_color: #3185b9 !default; 11 | 12 | $toolbar_collapsed_a: #3185b9 !default; 13 | $toolbar_collapsed_a_hover: #d01d33 !default; 14 | $toolbar_collapsed_background: black !default; 15 | 16 | $toolbar_a: #fff !default; 17 | $toolbar_a_hover: #96daff !default; 18 | 19 | $code_plain: white !default; 20 | $code_comments: #696854 !default; 21 | $code_string: #e3e658 !default; 22 | $code_keyword: #d01d33 !default; 23 | $code_preprocessor: #435a5f !default; 24 | $code_variable: #898989 !default; 25 | $code_value: #009900 !default; 26 | $code_functions: #aaaaaa !default; 27 | $code_constants: #96daff !default; 28 | $code_color1: #ffc074 !default; 29 | $code_color2: #4a8cdb !default; 30 | $code_color3: #96daff !default; 31 | 32 | @import "_theme_template.scss"; 33 | 34 | .syntaxhighlighter { 35 | .functions { font-weight: bold !important; } 36 | } 37 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/scripts/shBrushDiff.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | this.regexList = [ 25 | { regex: /^\+\+\+.*$/gm, css: 'color2' }, 26 | { regex: /^\-\-\-.*$/gm, css: 'color2' }, 27 | { regex: /^\s.*$/gm, css: 'color1' }, 28 | { regex: /^@@.*@@$/gm, css: 'variable' }, 29 | { regex: /^\+[^\+]{1}.*$/gm, css: 'string' }, 30 | { regex: /^\-[^\-]{1}.*$/gm, css: 'comments' } 31 | ]; 32 | }; 33 | 34 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 35 | Brush.aliases = ['diff', 'patch']; 36 | 37 | SyntaxHighlighter.brushes.Diff = Brush; 38 | 39 | // CommonJS 40 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 41 | })(); 42 | -------------------------------------------------------------------------------- /svg-flatten/src/lambda_sink.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gerbolyze, a vector image preprocessing toolchain 3 | * Copyright (C) 2021 Jan Sebastian Götte 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Affero General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Affero General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | using namespace gerbolyze; 26 | using namespace std; 27 | 28 | LambdaPolygonSink& LambdaPolygonSink::operator<<(const Polygon &poly) { 29 | m_lambda(poly, m_currentPolarity); 30 | return *this; 31 | } 32 | 33 | LambdaPolygonSink& LambdaPolygonSink::operator<<(GerberPolarityToken pol) { 34 | m_currentPolarity = pol; 35 | return *this; 36 | } 37 | -------------------------------------------------------------------------------- /svg-flatten/src/svg_path.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gerbolyze, a vector image preprocessing toolchain 3 | * Copyright (C) 2021 Jan Sebastian Götte 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Affero General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Affero General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include "svg_geom.h" 23 | #include "geom2d.hpp" 24 | 25 | namespace gerbolyze { 26 | void load_svg_path(const pugi::xml_node &node, ClipperLib::Paths &stroke_open, ClipperLib::Paths &stroke_closed, ClipperLib::PolyTree &ptree_fill, double geometric_tolerance_px); 27 | void parse_dasharray(const pugi::xml_node &node, std::vector &out); 28 | void dash_path(const ClipperLib::Path &in, ClipperLib::Paths &out, const std::vector dasharray, double dash_offset=0.0); 29 | } 30 | 31 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/License.txt: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | http://www.boost.org/LICENSE_1_0.txt 3 | 4 | Permission is hereby granted, free of charge, to any person or organization 5 | obtaining a copy of the software and accompanying documentation covered by 6 | this license (the "Software") to use, reproduce, display, distribute, 7 | execute, and transmit the Software, and to prepare derivative works of the 8 | Software, and to permit third-parties to whom the Software is furnished to 9 | do so, all subject to the following: 10 | 11 | The copyright notices in the Software and this entire statement, including 12 | the above license grant, this restriction and the following disclaimer, 13 | must be included in all copies of the Software, in whole or in part, and 14 | all derivative works of the Software, unless such copies or derivative 15 | works are solely in the form of machine-executable object code generated by 16 | a source language processor. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 21 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 22 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 23 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 24 | DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /svg-flatten/src/vec_grid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gerbolyze, a vector image preprocessing toolchain 3 | * Copyright (C) 2021 Jan Sebastian Götte 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Affero General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Affero General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | namespace gerbolyze { 27 | 28 | enum grid_type { 29 | POISSON_DISC, 30 | HEXGRID, 31 | SQUAREGRID 32 | }; 33 | 34 | sampling_fun get_sampler(enum grid_type type); 35 | 36 | std::vector *sample_poisson_disc(double w, double h, double center_distance); 37 | std::vector *sample_hexgrid(double w, double h, double center_distance); 38 | std::vector *sample_squaregrid(double w, double h, double center_distance); 39 | 40 | } /* namespace gerbolyze */ 41 | 42 | -------------------------------------------------------------------------------- /svg-flatten/testdata/svg/stroke_dashes_comparison.svg: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 21 | 28 | 35 | 42 | 49 | 50 | -------------------------------------------------------------------------------- /svg-flatten/src/svg_geom.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gerbolyze, a vector image preprocessing toolchain 3 | * Copyright (C) 2021 Jan Sebastian Götte 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Affero General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Affero General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace gerbolyze { 25 | 26 | ClipperLib::IntRect get_paths_bounds(const ClipperLib::Paths &paths); 27 | enum ClipperLib::PolyFillType clipper_fill_rule(const pugi::xml_node &node); 28 | enum ClipperLib::EndType clipper_end_type(const pugi::xml_node &node); 29 | enum ClipperLib::JoinType clipper_join_type(const pugi::xml_node &node); 30 | void dehole_polytree(ClipperLib::PolyTree &ptree, ClipperLib::Paths &out); 31 | void combine_clip_paths(ClipperLib::Paths &in_a, ClipperLib::Paths &in_b, ClipperLib::Paths &out); 32 | 33 | } /* namespace gerbolyze */ 34 | 35 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/scripts/shAutoloader.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(2(){1 h=5;h.I=2(){2 n(c,a){4(1 d=0;d 2 | 14 | 33 | 35 | 37 | 38 | 47 | 48 | -------------------------------------------------------------------------------- /svg-flatten/src/svg_pattern.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gerbolyze, a vector image preprocessing toolchain 3 | * Copyright (C) 2021 Jan Sebastian Götte 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Affero General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Affero General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | #include "svg_import_util.h" 27 | #include "geom2d.hpp" 28 | 29 | namespace gerbolyze { 30 | 31 | class SVGDocument; 32 | class RenderSettings; 33 | class RenderContext; 34 | 35 | class Pattern { 36 | public: 37 | Pattern() {} 38 | Pattern(const pugi::xml_node &node, SVGDocument &doc); 39 | 40 | void tile (RenderContext &ctx); 41 | 42 | private: 43 | double x, y, w, h; 44 | double vb_x, vb_y, vb_w, vb_h; 45 | bool has_vb; 46 | xform2d patternTransform; 47 | xform2d patternTransform_inv; 48 | enum RelativeUnits patternUnits; 49 | enum RelativeUnits patternContentUnits; 50 | const pugi::xml_node m_node; 51 | SVGDocument *doc = nullptr; 52 | }; 53 | 54 | } /* namespace gerbolyze */ 55 | 56 | -------------------------------------------------------------------------------- /svg-flatten/setup.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | from setuptools import setup, find_packages 3 | from pathlib import Path 4 | import re 5 | import shutil 6 | 7 | def version(): 8 | res = subprocess.run(['git', 'describe', '--tags', '--match', 'v*'], capture_output=True, check=True, text=True) 9 | version, _, _rest = res.stdout.strip()[1:].partition('-') 10 | return version 11 | 12 | def long_description(): 13 | with open("README.rst") as f: 14 | return f.read() 15 | 16 | setup( 17 | name="svg-flatten-wasi", 18 | version=version(), 19 | author="jaseg", 20 | author_email="pypi@jaseg.de", 21 | description="svg-flatten SVG downconverter", 22 | long_description=long_description(), 23 | long_description_content_type="text/x-rst", 24 | license="AGPLv3+", 25 | python_requires="~=3.7", 26 | setup_requires=["wheel"], 27 | install_requires=[ 28 | "importlib_resources; python_version<'3.9'", 29 | "appdirs~=1.4", 30 | "wasmtime>=0.28", 31 | "click >= 4.0" 32 | ], 33 | extras_require={ 34 | 'resvg-wasi': ['resvg-wasi'], 35 | }, 36 | packages=["svg_flatten_wasi"], 37 | package_data={"svg_flatten_wasi": [ 38 | "*.wasm", 39 | ]}, 40 | entry_points={ 41 | "console_scripts": [ 42 | "wasi-svg-flatten = svg_flatten_wasi:run_svg_flatten", 43 | ], 44 | }, 45 | project_urls={ 46 | "Source Code": "https://git.jaseg.de/gerbolyze", 47 | "Bug Tracker": "https://github.com/jaseg/gerbolyze/issues", 48 | }, 49 | classifiers=[ 50 | 'Development Status :: 5 - Production/Stable', 51 | 'Environment :: Console', 52 | "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", 53 | 'Topic :: Utilities' 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /svg-flatten/src/svg_import_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gerbolyze, a vector image preprocessing toolchain 3 | * Copyright (C) 2021 Jan Sebastian Götte 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Affero General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Affero General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | 34 | #include 35 | 36 | #include "svg_import_defs.h" 37 | 38 | namespace gerbolyze { 39 | 40 | /* Coordinate system selection for things like "patternContentUnits" */ 41 | enum RelativeUnits { 42 | SVG_UnknownUnits = 0, 43 | SVG_UserSpaceOnUse, 44 | SVG_ObjectBoundingBox, 45 | }; 46 | 47 | double usvg_double_attr(const pugi::xml_node &node, const char *attr, double default_value=0.0); 48 | std::string usvg_id_url(std::string attr); 49 | RelativeUnits map_str_to_units(std::string str, RelativeUnits default_val=SVG_UnknownUnits); 50 | std::string parse_data_iri(const std::string &data_url); 51 | 52 | } /* namespace gerbolyze */ 53 | 54 | -------------------------------------------------------------------------------- /svg-flatten/testdata/svg/empty_inkscape.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 38 | 40 | 41 | 43 | image/svg+xml 44 | 46 | 47 | 48 | 49 | 50 | 51 | 55 | 56 | -------------------------------------------------------------------------------- /svg-flatten/src/svg_color.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gerbolyze, a vector image preprocessing toolchain 3 | * Copyright (C) 2021 Jan Sebastian Götte 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Affero General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Affero General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace gerbolyze { 25 | 26 | /* Enum that describes the color with which an SVG primite should be exported */ 27 | enum gerber_color { 28 | GRB_NONE = 0, 29 | GRB_CLEAR, 30 | GRB_DARK, 31 | GRB_PATTERN_FILL, 32 | }; 33 | 34 | class RGBAColor { 35 | public: 36 | float r, g, b, a; 37 | RGBAColor(std::string spec); 38 | }; 39 | 40 | class HSVColor { 41 | public: 42 | float h, s, v; 43 | HSVColor(const RGBAColor &color); 44 | }; 45 | 46 | enum gerber_color svg_color_to_gerber(std::string color, std::string opacity, enum gerber_color default_val, const RenderSettings &rset); 47 | enum gerber_color gerber_color_invert(enum gerber_color color); 48 | enum gerber_color gerber_fill_color(const pugi::xml_node &node, const RenderSettings &rset); 49 | enum gerber_color gerber_stroke_color(const pugi::xml_node &node, const RenderSettings &rset); 50 | 51 | } /* namespace gerbolyze */ 52 | 53 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/scripts/shBrushJScript.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'break case catch continue ' + 25 | 'default delete do else false ' + 26 | 'for function if in instanceof ' + 27 | 'new null return super switch ' + 28 | 'this throw true try typeof var while with' 29 | ; 30 | 31 | var r = SyntaxHighlighter.regexLib; 32 | 33 | this.regexList = [ 34 | { regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings 35 | { regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings 36 | { regex: r.singleLineCComments, css: 'comments' }, // one line comments 37 | { regex: r.multiLineCComments, css: 'comments' }, // multiline comments 38 | { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion 39 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords 40 | ]; 41 | 42 | this.forHtmlScript(r.scriptScriptTags); 43 | }; 44 | 45 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 46 | Brush.aliases = ['js', 'jscript', 'javascript']; 47 | 48 | SyntaxHighlighter.brushes.JScript = Brush; 49 | 50 | // CommonJS 51 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 52 | })(); 53 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/scripts/shLegacy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('3 u={8:{}};u.8={A:4(c,k,l,m,n,o){4 d(a,b){2 a!=1?a:b}4 f(a){2 a!=1?a.E():1}c=c.I(":");3 g=c[0],e={};t={"r":K};M=1;5=8.5;9(3 j R c)e[c[j]]="r";k=f(d(k,5.C));l=f(d(l,5.D));m=f(d(m,5.s));o=f(d(o,5.Q));n=f(d(n,5["x-y"]));2{P:g,C:d(t[e.O],k),D:d(t[e.N],l),s:d({"r":r}[e.s],m),"x-y":d(4(a,b){9(3 h=T S("^"+b+"\\\\[(?\\\\w+)\\\\]$","U"),i=1,p=0;p 6 | * Copyright (C) 2018-2019 KiCad Developers, see AUTHORS.txt for contributors. 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, you may find one here: 20 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 21 | * or you may search the http://www.gnu.org website for the version 2 license, 22 | * or you may write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 24 | */ 25 | 26 | #ifndef SVG_IMPORT_DEFS_H 27 | #define SVG_IMPORT_DEFS_H 28 | 29 | #include 30 | 31 | template 32 | constexpr T ipow(T num, unsigned int pow) 33 | { 34 | return (pow >= sizeof(unsigned int)*8) ? 0 : 35 | pow == 0 ? 1 : num * ipow(num, pow-1); 36 | } 37 | 38 | constexpr int CAIRO_PRECISION = 7; 39 | constexpr double clipper_scale = ipow(10.0, CAIRO_PRECISION); 40 | 41 | #define JC_VORONOI_IMPLEMENTATION 42 | #define JCV_REAL_TYPE double 43 | #define JCV_ATAN2 atan2 44 | #define JCV_SQRT sqrt 45 | #define JCV_FLT_MAX DBL_MAX 46 | #define JCV_PI 3.141592653589793115997963468544185161590576171875 47 | //define JCV_EDGE_INTERSECT_THRESHOLD 1.0e-10F 48 | 49 | #endif /* SVG_IMPORT_DEFS_H */ 50 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/scripts/shBrushErlang.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Jean-Lou Dupont 25 | // http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html 26 | 27 | // According to: http://erlang.org/doc/reference_manual/introduction.html#1.5 28 | var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+ 29 | 'case catch cond div end fun if let not of or orelse '+ 30 | 'query receive rem try when xor'+ 31 | // additional 32 | ' module export import define'; 33 | 34 | this.regexList = [ 35 | { regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' }, 36 | { regex: new RegExp("\\%.+", 'gm'), css: 'comments' }, 37 | { regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' }, 38 | { regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' }, 39 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, 40 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, 41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } 42 | ]; 43 | }; 44 | 45 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 46 | Brush.aliases = ['erl', 'erlang']; 47 | 48 | SyntaxHighlighter.brushes.Erland = Brush; 49 | 50 | // CommonJS 51 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 52 | })(); 53 | -------------------------------------------------------------------------------- /svg-flatten/geom_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from math import * 4 | 5 | def calc(mat): 6 | [xx, yx], [xy, yy] = mat 7 | 8 | a = xx**2 + xy**2 9 | b = xx*yx + xy*yy 10 | c = yy**2 + yx**2 11 | 12 | print(f'{a=:.2f} {c=:.2f} {b=:.2f}') 13 | tan_2_alpha = 2*b/(a-c) 14 | print(f'atan2={atan2(2*b, a-c)/pi:.2f}*pi') 15 | #tan_alpha = tan_2_alpha / (1 + sqrt(1 + tan_2_alpha**2)) # FIXME: bounds? 16 | cos_2_alpha = 1/sqrt(1 + tan_2_alpha**2) 17 | sin_2_alpha = tan_2_alpha / sqrt(1 + tan_2_alpha**2) 18 | print(f'tan(2a)={tan_2_alpha:.2f} cos(2a)={cos_2_alpha:.2f} sin(2a)={sin_2_alpha:.2f}') 19 | cos_alpha = sqrt((1 + cos_2_alpha)/2) 20 | sin_alpha = sqrt((1 - cos_2_alpha)/2) 21 | print(f'cos(a)={cos_alpha:.2f} sin(a)={sin_alpha:.2f}') 22 | 23 | for sgn_cos, sgn_sin in [(-1, -1), (-1, 1), (1, -1), (1, 1)]: 24 | p = xx * sgn_cos * cos_alpha + yx * sgn_sin * sin_alpha 25 | q = xy * sgn_cos * cos_alpha + yy * sgn_sin * sin_alpha 26 | dist = hypot(p, q) 27 | yield dist 28 | 29 | def gen(sx, sy, m, theta): 30 | xx = sx * cos(theta) 31 | xy = sx * sin(theta) 32 | yy = sy * (cos(theta) + m * sin(theta)) 33 | yx = sy * (m * cos(theta) - sin(theta)) 34 | 35 | mat = [xx, yx], [xy, yy] 36 | return mat 37 | 38 | 39 | for sx, sy in [ 40 | (1, 0.9), 41 | (1, 1.0), 42 | (1, 1.1), 43 | (0.9, 1), 44 | (1.0, 1), 45 | (1.1, 1)]: 46 | for m in [0, 0.1, 1, 10]: 47 | for theta in [0, pi/8, pi/4, pi/3, pi/2, pi, 3*pi/4]: 48 | print(f'{sx=:.1f} {sy=:.1f} {m=:.1f} theta={theta/pi:.2f}*pi |', end=' ') 49 | mat = gen(sx, sy, m, theta) 50 | 51 | try: 52 | dists = list(calc(mat)) 53 | str_dists = ' '.join(f'{x:.2f}' for x in dists) 54 | print(f'[{str_dists}] | min={min(dists):.2f} max={max(dists):.2f}') 55 | except: 56 | print('E') 57 | break 58 | break 59 | break 60 | 61 | -------------------------------------------------------------------------------- /svg-flatten/testdata/svg/shear.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 31 | 51 | 52 | 60 | 61 | -------------------------------------------------------------------------------- /svg-flatten/include/flatten.hpp: -------------------------------------------------------------------------------- 1 | 2 | #include "gerbolyze.hpp" 3 | 4 | namespace gerbolyze { 5 | class curve3_div { 6 | public: 7 | curve3_div(double distance_tolerance=0.1, double angle_tolerance=0.0, double cusp_limit=0.0) 8 | : m_cusp_limit(cusp_limit), 9 | m_distance_tolerance_square(0.25*distance_tolerance*distance_tolerance), 10 | m_angle_tolerance(angle_tolerance) 11 | { 12 | } 13 | 14 | void run(double x1, double y1, double x2, double y2, double x3, double y3); 15 | const std::vector &points() { return m_points; } 16 | 17 | private: 18 | void recursive_bezier(double x1, double y1, double x2, double y2, 19 | double x3, double y3, 20 | unsigned level); 21 | double m_cusp_limit; 22 | double m_distance_tolerance_square; 23 | double m_angle_tolerance; 24 | std::vector m_points; 25 | }; 26 | 27 | class curve4_div { 28 | public: 29 | curve4_div(double distance_tolerance=0.1, double angle_tolerance=0.0, double cusp_limit=0.0) 30 | : m_cusp_limit(cusp_limit), 31 | m_distance_tolerance_square(0.25*distance_tolerance*distance_tolerance), 32 | m_angle_tolerance(angle_tolerance) 33 | { 34 | } 35 | 36 | void run(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4); 37 | const std::vector &points() { return m_points; } 38 | 39 | private: 40 | void recursive_bezier(double x1, double y1, double x2, double y2, 41 | double x3, double y3, double x4, double y4, 42 | unsigned level); 43 | double m_cusp_limit; 44 | double m_distance_tolerance_square; 45 | double m_angle_tolerance; 46 | std::vector m_points; 47 | }; 48 | } 49 | 50 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/scripts/shBrushScala.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Yegor Jbanov and David Bernard. 25 | 26 | var keywords = 'val sealed case def true trait implicit forSome import match object null finally super ' + 27 | 'override try lazy for var catch throw type extends class while with new final yield abstract ' + 28 | 'else do if return protected private this package false'; 29 | 30 | var keyops = '[_:=><%#@]+'; 31 | 32 | this.regexList = [ 33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 34 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 35 | { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // multi-line strings 36 | { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double-quoted string 37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 38 | { regex: /0x[a-f0-9]+|\d+(\.\d+)?/gi, css: 'value' }, // numbers 39 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords 40 | { regex: new RegExp(keyops, 'gm'), css: 'keyword' } // scala keyword 41 | ]; 42 | } 43 | 44 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 45 | Brush.aliases = ['scala']; 46 | 47 | SyntaxHighlighter.brushes.Scala = Brush; 48 | 49 | // CommonJS 50 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 51 | })(); 52 | -------------------------------------------------------------------------------- /svg-flatten/testdata/svg/rect.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 31 | 51 | 52 | 59 | 66 | 67 | -------------------------------------------------------------------------------- /svg-flatten/testdata/svg/rotation_90.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 31 | 51 | 52 | 59 | 67 | 68 | -------------------------------------------------------------------------------- /svg-flatten/testdata/svg/rotation.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 31 | 51 | 52 | 59 | 67 | 68 | -------------------------------------------------------------------------------- /svg-flatten/src/vec_core.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gerbolyze, a vector image preprocessing toolchain 3 | * Copyright (C) 2021 Jan Sebastian Götte 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Affero General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Affero General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | #include "vec_grid.h" 25 | 26 | namespace gerbolyze { 27 | 28 | class VoronoiVectorizer : public ImageVectorizer { 29 | public: 30 | VoronoiVectorizer(grid_type grid, bool relax=true) : m_relax(relax), m_grid_type(grid) {} 31 | 32 | virtual void vectorize_image(RenderContext &ctx, const pugi::xml_node &node, double min_feature_size_px); 33 | private: 34 | double m_relax; 35 | grid_type m_grid_type; 36 | }; 37 | 38 | class OpenCVContoursVectorizer : public ImageVectorizer { 39 | public: 40 | OpenCVContoursVectorizer() {} 41 | 42 | virtual void vectorize_image(RenderContext &ctx, const pugi::xml_node &node, double min_feature_size_px); 43 | }; 44 | 45 | class DevNullVectorizer : public ImageVectorizer { 46 | public: 47 | DevNullVectorizer() {} 48 | 49 | virtual void vectorize_image(RenderContext &, const pugi::xml_node &, double) {} 50 | }; 51 | 52 | void parse_img_meta(const pugi::xml_node &node, double &x, double &y, double &width, double &height); 53 | void draw_bg_rect(RenderContext &ctx, double width, double height); 54 | void handle_aspect_ratio(std::string spec, double &scale_x, double &scale_y, double &off_x, double &off_y, double cols, double rows); 55 | } 56 | 57 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/scripts/shBrushXml.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | function process(match, regexInfo) 25 | { 26 | var constructor = SyntaxHighlighter.Match, 27 | code = match[0], 28 | tag = new XRegExp('(<|<)[\\s\\/\\?]*(?[:\\w-\\.]+)', 'xg').exec(code), 29 | result = [] 30 | ; 31 | 32 | if (match.attributes != null) 33 | { 34 | var attributes, 35 | regex = new XRegExp('(? [\\w:\\-\\.]+)' + 36 | '\\s*=\\s*' + 37 | '(? ".*?"|\'.*?\'|\\w+)', 38 | 'xg'); 39 | 40 | while ((attributes = regex.exec(code)) != null) 41 | { 42 | result.push(new constructor(attributes.name, match.index + attributes.index, 'color1')); 43 | result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string')); 44 | } 45 | } 46 | 47 | if (tag != null) 48 | result.push( 49 | new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword') 50 | ); 51 | 52 | return result; 53 | } 54 | 55 | this.regexList = [ 56 | { regex: new XRegExp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'), css: 'color2' }, // 57 | { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // 58 | { regex: new XRegExp('(<|<)[\\s\\/\\?]*(\\w+)(?.*?)[\\s\\/\\?]*(>|>)', 'sg'), func: process } 59 | ]; 60 | }; 61 | 62 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 63 | Brush.aliases = ['xml', 'xhtml', 'xslt', 'html']; 64 | 65 | SyntaxHighlighter.brushes.Xml = Brush; 66 | 67 | // CommonJS 68 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 69 | })(); 70 | -------------------------------------------------------------------------------- /svg-flatten/testdata/svg/stroke.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 31 | 53 | 54 | 61 | 68 | 69 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/scripts/shBrushJava.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'abstract assert boolean break byte case catch char class const ' + 25 | 'continue default do double else enum extends ' + 26 | 'false final finally float for goto if implements import ' + 27 | 'instanceof int interface long native new null ' + 28 | 'package private protected public return ' + 29 | 'short static strictfp super switch synchronized this throw throws true ' + 30 | 'transient try void volatile while'; 31 | 32 | this.regexList = [ 33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 34 | { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments 35 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments 36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings 37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 38 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers 39 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno 40 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword 41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword 42 | ]; 43 | 44 | this.forHtmlScript({ 45 | left : /(<|<)%[@!=]?/g, 46 | right : /%(>|>)/g 47 | }); 48 | }; 49 | 50 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 51 | Brush.aliases = ['java']; 52 | 53 | SyntaxHighlighter.brushes.Java = Brush; 54 | 55 | // CommonJS 56 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 57 | })(); 58 | -------------------------------------------------------------------------------- /svg-flatten/testdata/svg/rect_xform.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 38 | 40 | 41 | 43 | image/svg+xml 44 | 46 | 47 | 48 | 49 | 50 | 55 | 59 | 63 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /gerboweb/ansible/gerboweb.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Setup gerboweb 3 | hosts: all 4 | tasks: 5 | - name: Set local facts 6 | set_fact: 7 | gerboweb_cache: /var/cache/gerboweb 8 | 9 | - name: Install packages into gerbolyze container 10 | pacman: 11 | name: python3,python-numpy,python-pip,imagemagick,pugixml,git,python,make,clang,rustup,cargo 12 | state: present 13 | 14 | - name: Setup usvg 15 | shell: cargo install usvg resvg 16 | args: 17 | creates: /usr/bin/usvg 18 | 19 | - name: Copy webapp sources 20 | git: 21 | repo: ../.. 22 | dest: /var/lib/gerboweb 23 | 24 | - name: Create uwsgi worker user and group 25 | user: 26 | name: uwsgi-gerboweb 27 | create_home: no 28 | group: uwsgi 29 | password: '!' 30 | shell: /sbin/nologin 31 | system: yes 32 | 33 | - name: Template webapp config 34 | template: 35 | src: gerboweb.cfg.j2 36 | dest: /var/lib/gerboweb/gerboweb_prod.cfg 37 | owner: uwsgi-gerboweb 38 | group: root 39 | mode: 0660 40 | 41 | - name: Copy uwsgi config 42 | copy: 43 | src: uwsgi-gerboweb.ini 44 | dest: /etc/uwsgi.d/gerboweb.ini 45 | owner: uwsgi-gerboweb 46 | group: uwsgi 47 | mode: 0440 48 | 49 | - name: Copy job processor systemd service config 50 | template: 51 | src: gerboweb-job-processor.service.j2 52 | dest: /etc/systemd/system/gerboweb-job-processor.service 53 | 54 | - name: Enable uwsgi systemd socket 55 | systemd: 56 | daemon-reload: yes 57 | name: uwsgi-app@gerboweb.socket 58 | enabled: yes 59 | 60 | - name: Copy gerboweb cache dir tmpfiles.d config 61 | template: 62 | src: tmpfiles-gerboweb.conf.j2 63 | dest: /etc/tmpfiles.d/gerboweb.conf 64 | owner: root 65 | group: root 66 | mode: 0644 67 | register: tmpfiles_config 68 | 69 | - name: Kick systemd tmpfiles service to create cache dir 70 | command: systemd-tmpfiles --create 71 | when: tmpfiles_config is changed 72 | 73 | - name: Create job queue db 74 | file: 75 | path: "{{gerboweb_cache}}/job_queue.sqlite3" 76 | owner: root 77 | group: uwsgi 78 | mode: 0660 79 | state: touch 80 | 81 | - name: Enable and launch job processor 82 | systemd: 83 | name: gerboweb-job-processor.service 84 | enabled: yes 85 | state: restarted 86 | 87 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/scripts/shBrushRuby.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Erik Peterson. 25 | 26 | var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' + 27 | 'END end ensure false for if in module new next nil not or raise redo rescue retry return ' + 28 | 'self super then throw true undef unless until when while yield'; 29 | 30 | var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' + 31 | 'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' + 32 | 'ThreadGroup Thread Time TrueClass'; 33 | 34 | this.regexList = [ 35 | { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments 36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings 37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings 38 | { regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // constants 39 | { regex: /:[a-z][A-Za-z0-9_]*/g, css: 'color2' }, // symbols 40 | { regex: /(\$|@@|@)\w+/g, css: 'variable bold' }, // $global, @instance, and @@class variables 41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords 42 | { regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color1' } // builtins 43 | ]; 44 | 45 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); 46 | }; 47 | 48 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 49 | Brush.aliases = ['ruby', 'rails', 'ror', 'rb']; 50 | 51 | SyntaxHighlighter.brushes.Ruby = Brush; 52 | 53 | // CommonJS 54 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 55 | })(); 56 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/scripts/shBrushJavaFX.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Patrick Webster 25 | // http://patrickwebster.blogspot.com/2009/04/javafx-brush-for-syntaxhighlighter.html 26 | var datatypes = 'Boolean Byte Character Double Duration ' 27 | + 'Float Integer Long Number Short String Void' 28 | ; 29 | 30 | var keywords = 'abstract after and as assert at before bind bound break catch class ' 31 | + 'continue def delete else exclusive extends false finally first for from ' 32 | + 'function if import in indexof init insert instanceof into inverse last ' 33 | + 'lazy mixin mod nativearray new not null on or override package postinit ' 34 | + 'protected public public-init public-read replace return reverse sizeof ' 35 | + 'step super then this throw true try tween typeof var where while with ' 36 | + 'attribute let private readonly static trigger' 37 | ; 38 | 39 | this.regexList = [ 40 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, 41 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, 42 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, 43 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, 44 | { regex: /(-?\.?)(\b(\d*\.?\d+|\d+\.?\d*)(e[+-]?\d+)?|0x[a-f\d]+)\b\.?/gi, css: 'color2' }, // numbers 45 | { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'variable' }, // datatypes 46 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } 47 | ]; 48 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); 49 | }; 50 | 51 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 52 | Brush.aliases = ['jfx', 'javafx']; 53 | 54 | SyntaxHighlighter.brushes.JavaFX = Brush; 55 | 56 | // CommonJS 57 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 58 | })(); 59 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/scripts/shBrushVb.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto ' + 25 | 'Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate ' + 26 | 'CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType ' + 27 | 'Date Decimal Declare Default Delegate Dim DirectCast Do Double Each ' + 28 | 'Else ElseIf End Enum Erase Error Event Exit False Finally For Friend ' + 29 | 'Function Get GetType GoSub GoTo Handles If Implements Imports In ' + 30 | 'Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module ' + 31 | 'MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing ' + 32 | 'NotInheritable NotOverridable Object On Option Optional Or OrElse ' + 33 | 'Overloads Overridable Overrides ParamArray Preserve Private Property ' + 34 | 'Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume ' + 35 | 'Return Select Set Shadows Shared Short Single Static Step Stop String ' + 36 | 'Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until ' + 37 | 'Variant When While With WithEvents WriteOnly Xor'; 38 | 39 | this.regexList = [ 40 | { regex: /'.*$/gm, css: 'comments' }, // one line comments 41 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings 42 | { regex: /^\s*#.*$/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion 43 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // vb keyword 44 | ]; 45 | 46 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); 47 | }; 48 | 49 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 50 | Brush.aliases = ['vb', 'vbnet']; 51 | 52 | SyntaxHighlighter.brushes.Vb = Brush; 53 | 54 | // CommonJS 55 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 56 | })(); 57 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' + 25 | 'case char class comp const constructor currency destructor div do double ' + 26 | 'downto else end except exports extended false file finalization finally ' + 27 | 'for function goto if implementation in inherited int64 initialization ' + 28 | 'integer interface is label library longint longword mod nil not object ' + 29 | 'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' + 30 | 'pint64 pointer private procedure program property pshortstring pstring ' + 31 | 'pvariant pwidechar pwidestring protected public published raise real real48 ' + 32 | 'record repeat set shl shortint shortstring shr single smallint string then ' + 33 | 'threadvar to true try type unit until uses val var varirnt while widechar ' + 34 | 'widestring with word write writeln xor'; 35 | 36 | this.regexList = [ 37 | { regex: /\(\*[\s\S]*?\*\)/gm, css: 'comments' }, // multiline comments (* *) 38 | { regex: /{(?!\$)[\s\S]*?}/gm, css: 'comments' }, // multiline comments { } 39 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line 40 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 41 | { regex: /\{\$[a-zA-Z]+ .+\}/g, css: 'color1' }, // compiler Directives and Region tags 42 | { regex: /\b[\d\.]+\b/g, css: 'value' }, // numbers 12345 43 | { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // numbers $F5D3 44 | { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword 45 | ]; 46 | }; 47 | 48 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 49 | Brush.aliases = ['delphi', 'pascal', 'pas']; 50 | 51 | SyntaxHighlighter.brushes.Delphi = Brush; 52 | 53 | // CommonJS 54 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 55 | })(); 56 | -------------------------------------------------------------------------------- /svg-flatten/src/svg_import_util.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gerbolyze, a vector image preprocessing toolchain 3 | * Copyright (C) 2021 Jan Sebastian Götte 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Affero General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Affero General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include 20 | #include "base64.h" 21 | #include "svg_import_util.h" 22 | 23 | using namespace std; 24 | 25 | /* Read a double value formatted like usvg formats doubles from an SVG attribute */ 26 | double gerbolyze::usvg_double_attr(const pugi::xml_node &node, const char *attr, double default_value) { 27 | const auto *val = node.attribute(attr).value(); 28 | if (*val == '\0') 29 | return default_value; 30 | 31 | return atof(val); 32 | } 33 | 34 | /* Read an url from an usvg attribute */ 35 | string gerbolyze::usvg_id_url(string attr) { 36 | if (attr.rfind("url(#", 0) == string::npos) 37 | return string(); 38 | 39 | attr = attr.substr(strlen("url(#")); 40 | attr = attr.substr(0, attr.size()-1); 41 | return attr; 42 | } 43 | 44 | gerbolyze::RelativeUnits gerbolyze::map_str_to_units(string str, gerbolyze::RelativeUnits default_val) { 45 | if (str == "objectBoundingBox") 46 | return SVG_ObjectBoundingBox; 47 | else if (str == "userSpaceOnUse") 48 | return SVG_UserSpaceOnUse; 49 | return default_val; 50 | } 51 | 52 | /* Cf. https://tools.ietf.org/html/rfc2397 */ 53 | string gerbolyze::parse_data_iri(const string &data_url) { 54 | if (data_url.rfind("data:", 0) == string::npos) /* check if url starts with "data:" */ 55 | return string(); 56 | 57 | size_t foo = data_url.find("base64,"); 58 | if (foo == string::npos) /* check if this is actually a data URL */ 59 | return string(); 60 | 61 | size_t b64_begin = data_url.find_first_not_of(" ", foo + strlen("base64,")); 62 | assert(b64_begin != string::npos); 63 | 64 | bool err_out; 65 | string out = base64_decode(data_url.substr(b64_begin), false, &err_out); 66 | 67 | if (err_out) 68 | return ""; 69 | return out; 70 | } 71 | 72 | -------------------------------------------------------------------------------- /svg-flatten/testdata/svg/rect_occlusion.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 31 | 51 | 52 | 59 | 66 | 73 | 80 | 81 | -------------------------------------------------------------------------------- /svg-flatten/testdata/svg/circles.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 31 | 51 | 52 | 58 | 65 | 72 | 79 | 80 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/scripts/shBrushAS3.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Created by Peter Atoria @ http://iAtoria.com 25 | 26 | var inits = 'class interface function package'; 27 | 28 | var keywords = '-Infinity ...rest Array as AS3 Boolean break case catch const continue Date decodeURI ' + 29 | 'decodeURIComponent default delete do dynamic each else encodeURI encodeURIComponent escape ' + 30 | 'extends false final finally flash_proxy for get if implements import in include Infinity ' + 31 | 'instanceof int internal is isFinite isNaN isXMLName label namespace NaN native new null ' + 32 | 'Null Number Object object_proxy override parseFloat parseInt private protected public ' + 33 | 'return set static String super switch this throw true try typeof uint undefined unescape ' + 34 | 'use void while with' 35 | ; 36 | 37 | this.regexList = [ 38 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 39 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 40 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings 41 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings 42 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers 43 | { regex: new RegExp(this.getKeywords(inits), 'gm'), css: 'color3' }, // initializations 44 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords 45 | { regex: new RegExp('var', 'gm'), css: 'variable' }, // variable 46 | { regex: new RegExp('trace', 'gm'), css: 'color1' } // trace 47 | ]; 48 | 49 | this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags); 50 | }; 51 | 52 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 53 | Brush.aliases = ['actionscript3', 'as3']; 54 | 55 | SyntaxHighlighter.brushes.AS3 = Brush; 56 | 57 | // CommonJS 58 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 59 | })(); 60 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/cpp/cpp_cairo/cairo_clipper.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * * 3 | * Author : Angus Johnson * 4 | * Version : 1.1 * 5 | * Date : 4 April 2011 * 6 | * Copyright : Angus Johnson 2010-2011 * 7 | * * 8 | * License: * 9 | * Use, modification & distribution is subject to Boost Software License Ver 1. * 10 | * http://www.boost.org/LICENSE_1_0.txt * 11 | * * 12 | * Modified by Mike Owens to support coordinate transformation * 13 | *******************************************************************************/ 14 | 15 | #ifndef CLIPPER_CAIRO_CLIPPER_HPP 16 | #define CLIPPER_CAIRO_CLIPPER_HPP 17 | 18 | #include "clipper.hpp" 19 | 20 | typedef struct _cairo cairo_t; 21 | 22 | namespace ClipperLib { 23 | namespace cairo { 24 | 25 | enum Transform { 26 | tNone, 27 | tUserToDevice, 28 | tDeviceToUser 29 | }; 30 | 31 | //nb: Since Clipper only accepts integer coordinates, fractional values have to 32 | //be scaled up and down when being passed to and from Clipper. This is easily 33 | //accomplished by setting the scaling factor (10^x) in the following functions. 34 | //When scaling, remember that on most platforms, integer is only a 32bit value. 35 | void cairo_to_clipper(cairo_t* cr, 36 | ClipperLib::Paths &pg, 37 | int scaling_factor = 0, 38 | Transform transform = tNone); 39 | 40 | void clipper_to_cairo(const ClipperLib::Paths &pg, 41 | cairo_t* cr, 42 | int scaling_factor = 0, 43 | Transform transform = tNone); 44 | } 45 | 46 | class clipperCairoException : public std::exception 47 | { 48 | public: 49 | clipperCairoException(const char* description) 50 | throw(): std::exception(), m_description (description) {} 51 | virtual ~clipperCairoException() throw() {} 52 | virtual const char* what() const throw() {return m_description.c_str();} 53 | private: 54 | std::string m_description; 55 | }; 56 | } 57 | 58 | #endif 59 | 60 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/scripts/shBrushPython.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Gheorghe Milas and Ahmad Sherif 25 | 26 | var keywords = 'and assert break class continue def del elif else ' + 27 | 'except exec finally for from global if import in is ' + 28 | 'lambda not or pass print raise return try yield while'; 29 | 30 | var funcs = '__import__ abs all any apply basestring bin bool buffer callable ' + 31 | 'chr classmethod cmp coerce compile complex delattr dict dir ' + 32 | 'divmod enumerate eval execfile file filter float format frozenset ' + 33 | 'getattr globals hasattr hash help hex id input int intern ' + 34 | 'isinstance issubclass iter len list locals long map max min next ' + 35 | 'object oct open ord pow print property range raw_input reduce ' + 36 | 'reload repr reversed round set setattr slice sorted staticmethod ' + 37 | 'str sum super tuple type type unichr unicode vars xrange zip'; 38 | 39 | var special = 'None True False self cls class_'; 40 | 41 | this.regexList = [ 42 | { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, 43 | { regex: /^\s*@\w+/gm, css: 'decorator' }, 44 | { regex: /(['\"]{3})([^\1])*?\1/gm, css: 'comments' }, 45 | { regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm, css: 'string' }, 46 | { regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm, css: 'string' }, 47 | { regex: /\+|\-|\*|\/|\%|=|==/gm, css: 'keyword' }, 48 | { regex: /\b\d+\.?\w*/g, css: 'value' }, 49 | { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, 50 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, 51 | { regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color1' } 52 | ]; 53 | 54 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); 55 | }; 56 | 57 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 58 | Brush.aliases = ['py', 'python']; 59 | 60 | SyntaxHighlighter.brushes.Python = Brush; 61 | 62 | // CommonJS 63 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 64 | })(); 65 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Docs/Overview/Deprecated.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 10 | 11 | 13 | 14 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Deprecated 26 | 27 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 45 | 47 | 49 | 50 | 51 |

Deprecated

52 | 53 | 54 |

The precompiler directive 'use_deprecated' allows users to update the Clipper library without being forced to make immediate changes to code that accesses the library. Depricated code will be removed in a future update. (Enabled by default.)

Deprecated types and functions:

All deprecated code has been removed from version 6.2.0. 55 |

62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Functions/ReversePaths.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 10 | 11 | 13 | 14 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | ReversePaths 26 | 27 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 45 | 47 | 49 | 50 | 51 |

ReversePaths

52 | 53 | 54 |

Del.» function ReversePaths(const p: TPaths): TPaths;

55 | 56 |

C++ » void ReversePaths(const Paths &p);

57 | 58 |

C#  » void ReversePaths( Paths p );

59 |
60 | 61 | 62 |

Reverses the vertex order (and hence orientation) in each contained path.

63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /kicad_mod_template.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 31 | 51 | 55 | 59 | 63 | 67 | 71 | 75 | 79 | 83 | 87 | 91 | 95 | 96 | -------------------------------------------------------------------------------- /svg-flatten/testdata/svg/stroke_joins.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 31 | 53 | 54 | 59 | 64 | 69 | 70 | -------------------------------------------------------------------------------- /svg-flatten/testdata/svg/stroke_caps.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 31 | 53 | 54 | 59 | 64 | 69 | 70 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Functions/ReversePath.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 10 | 11 | 13 | 14 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | ReversePath 26 | 27 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 45 | 47 | 49 | 50 | 51 |

ReversePath

52 | 53 | 54 |

Del.» function ReversePath(const polys: TPath): TPath;

55 | 56 |

C++ » void ReversePath(const Path &p);

57 | 58 |

C#  » //Call Path.Reverse().

59 |
60 | 61 |

Reverses the vertex order (and hence orientation) in the specified path.

62 | 63 | 64 |

See Also

65 |

Path

66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import sys 5 | from setuptools import setup 6 | from setuptools.command.install import install 7 | import subprocess 8 | from multiprocessing import cpu_count 9 | from pathlib import Path 10 | import re 11 | 12 | def get_tag(): 13 | try: 14 | res = subprocess.run(['git', '--git-dir', str(Path(__file__).with_name('.git')), 'describe', '--tags', '--match', 'v*'], capture_output=True, check=True, text=True) 15 | return res.stdout.strip() 16 | except subprocess.CalledProcessError as e: 17 | return 'v0.0.0-dev' 18 | 19 | def get_version(): 20 | version, _, _rest = get_tag()[1:].partition('-') 21 | return version 22 | 23 | def format_readme_for_pypi(): 24 | tag = get_tag() 25 | # Replace repo-relative image URLs with gitlab raw URLs. Gitlab and github render repo-relative URLs just fine, but 26 | # PyPI doesn't. 27 | return '\n'.join( 28 | re.sub('^.. (figure|image):: (pics/.*)$', f'.. \\1:: https://gitlab.com/gerbolyze/gerbolyze/-/raw/{tag}/\\2', line.strip('\n')) 29 | for line in Path('README.rst').read_text().splitlines()) 30 | 31 | setup( 32 | name = 'gerbolyze', 33 | version = get_version(), 34 | packages=['gerbolyze'], 35 | scripts=['bin/gerbolyze'], 36 | description = ('A high-resolution image-to-PCB converter. Gerbolyze plots SVG, PNG and JPG onto existing gerber ' 37 | 'files. It handles almost the full SVG spec and deals with text, path outlines, patterns, arbitrary paths with ' 38 | 'self-intersections and holes, etc. fully automatically. It can vectorize raster images both by contour ' 39 | 'tracing and by grayscale dithering. All processing is done at the vector level without intermediate ' 40 | 'conversions to raster images accurately preserving the input.'), 41 | long_description=format_readme_for_pypi(), 42 | long_description_content_type='text/x-rst', 43 | url='https://github.com/jaseg/gerbolyze', 44 | project_urls={ 45 | 'Source Code': 'https://git.jaseg.de/gerbolyze', 46 | 'Bug Tracker': 'https://github.com/jaseg/gerbolyze/issues', 47 | }, 48 | author = 'jaseg', 49 | author_email = 'gerbonara@jaseg.de', 50 | install_requires = ['gerbonara >= 1.2.0', 'beautifulsoup4', 'numpy', 'python-slugify', 'lxml', 'click', 'svg-flatten-wasi'], 51 | license = 'AGPLv3', 52 | classifiers = [ 53 | 'Development Status :: 5 - Production/Stable', 54 | 'Environment :: Console', 55 | 'Intended Audience :: Manufacturing', 56 | 'Intended Audience :: Science/Research', 57 | 'Intended Audience :: Religion', 58 | 'Intended Audience :: Developers', 59 | 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)', 60 | 'Natural Language :: English', 61 | 'Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)', 62 | 'Topic :: Utilities' 63 | ] 64 | ) 65 | 66 | -------------------------------------------------------------------------------- /testdata/led_drv.TXT: -------------------------------------------------------------------------------- 1 | M48 2 | ;Layer_Color=9474304 3 | ;FILE_FORMAT=2:5 4 | INCH,LZ 5 | ;TYPE=PLATED 6 | T1F00S00C0.01200 7 | T2F00S00C0.01600 8 | T3F00S00C0.02400 9 | T4F00S00C0.03150 10 | T5F00S00C0.03937 11 | T6F00S00C0.04291 12 | T7F00S00C0.04724 13 | T8F00S00C0.06299 14 | T9F00S00C0.06693 15 | T10F00S00C0.12835 16 | ;TYPE=NON_PLATED 17 | T11F00S00C0.12598 18 | % 19 | T01 20 | X0054724Y0049606 21 | Y0055905 22 | X0062598Y0070472 23 | X007559Y0070866 24 | X0086614Y0069291 25 | X0088189Y0057874 26 | X01Y0070472 27 | X0104464Y0070079 28 | X0105118Y007874 29 | X0122441Y0087795 30 | X0129921Y006496 31 | X0132433Y0067085 32 | X0135433Y0066929 33 | X0138582Y006811 34 | X0138189Y0063386 35 | X0136221Y006063 36 | X0117323Y0058268 37 | X0116535Y0048425 38 | X0120866Y0049213 39 | X0146063Y0075197 40 | X0146457Y0078347 41 | X0080709Y0080709 42 | X0168504Y0072835 43 | X0169685Y0069291 44 | X0193701Y007126 45 | X019685Y0067716 46 | X0201181Y006811 47 | X0214173Y0069685 48 | X0212598Y0072835 49 | X0236221Y007126 50 | X0248819Y0064173 51 | X0251575Y0052756 52 | X0227559Y0056299 53 | X0194881Y0084252 54 | X0199606Y0122047 55 | X0200394Y0129921 56 | X0216929Y0123228 57 | X022559Y0135827 58 | X0244488Y0136221 59 | X0245669Y0132283 60 | X0255906Y0129921 61 | X023937Y0113386 62 | X0294357Y0106299 63 | X0144488Y013937 64 | X01209Y0149179 65 | X0114173Y0135827 66 | X011063Y0124409 67 | X0106299Y0116141 68 | X01Y0127559 69 | X0089764Y0138583 70 | X0079921Y012559 71 | X0069291Y0127165 72 | X0059449Y0129134 73 | T02 74 | X010748Y005315 75 | X0116535Y0077559 76 | T03 77 | X0146063Y0062598 78 | X0139085Y0071763 79 | X0139764Y0137795 80 | X0126378Y0146063 81 | T04 82 | X003937Y0064961 83 | Y0084646 84 | X0177165 85 | Y0064961 86 | Y0112205 87 | Y013189 88 | X003937 89 | Y0112205 90 | T05 91 | X0157874Y0014134 92 | Y0024134 93 | Y0034134 94 | Y0044134 95 | X0007087Y0145 96 | Y0155 97 | T06 98 | X0072205Y0033779 99 | X008311 100 | X0094016 101 | X0104921 102 | X0110374Y0044961 103 | X0099468 104 | X0088563 105 | X0077658 106 | X0066752 107 | X0204567Y0045276 108 | X0215472 109 | X0226378 110 | X0237283 111 | X0248189 112 | X0242736Y0034095 113 | X0231831 114 | X0220925 115 | X021002 116 | X0215472Y0153858 117 | X0204567 118 | X021002Y0165039 119 | X0220925 120 | X0231831 121 | X0242736 122 | X0248189Y0153858 123 | X0237283 124 | X0226378 125 | X0110394 126 | X0099488 127 | X0088583 128 | X0077677 129 | X0066772 130 | X0072224Y0165039 131 | X008313 132 | X0094035 133 | X0104941 134 | T07 135 | X0334646Y0068425 136 | Y0088425 137 | Y0108425 138 | Y0128425 139 | T08 140 | X0285433Y0062992 141 | X0305118 142 | Y0133858 143 | X0285433 144 | T09 145 | X0267717Y0098425 146 | X0307087 147 | T10 148 | X003937Y003937 149 | X0137756 150 | X0177185Y0039685 151 | X0275571 152 | X0275571Y0159449 153 | X0177185 154 | X0137776 155 | X003939 156 | T11 157 | X0011811Y0019685 158 | X015748Y0062992 159 | X0326772Y0019685 160 | Y0177165 161 | X015748Y0133858 162 | X0011811Y0177165 163 | M30 164 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'abstract as base bool break byte case catch char checked class const ' + 25 | 'continue decimal default delegate do double else enum event explicit ' + 26 | 'extern false finally fixed float for foreach get goto if implicit in int ' + 27 | 'interface internal is lock long namespace new null object operator out ' + 28 | 'override params private protected public readonly ref return sbyte sealed set ' + 29 | 'short sizeof stackalloc static string struct switch this throw true try ' + 30 | 'typeof uint ulong unchecked unsafe ushort using virtual void while'; 31 | 32 | var clipper = 'Clipper Path Paths IntPoint List PolyType PolyFillType ClipType IntRect'; 33 | 34 | function fixComments(match, regexInfo) 35 | { 36 | var css = (match[0].indexOf("///") == 0) 37 | ? 'color1' 38 | : 'comments' 39 | ; 40 | 41 | return [new SyntaxHighlighter.Match(match[0], match.index, css)]; 42 | } 43 | 44 | this.regexList = [ 45 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments 46 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 47 | { regex: /@"(?:[^"]|"")*"/g, css: 'string' }, // @-quoted strings 48 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings 49 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 50 | { regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion 51 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // c# keyword 52 | 53 | { regex: new RegExp(this.getKeywords(clipper), 'gm'), css: 'color4'}, 54 | 55 | { regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g, css: 'keyword' }, // contextual keyword: 'partial' 56 | { regex: /\byield(?=\s+(?:return|break)\b)/g, css: 'keyword' } // contextual keyword: 'yield' 57 | ]; 58 | 59 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); 60 | }; 61 | 62 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 63 | Brush.aliases = ['c#', 'c-sharp', 'csharp']; 64 | 65 | SyntaxHighlighter.brushes.CSharp = Brush; 66 | 67 | // CommonJS 68 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 69 | })(); 70 | 71 | -------------------------------------------------------------------------------- /svg-flatten/testdata/svg/pattern_stroke.svg: -------------------------------------------------------------------------------- 1 | 2 | 18 | 20 | 21 | 23 | image/svg+xml 24 | 26 | 27 | 28 | 29 | 30 | 32 | 37 | 45 | 52 | 59 | 60 | 61 | 83 | 84 | 90 | 91 | -------------------------------------------------------------------------------- /svg-flatten/testdata/svg/pattern_stroke_dashed.svg: -------------------------------------------------------------------------------- 1 | 2 | 18 | 20 | 21 | 23 | image/svg+xml 24 | 26 | 27 | 28 | 29 | 30 | 32 | 37 | 45 | 52 | 59 | 60 | 61 | 83 | 84 | 90 | 91 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Clear.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 10 | 11 | 13 | 14 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Clear 26 | 27 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 45 | 47 | 49 | 51 | 52 | 53 |

ClipperOffset.Clear

54 | 55 | 56 |

Del.» procedure Clear;

57 | 58 |

C++ » void Clear();

59 | 60 |

C#  » public void Clear();

61 |
62 | 63 | 64 |

This method clears all paths from the ClipperOffset object, allowing new paths to be assigned.

65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Scripts/SyntaxHighlighter/scripts/shBrushBash.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne ge le'; 25 | var commands = 'alias apropos awk basename bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' + 26 | 'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' + 27 | 'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' + 28 | 'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' + 29 | 'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' + 30 | 'import install join kill less let ln local locate logname logout look lpc lpr lprint ' + 31 | 'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' + 32 | 'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' + 33 | 'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' + 34 | 'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' + 35 | 'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' + 36 | 'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' + 37 | 'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' + 38 | 'vi watch wc whereis which who whoami Wget xargs yes' 39 | ; 40 | 41 | this.regexList = [ 42 | { regex: /^#!.*$/gm, css: 'preprocessor bold' }, 43 | { regex: /\/[\w-\/]+/gm, css: 'plain' }, 44 | { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments 45 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings 46 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings 47 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords 48 | { regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands 49 | ]; 50 | } 51 | 52 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 53 | Brush.aliases = ['bash', 'shell']; 54 | 55 | SyntaxHighlighter.brushes.Bash = Brush; 56 | 57 | // CommonJS 58 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 59 | })(); 60 | -------------------------------------------------------------------------------- /svg-flatten/testdata/svg/scale.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 31 | 51 | 52 | 56 | 63 | 71 | 72 | 76 | 83 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperBase/Methods/Clear.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 10 | 11 | 13 | 14 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Clear 26 | 27 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 45 | 47 | 49 | 51 | 52 | 53 |

ClipperBase.Clear

54 | 55 | 56 |

Del.» procedure Clear;

57 | 58 |

C++ » virtual void Clear();

59 | 60 |

C#  » public void Clear() {};

61 | 62 |

The Clear method removes any existing subject and clip polygons allowing the Clipper object to be reused for clipping operations on different polygon sets.

63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Functions/PolyTreeToPaths.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 10 | 11 | 13 | 14 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | PolyTreeToPaths 26 | 27 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 45 | 47 | 49 | 50 | 51 |

PolyTreeToPaths

52 | 53 | 54 |

Del.» function PolyTreeToPaths(PolyTree: TPolyTree): TPaths;

55 | 56 |

C++ » void PolyTreeToPaths(PolyTree& polytree, Paths& paths);

57 | 58 |

C#  » public static Paths PolyTreeToPaths(PolyTree polytree);

59 |
60 | 61 | 62 |

This function converts a PolyTree structure into a Paths structure.

63 | 64 |

See Also

65 |

PolyTree, Paths

66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/PolyNode/Properties/Contour.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 10 | 11 | 13 | 14 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Contour 26 | 27 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 45 | 47 | 49 | 51 | 52 | 53 |

PolyNode.Contour

54 | 55 |

Del.» property Contour: TPath; //read only

56 | 57 |

C++ » Path Contour; //public field

58 | 59 |

C#  » public Path Contour; //read only property

60 | 61 | 62 |

Returns a path list which contains any number of vertices.

63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /svg-flatten/src/out_dilater.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gerbolyze, a vector image preprocessing toolchain 3 | * Copyright (C) 2021 Jan Sebastian Götte 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Affero General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Affero General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include "polylinecombine.hpp" 29 | 30 | using namespace gerbolyze; 31 | using namespace std; 32 | 33 | void Dilater::header(d2p origin, d2p size) { 34 | m_sink.header(origin, size); 35 | } 36 | 37 | void Dilater::footer() { 38 | m_sink.footer(); 39 | } 40 | 41 | Dilater &Dilater::operator<<(const LayerNameToken &layer_name) { 42 | m_sink << layer_name; 43 | 44 | return *this; 45 | } 46 | 47 | Dilater &Dilater::operator<<(GerberPolarityToken pol) { 48 | m_current_polarity = pol; 49 | m_sink << pol; 50 | 51 | return *this; 52 | } 53 | 54 | Dilater &Dilater::operator<<(const Polygon &poly) { 55 | ClipperLib::Path poly_c; 56 | for (auto &p : poly) { 57 | poly_c.push_back({(ClipperLib::cInt)round(p[0] * clipper_scale), (ClipperLib::cInt)round(p[1] * clipper_scale)}); 58 | } 59 | 60 | ClipperLib::ClipperOffset offx; 61 | offx.ArcTolerance = 0.05 * clipper_scale; /* 10µm; TODO: Make this configurable */ 62 | offx.AddPath(poly_c, ClipperLib::jtRound, ClipperLib::etClosedPolygon); 63 | double dilation = m_dilation; 64 | if (m_current_polarity == GRB_POL_CLEAR) { 65 | dilation = -dilation; 66 | } 67 | 68 | ClipperLib::PolyTree solution; 69 | offx.Execute(solution, dilation * clipper_scale); 70 | 71 | ClipperLib::Paths c_nice_polys; 72 | dehole_polytree(solution, c_nice_polys); 73 | 74 | for (auto &nice_poly : c_nice_polys) { 75 | Polygon new_poly; 76 | for (auto &p : nice_poly) { 77 | new_poly.push_back({ 78 | (double)p.X / clipper_scale, 79 | (double)p.Y / clipper_scale }); 80 | } 81 | m_sink << new_poly; 82 | } 83 | 84 | return *this; 85 | } 86 | 87 | Dilater &Dilater::operator<<(const ApertureToken &ap) { 88 | if (ap.m_has_aperture) 89 | m_sink << ApertureToken(ap.m_size + 2*m_dilation); 90 | else 91 | m_sink << ap; 92 | return *this; 93 | } 94 | 95 | Dilater &Dilater::operator<<(const FlashToken &tok) { 96 | m_sink << tok; 97 | return *this; 98 | } 99 | -------------------------------------------------------------------------------- /gerbolyze/tests/test_regression.py: -------------------------------------------------------------------------------- 1 | #s -*- coding: utf-8 -*- 2 | # 3 | # Copyright 2022 Jan Götte 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | import sys 19 | import math 20 | import subprocess 21 | import tempfile 22 | from pathlib import Path 23 | from xml.etree import ElementTree 24 | 25 | import gerbonara 26 | import pytest 27 | 28 | from .test_integration import run_command 29 | 30 | 31 | 32 | def test_template_round_trip(): 33 | r = 50 # mm 34 | n_points = 500000 35 | 36 | with tempfile.NamedTemporaryFile(suffix='.svg') as out_svg,\ 37 | tempfile.NamedTemporaryFile(suffix='.svg') as proc_svg,\ 38 | tempfile.TemporaryDirectory() as out_dir: 39 | run_command('python3', 'gerbolyze', 'empty-template', '--force', '--size', f'{2*(r)}x{2*(r)}mm', out_svg.name) 40 | 41 | ElementTree.register_namespace('', 'http://www.w3.org/2000/svg') 42 | ElementTree.register_namespace('svg', 'http://www.w3.org/2000/svg') 43 | et = ElementTree.parse(out_svg) 44 | for layer in [ 45 | et.find(".//{http://www.w3.org/2000/svg}g[@id='g-top-copper']"), 46 | et.find(".//{http://www.w3.org/2000/svg}g[@id='g-bottom-copper']")]: 47 | poly = ElementTree.SubElement(layer, '{http://www.w3.org/2000/svg}polygon') 48 | # Generate n_points points on a circle 49 | poly.set('points', ' '.join([f'{r + r*math.sin(t)}, {r + r*math.cos(t)}' 50 | for t in (i/n_points * 2*math.pi for i in range(n_points))])) 51 | 52 | et.write(proc_svg) 53 | proc_svg.flush() 54 | 55 | run_command('python3', 'gerbolyze', 'convert', proc_svg.name, out_dir) 56 | out_dir = Path(out_dir) 57 | 58 | excellon_files = [f.stat().st_size for f in out_dir.glob('*.drl')] 59 | print('Excellon file sizes:', excellon_files) 60 | 61 | gerber_files = {f: f.stat().st_size for f in out_dir.glob('*.gbr')} 62 | print('Gerber file sizes:', gerber_files) 63 | 64 | assert len(excellon_files) == 2 65 | assert all(20 < x < 100 for x in excellon_files) 66 | 67 | for f, size in gerber_files.items(): 68 | _name, _, layer = f.stem.rpartition('-') 69 | if layer in ('F.Cu', 'B.Cu'): 70 | # These layers should contain a very large G36 polygon 71 | assert 10e6 < size < 100e6 72 | else: 73 | # These layers should not contain anything 74 | assert 20 < size < 1000 75 | 76 | --------------------------------------------------------------------------------