<?xml version="1.0" encoding="UTF-8"?>
<!--
	Copyright (C) 2018 Australian Institute of Marine Science

	Contact: Gael Lafond <g.lafond@aims.gov.au>

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.


	This file is simply metadata to tell InkScape how to bind the Python
		script to its API, and define the script dependencies.
	It can be bind through menu item in InkScape, we can add configuration
		window with tabs, all sort of fancy stuff.
	In this case, we simply want to add a "Save as" format, without any
		configuration.


	Additions:
	Dean White <whitde67@bigpond.com> Added parameters to control some output options
-->

<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
	<_name>OpenSCAD Bezier V1.0</_name>
	<id>au.gov.aims.openscad.bezier</id>
	<dependency type="extension">org.inkscape.output.svg.inkscape</dependency>
	<dependency type="executable" location="extensions">openSCADbezier.py</dependency>
	<dependency type="executable" location="extensions">inkex.py</dependency>
	<dependency type="executable" location="extensions">simpletransform.py</dependency>
	<dependency type="executable" location="extensions">cubicsuperpath.py</dependency>

	<output>
		<extension>.scad</extension>
		<mimetype>application/x-openscad</mimetype>
		<_filetypename>OpenSCAD Bezier (*.scad)</_filetypename>
		<_filetypetooltip>OpenSCAD Bezier Model</_filetypetooltip>
		<dataloss>true</dataloss>
	</output>

	<param 
		name="xfullname" 
		type="string">				
	</param>

	<param 
		name="libcode" 
		type="boolean" 
		gui-description="This determines whether the needed Bezier functions are included internally."  
		gui-text="Append Bezier Function Code">
		true
	</param>

        <param 
		name="libname"
		type="string"
		gui-description="This is the name of the library that will be used to include the Bezier functions if not included internally."
		gui-text="Bezier Library Name"
		indent="1">
		lib_bezier.scad
	</param>
	
	<param
		name="fn"
		type="string"
		gui-description="This should be a unique object name that identifies the file. Internal functions and modules append this name to make sure multiple images can be used together. &#xD;All non-alphanumeric characters will be stripped.&#xD;&#xD;Example names produced :-&#xD;&#xD;imageDraw_Object1(...)&#xD;imageDim_Object1()&#xD;g28_Object1()"
		gui-text="Object Name">
		Object1
	</param>
	
	<param 
		name="prec"
		type="optiongroup"
		gui-description="This determines the amount of rounding (if any) done on the polygon coordinates in the image. It can prevent numbers like 120.000000001 and/or 119.99999999 occuring in the code."
		gui-text="Rounding">
		<option value="0">No Rounding</option>
		<option value="3">round(val, 3)</option>
		<option value="4">round(val, 4)</option>
		<option value="5">round(val, 5)</option>
		<option value="6">round(val, 6)</option>
		4
	</param> 

	<param		
		name="testcode" 
		type="optiongroup"
		gui-description="Determines if any test code is produced and if so how much. Any test code will be ignored if the created file is included via &quot;use&quot; as opposed to &quot;include&quot;."
		gui-text="Internal Test Code">
		<option value="0">No Test Code</option>
		<option value="1">Minimal Test Code</option>
		<option value="2">Detailed Test Code</option>
		1
	</param>

	<script>
		<command reldir="extensions" interpreter="python">openSCADbezier.py</command>
	</script>
</inkscape-extension>
