adjustments in dxf2papercraft

This commit is contained in:
leyghisbb 2021-04-19 17:23:04 +02:00
parent 0ee59c1026
commit 5fdcfb1bde
6 changed files with 180 additions and 43 deletions

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 29 KiB

View File

@ -2,46 +2,73 @@
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<name>DXF 2 Papercraft</name>
<id>fablabchemnitz.de.dxf2papercraft</id>
<label appearance="header">Unfolding settings</label>
<param name="nomerge" type="bool" gui-text="No merging of faces into single polygon">false</param>
<param name="number" type="bool" gui-text="Print face numbers (labels)" gui-description="Disable this if you want to split custom faces">false</param>
<param name="divide" type="bool" gui-text="Draw each face separate">false</param>
<param name="overlap" type="bool" gui-text="Allow overlapping faces in cut-out sheet">false</param>
<param name="hide" type="bool" gui-text="Hide glue tabs">false</param>
<param name="force" type="bool" gui-text="Force glue tabs, even if intersecting faces">false</param>
<param name="split" type="string" gui-text="Comma separated list of face numbers to disconnect from the rest" gui-description="Enable face numbers tp have a view on it. If face number option is activated the splitting will not be performed!"></param>
<param name="strategy" type="optiongroup" appearance="combo" gui-text="Generation strategy">
<option value="0">Draw smallest polygon first</option>
<option value="1">Draw largest first </option>
<option value="2">As ordered in file</option>
<option value="3">Keep adjacent faces continuous</option>
<option value="4">Stretch 2D layout wide</option>
<option value="5">Keep layout dense</option>
</param>
<separator/>
<label appearance="header">General</label>
<param name="resizetoimport" type="bool" gui-text="Resize the canvas to the imported drawing's bounding box">true</param>
<param name="extraborder" type="float" precision="3" gui-text="Add extra border around fitted canvas">0.0</param>
<param name="extraborder_units" type="optiongroup" appearance="combo" gui-text="Border offset units">
<option value="mm">mm</option>
<option value="cm">cm</option>
<option value="in">in</option>
<option value="pt">pt</option>
<option value="px">px</option>
</param>
<param name="scalefactor" type="float" precision="3" min="0.0001" max="10000.0" gui-text="Manual scale factor" gui-description="default is 1.0">1.0</param>
<separator/>
<label appearance="header">Input File</label>
<param name="inputfile" type="path" gui-text=" " gui-description="The model to unfold" filetypes="dxf" mode="file">/your/dxf/file</param>
<separator/>
<label>DXF 2 Papercraft Wrapper by Mario Voigt / Stadtfabrikanten e.V. (2020)</label>
<label appearance="url">https://fablabchemnitz.de</label>
<label>Wrapper License: GNU GPL v3</label>
<label>Modules:</label>
<label appearance="url">http://dxf2papercraft.sourceforge.net</label>
<label appearance="url">http://kabeja.sourceforge.net</label>
<param name="tab" type="notebook">
<page name="tab_settings" gui-text="DXF 2 Papercraft">
<label appearance="header">Unfolding settings</label>
<param name="nomerge" type="bool" gui-text="No merging of faces into single polygon">false</param>
<param name="number" type="bool" gui-text="Print face numbers (labels)" gui-description="Disable this if you want to split custom faces">false</param>
<param name="divide" type="bool" gui-text="Draw each face separate">false</param>
<param name="overlap" type="bool" gui-text="Allow overlapping faces in cut-out sheet">false</param>
<param name="hide" type="bool" gui-text="Hide glue tabs">false</param>
<param name="force" type="bool" gui-text="Force glue tabs, even if intersecting faces">false</param>
<param name="split" type="string" gui-text="Comma separated list of face numbers to disconnect from the rest" gui-description="Enable face numbers tp have a view on it. If face number option is activated the splitting will not be performed!"></param>
<param name="strategy" type="optiongroup" appearance="combo" gui-text="Generation strategy">
<option value="0">Draw smallest polygon first</option>
<option value="1">Draw largest first </option>
<option value="2">As ordered in file</option>
<option value="3">Keep adjacent faces continuous</option>
<option value="4">Stretch 2D layout wide</option>
<option value="5">Keep layout dense</option>
</param>
<separator/>
<label appearance="header">General</label>
<param name="resizetoimport" type="bool" gui-text="Resize the canvas to the imported drawing's bounding box">true</param>
<param name="extraborder" type="float" precision="3" gui-text="Add extra border around fitted canvas">0.0</param>
<param name="extraborder_units" type="optiongroup" appearance="combo" gui-text="Border offset units">
<option value="mm">mm</option>
<option value="cm">cm</option>
<option value="in">in</option>
<option value="pt">pt</option>
<option value="px">px</option>
</param>
<param name="scalefactor" type="float" precision="3" min="0.0001" max="10000.0" gui-text="Manual scale factor" gui-description="default is 1.0">1.0</param>
<separator/>
<label appearance="header">Input File</label>
<param name="inputfile" type="path" gui-text=" " gui-description="The model to unfold" filetypes="dxf" mode="file">/your/dxf/file</param>
</page>
<page name="tab_about" gui-text="About">
<label appearance="header">DXF 2 Papercraft</label>
<label>Unfold and import DXF into InkScape using dxf2papercraft. This is some kind of wrapper extension utilizing kabeja to convert the dxf output from dxf2papercraft into SVG. To make it work you need to install at least java.</label>
<label>2020 -2021 / written by Mario Voigt (Stadtfabrikanten e.V. / FabLab Chemnitz)</label>
<spacer/>
<label appearance="header">Online Documentation</label>
<label appearance="url">https://y.stadtfabrikanten.org/dxf2papercraft</label>
<spacer/>
<label appearance="header">Contributing</label>
<label appearance="url">https://gitea.fablabchemnitz.de/MarioVoigt/mightyscape-1.X</label>
<label appearance="url">mailto:mario.voigt@stadtfabrikanten.org</label>
<spacer/>
<label appearance="header">Third Party Modules</label>
<label appearance="url">http://dxf2papercraft.sourceforge.net</label>
<label appearance="url">http://kabeja.sourceforge.net</label>
<spacer/>
<label appearance="header">MightyScape Extension Collection</label>
<label>This piece of software is part of the MightyScape for InkScape Extension Collection and is licensed under GNU GPL v3</label>
<label appearance="url">https://y.stadtfabrikanten.org/mightyscape-overview</label>
</page>
<page name="tab_donate" gui-text="Donate">
<label appearance="header">Coffee + Pizza</label>
<label>We are the Stadtfabrikanten, running the FabLab Chemnitz since 2016. A FabLab is an open workshop that gives people access to machines and digital tools like 3D printers, laser cutters and CNC milling machines.</label>
<spacer/>
<label>You like our work and want to support us? You can donate to our non-profit organization by different ways:</label>
<label appearance="url">https://y.stadtfabrikanten.org/donate</label>
<spacer/>
<label>Thanks for using our extension and helping us!</label>
<image>../000_about_fablabchemnitz.svg</image>
</page>
</param>
<effect needs-live-preview="true">
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Papercraft Flatteners"/>

View File

@ -12,17 +12,17 @@ from inkex import Transform
Extension for InkScape 1.0
Unfold and import DXF into InkScape using dxf2papercraft. This is some kind of wrapper extension utilizing kabeja to convert the dxf output from dxf2papercraft into SVG.
To make it work you need to install at least java
To make it work you need to install at least java.
Author: Mario Voigt / FabLab Chemnitz
Mail: mario.voigt@stadtfabrikanten.org
Date: 11.09.2020
Last patch: 11.09.2020
Last patch: 18.04.2021
License: GNU GPL v3
Module licenses
- dxf2papercraft (dxf2papercraft.sourceforge.net) - GPL v3 License
- kabeja (http://kabeja.sourceforge.net/) - Apache v2
- kabeja (http://kabeja.sourceforge.net/) - Apache v2 License
ToDos:
- in case of errors maybe think about adding ezdxf library to filter unsupported entities (similar like done in dxfdwgimporter extension)
@ -32,6 +32,7 @@ ToDos:
class PapercraftUnfold(inkex.EffectExtension):
def add_arguments(self, pars):
pars.add_argument("--tab")
pars.add_argument("--inputfile")
pars.add_argument("--resizetoimport", type=inkex.Boolean, default=True, help="Resize the canvas to the imported drawing's bounding box")
pars.add_argument("--extraborder", type=float, default=0.0)

View File

@ -3,7 +3,6 @@
<name>Gears2</name>
<id>fablabchemnitz.de.gears2</id>
<param name="tab" type="notebook">
<page name="Options" gui-text="Options">
<param name="teeth" type="int" min="6" max="500" gui-text="Number of teeth">24</param>
<param name="pressure_angle" type="float" min="1" max="40" gui-text="Pressure angle">20</param>