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"> <inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<name>DXF 2 Papercraft</name> <name>DXF 2 Papercraft</name>
<id>fablabchemnitz.de.dxf2papercraft</id> <id>fablabchemnitz.de.dxf2papercraft</id>
<label appearance="header">Unfolding settings</label> <param name="tab" type="notebook">
<param name="nomerge" type="bool" gui-text="No merging of faces into single polygon">false</param> <page name="tab_settings" gui-text="DXF 2 Papercraft">
<param name="number" type="bool" gui-text="Print face numbers (labels)" gui-description="Disable this if you want to split custom faces">false</param> <label appearance="header">Unfolding settings</label>
<param name="divide" type="bool" gui-text="Draw each face separate">false</param> <param name="nomerge" type="bool" gui-text="No merging of faces into single polygon">false</param>
<param name="overlap" type="bool" gui-text="Allow overlapping faces in cut-out sheet">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="hide" type="bool" gui-text="Hide glue tabs">false</param> <param name="divide" type="bool" gui-text="Draw each face separate">false</param>
<param name="force" type="bool" gui-text="Force glue tabs, even if intersecting faces">false</param> <param name="overlap" type="bool" gui-text="Allow overlapping faces in cut-out sheet">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="hide" type="bool" gui-text="Hide glue tabs">false</param>
<param name="strategy" type="optiongroup" appearance="combo" gui-text="Generation strategy"> <param name="force" type="bool" gui-text="Force glue tabs, even if intersecting faces">false</param>
<option value="0">Draw smallest polygon first</option> <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>
<option value="1">Draw largest first </option> <param name="strategy" type="optiongroup" appearance="combo" gui-text="Generation strategy">
<option value="2">As ordered in file</option> <option value="0">Draw smallest polygon first</option>
<option value="3">Keep adjacent faces continuous</option> <option value="1">Draw largest first </option>
<option value="4">Stretch 2D layout wide</option> <option value="2">As ordered in file</option>
<option value="5">Keep layout dense</option> <option value="3">Keep adjacent faces continuous</option>
</param> <option value="4">Stretch 2D layout wide</option>
<separator/> <option value="5">Keep layout dense</option>
<label appearance="header">General</label> </param>
<param name="resizetoimport" type="bool" gui-text="Resize the canvas to the imported drawing's bounding box">true</param> <separator/>
<param name="extraborder" type="float" precision="3" gui-text="Add extra border around fitted canvas">0.0</param> <label appearance="header">General</label>
<param name="extraborder_units" type="optiongroup" appearance="combo" gui-text="Border offset units"> <param name="resizetoimport" type="bool" gui-text="Resize the canvas to the imported drawing's bounding box">true</param>
<option value="mm">mm</option> <param name="extraborder" type="float" precision="3" gui-text="Add extra border around fitted canvas">0.0</param>
<option value="cm">cm</option> <param name="extraborder_units" type="optiongroup" appearance="combo" gui-text="Border offset units">
<option value="in">in</option> <option value="mm">mm</option>
<option value="pt">pt</option> <option value="cm">cm</option>
<option value="px">px</option> <option value="in">in</option>
</param> <option value="pt">pt</option>
<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> <option value="px">px</option>
<separator/> </param>
<label appearance="header">Input File</label> <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>
<param name="inputfile" type="path" gui-text=" " gui-description="The model to unfold" filetypes="dxf" mode="file">/your/dxf/file</param> <separator/>
<separator/> <label appearance="header">Input File</label>
<label>DXF 2 Papercraft Wrapper by Mario Voigt / Stadtfabrikanten e.V. (2020)</label> <param name="inputfile" type="path" gui-text=" " gui-description="The model to unfold" filetypes="dxf" mode="file">/your/dxf/file</param>
<label appearance="url">https://fablabchemnitz.de</label> </page>
<label>Wrapper License: GNU GPL v3</label> <page name="tab_about" gui-text="About">
<label>Modules:</label> <label appearance="header">DXF 2 Papercraft</label>
<label appearance="url">http://dxf2papercraft.sourceforge.net</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 appearance="url">http://kabeja.sourceforge.net</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"> <effect needs-live-preview="true">
<object-type>all</object-type>
<effects-menu> <effects-menu>
<submenu name="FabLab Chemnitz"> <submenu name="FabLab Chemnitz">
<submenu name="Papercraft Flatteners"/> <submenu name="Papercraft Flatteners"/>

View File

@ -12,17 +12,17 @@ from inkex import Transform
Extension for InkScape 1.0 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. 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 Author: Mario Voigt / FabLab Chemnitz
Mail: mario.voigt@stadtfabrikanten.org Mail: mario.voigt@stadtfabrikanten.org
Date: 11.09.2020 Date: 11.09.2020
Last patch: 11.09.2020 Last patch: 18.04.2021
License: GNU GPL v3 License: GNU GPL v3
Module licenses Module licenses
- dxf2papercraft (dxf2papercraft.sourceforge.net) - GPL v3 License - dxf2papercraft (dxf2papercraft.sourceforge.net) - GPL v3 License
- kabeja (http://kabeja.sourceforge.net/) - Apache v2 - kabeja (http://kabeja.sourceforge.net/) - Apache v2 License
ToDos: ToDos:
- in case of errors maybe think about adding ezdxf library to filter unsupported entities (similar like done in dxfdwgimporter extension) - 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): class PapercraftUnfold(inkex.EffectExtension):
def add_arguments(self, pars): def add_arguments(self, pars):
pars.add_argument("--tab")
pars.add_argument("--inputfile") 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("--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) pars.add_argument("--extraborder", type=float, default=0.0)

View File

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