-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathicqsol_compose_shapes.xml
74 lines (71 loc) · 3.36 KB
/
icqsol_compose_shapes.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?xml version='1.0' encoding='UTF-8'?>
<tool id="icqsol_compose_shapes" name="Compose shapes" version="@[email protected]">
<description></description>
<macros>
<import>icqsol_macros.xml</import>
</macros>
<expand macro="requirements" />
<command>
<![CDATA[
python $__tool_directory__/icqsol_compose_shapes.py
--expression "$expression"
#for $i in $input_shapes:
--shape_dataset "${i.expression_var}" "${i.input_shape}" "${i.input_shape.ext}" "${i.input_shape.metadata.dataset_type}"
#end for
--output "$output"
--output_vtk_type $output_vtk_type
]]>
</command>
<inputs>
<param name="expression" type="text" value="" label="Composition expression" help="Example: A + B - C * D"/>
<repeat name="input_shapes" title="Expression variable and shape" min="2">
<param name="expression_var" type="text" value="" label="Expression variable" help="The selected shape will be associated with this variable in the expression."/>
<param name="input_shape" type="data" format="plyascii,plybinary,vtkascii,vtkbinary" label="Shape">
<validator type="dataset_ok_validator" />
</param>
</repeat>
<expand macro="output_vtk_type_params" />
</inputs>
<outputs>
<data name="output" format="vtkascii">
<actions>
<action type="format">
<option type="from_param" name="output_vtk_type" />
</action>
</actions>
</data>
</outputs>
<tests>
<test>
<param name="expression" value="head + shaft - notch1 - notch2" />
<repeat name="input_shapes">
<param name="expression_var" value="head" />
<param name="input_shape" value="head.vtkascii" ftype="vtkascii" />
</repeat>
<repeat name="input_shapes">
<param name="expression_var" value="shaft" />
<param name="input_shape" value="shaft.vtkascii" ftype="vtkascii" />
</repeat>
<repeat name="input_shapes">
<param name="expression_var" value="notch1" />
<param name="input_shape" value="notch1.vtkascii" ftype="vtkascii" />
</repeat>
<repeat name="input_shapes">
<param name="expression_var" value="notch2" />
<param name="input_shape" value="notch2.vtkascii" ftype="vtkascii" />
</repeat>
<output name="output" file="philips_bolt.vtkascii" ftype="vtkascii" />
<param name="output_vtk_type" value="vtkascii" />
</test>
</tests>
<help>
**What it does**
Creates a shape composed of any number of selected shapes where the composition is based on a mathematical
expression consisting of **+**, **-** and ***** operations. The **+** results in a union of shapes, the
**-** operator removes a shape and the ***** operator results in an intersection of shapes.
For example, if the **Composition expression** is **A + B - C - D**, selecting 4 shapes from your history
and associating each shape with a variable from the expression will result in a shape composed of the shapes
associated with A and B, but eliminating the shapes associated with C and D.
</help>
<expand macro="citations" />
</tool>