Commits

Manfred Moitzi committed 341494b

refactoring of smartpart "CAVIC2"

  • Participants
  • Parent commits 96209a3

Comments (0)

Files changed (4)

File .idea/workspace.xml

 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="d10fe02a-bdc8-4418-9494-70adbe7601f3" name="Default" comment="">
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/CAVIC2.smt" />
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/CAVIC2.ini" />
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/scripts/CAVIC2.Part2D.mako" />
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/scripts/CAVIC2.PartDialog.mako" />
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/scripts/CAVIC2.PartParameter.mako" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/CAVIC2.smt" afterPath="$PROJECT_DIR$/CAVIC2.smt" />
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/basic.mako" afterPath="$PROJECT_DIR$/lib/basic.mako" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/scripts/CAVIC2.Part2D.mako" afterPath="$PROJECT_DIR$/scripts/CAVIC2.Part2D.mako" />
     </list>
     <ignored path="mako2smt.iws" />
     <ignored path=".idea/workspace.xml" />
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="CAVIC2.PartParameter.mako" pinned="false" current="true" current-in-tab="true">
+      <file leaf-file-name="CAVIC2.PartParameter.mako" pinned="false" current="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/scripts/CAVIC2.PartParameter.mako">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="3" column="0" selection-start="122" selection-end="122" vertical-scroll-proportion="0.050695825">
+            <state line="3" column="0" selection-start="122" selection-end="122" vertical-scroll-proportion="-2.04">
               <folding />
             </state>
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="CAVIC2.Part2D.mako" pinned="false" current="false" current-in-tab="false">
+      <file leaf-file-name="CAVIC2.Part2D.mako" pinned="false" current="true" current-in-tab="true">
         <entry file="file://$PROJECT_DIR$/scripts/CAVIC2.Part2D.mako">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="3" column="0" selection-start="0" selection-end="122" vertical-scroll-proportion="-2.04">
+            <state line="18" column="3" selection-start="327" selection-end="327" vertical-scroll-proportion="0.15208748">
               <folding />
             </state>
           </provider>
       <file leaf-file-name="CAVIC2.PartDialog.mako" pinned="false" current="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/scripts/CAVIC2.PartDialog.mako">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="3" column="0" selection-start="122" selection-end="122" vertical-scroll-proportion="-2.04">
-              <folding />
-            </state>
-          </provider>
-        </entry>
-      </file>
-      <file leaf-file-name="basic.mako" pinned="false" current="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/lib/basic.mako">
-          <provider selected="true" editor-type-id="text-editor">
-            <state line="31" column="0" selection-start="819" selection-end="856" vertical-scroll-proportion="0.0">
+            <state line="10" column="29" selection-start="310" selection-end="310" vertical-scroll-proportion="-6.8">
               <folding />
             </state>
           </provider>
         <option value="$PROJECT_DIR$/ibeams/scripts/HE-M.PartDialog.mako" />
         <option value="$PROJECT_DIR$/ibeams/scripts/IPE.PartDialog.mako" />
         <option value="$PROJECT_DIR$/ibeams/scripts/I-Reihe.PartDialog.mako" />
+        <option value="$PROJECT_DIR$/scripts/CAVIC2.PartDialog.mako" />
+        <option value="$PROJECT_DIR$/scripts/CAVIC2.PartParameter.mako" />
         <option value="$PROJECT_DIR$/lib/basic.mako" />
         <option value="$PROJECT_DIR$/scripts/CAVIC2.Part2D.mako" />
-        <option value="$PROJECT_DIR$/scripts/CAVIC2.PartDialog.mako" />
-        <option value="$PROJECT_DIR$/scripts/CAVIC2.PartParameter.mako" />
       </list>
     </option>
   </component>
               <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
             </PATH_ELEMENT>
             <PATH_ELEMENT>
-              <option name="myItemId" value="scripts" />
-              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
-            </PATH_ELEMENT>
-          </PATH>
-          <PATH>
-            <PATH_ELEMENT>
-              <option name="myItemId" value="mako2smt" />
-              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
-            </PATH_ELEMENT>
-            <PATH_ELEMENT>
-              <option name="myItemId" value="mako2smt" />
-              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
-            </PATH_ELEMENT>
-            <PATH_ELEMENT>
               <option name="myItemId" value="lib" />
               <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
             </PATH_ELEMENT>
     <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_treeWidth3" value="952" />
     <property name="restartRequiresConfirmation" value="true" />
     <property name="FileHistory.org.zmlx.hg4idea.provider.HgHistoryProvider_treeOrder3" value="3" />
+    <property name="options.searchVisible" value="true" />
     <property name="options.splitter.details.proportions" value="0.2" />
-    <property name="options.searchVisible" value="true" />
   </component>
   <component name="PyConsoleOptionsProvider">
     <option name="myPythonConsoleState">
       <created>1352093751830</created>
       <updated>1352093751830</updated>
     </task>
-    <option name="localTasksCounter" value="21" />
+    <task id="LOCAL-00021" summary="added smartpart &quot;CAVIC2&quot;">
+      <created>1352148583360</created>
+      <updated>1352148583360</updated>
+    </task>
+    <option name="localTasksCounter" value="22" />
     <servers />
   </component>
   <component name="ToolWindowManager">
     <layout>
       <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32954547" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
       <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
+      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32954547" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
       <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
       <window_info id="Structure" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.2218543" sideWeight="0.67045456" order="4" side_tool="true" content_ui="tabs" />
-      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.26048565" sideWeight="0.67045456" order="0" side_tool="false" content_ui="combo" />
+      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.26324505" sideWeight="0.67045456" order="0" side_tool="false" content_ui="combo" />
       <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.39962122" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
       <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
       <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32954547" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
       <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
       <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
       <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
-      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32954547" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
       <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
       <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
       <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
     <option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />
     <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
     <option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
-    <option name="LAST_COMMIT_MESSAGE" value="miner edit" />
+    <option name="LAST_COMMIT_MESSAGE" value="added smartpart &quot;CAVIC2&quot;" />
     <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />
     <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
     <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
     <MESSAGE value="simplified lookup directory structure.&#10;&#10;Only MAKO2SMT_HOME and 'infile' directory and their 'lib' and 'scripts' subdirectories and directories added by the -L option." />
     <MESSAGE value="working on mako library" />
     <MESSAGE value="miner edit" />
+    <MESSAGE value="added smartpart &quot;CAVIC2&quot;" />
   </component>
   <component name="XDebuggerManager">
     <breakpoint-manager>
         </state>
       </provider>
     </entry>
+    <entry file="file://$PROJECT_DIR$/scripts/CAVIC2.PartParameter.mako">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="3" column="0" selection-start="122" selection-end="122" vertical-scroll-proportion="-2.04">
+          <folding />
+        </state>
+      </provider>
+    </entry>
     <entry file="file://$PROJECT_DIR$/lib/basic.mako">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="31" column="0" selection-start="819" selection-end="856" vertical-scroll-proportion="0.0">
+        <state line="29" column="0" selection-start="761" selection-end="761" vertical-scroll-proportion="-17.68">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/scripts/CAVIC2.PartDialog.mako">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="10" column="29" selection-start="310" selection-end="310" vertical-scroll-proportion="-6.8">
           <folding />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/scripts/CAVIC2.Part2D.mako">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="3" column="0" selection-start="0" selection-end="122" vertical-scroll-proportion="-2.04">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/scripts/CAVIC2.PartDialog.mako">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="3" column="0" selection-start="122" selection-end="122" vertical-scroll-proportion="-2.04">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/scripts/CAVIC2.PartParameter.mako">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="3" column="0" selection-start="122" selection-end="122" vertical-scroll-proportion="0.050695825">
+        <state line="18" column="3" selection-start="327" selection-end="327" vertical-scroll-proportion="0.15208748">
           <folding />
         </state>
       </provider>
-<?xml version="1.0" encoding="UTF-8"?>
-<ScriptObject><Version>1.0</Version>
+<?xml version="1.0" encoding="UTF-8"?><ScriptObject><Version>1.0</Version>
 <ScriptVersion>1.0</ScriptVersion>
 <Name><![CDATA[CAVIC2]]></Name>
 <LibPath><![CDATA[]]></LibPath>
 <CurrentValue>
 <Value>
 <Type>5</Type>
-<StringValue></StringValue>
+<StringValue/>
 <DoubleValue>2.000000000000</DoubleValue>
 </Value>
 </CurrentValue>
 <CurrentValue>
 <Value>
 <Type>6</Type>
-<StringValue></StringValue>
+<StringValue/>
 <DoubleValue>1.000000000000</DoubleValue>
 </Value>
 </CurrentValue>
 <CurrentValue>
 <Value>
 <Type>6</Type>
-<StringValue></StringValue>
+<StringValue/>
 <DoubleValue>1.000000000000</DoubleValue>
 </Value>
 </CurrentValue>
 <CurrentValue>
 <Value>
 <Type>6</Type>
-<StringValue></StringValue>
+<StringValue/>
 <DoubleValue>1.250000000000</DoubleValue>
 </Value>
 </CurrentValue>
 <CurrentValue>
 <Value>
 <Type>6</Type>
-<StringValue></StringValue>
+<StringValue/>
 <DoubleValue>0.075000000000</DoubleValue>
 </Value>
 </CurrentValue>
 <CurrentValue>
 <Value>
 <Type>6</Type>
-<StringValue></StringValue>
+<StringValue/>
 <DoubleValue>0.035000000000</DoubleValue>
 </Value>
 </CurrentValue>
 !(c) 2012, Manfred Moitzi, smartparts.tzb-moitzi.at
 !License: GPLv3, www.fsf.org
 
-VALUES "view" `Grundriss` , `Ansicht` , `Schnitt` 
-VALUES "type" "C 8/20" , "C 8/15" , "C 10/20" , "C 10/15" , "C 12/20" , "C 12/15" 
-VALUES "REF_X" RANGE [ 0.625 , ] STEP 0.625 , 0.625 
+VALUES "view" `Grundriss`, `Ansicht`, `Schnitt`
+VALUES "type" "C 8/20", "C 8/15", "C 10/20", "C 10/15", "C 12/20", "C 12/15"
+VALUES "ref_x" RANGE [0.625, ] STEP 0.625, 0.625
 
-HIDE "REF_Y" , "REF_Z" ]]></Text>
+HIDE "ref_y", "ref_z"
+]]></Text>
 </PartParameter>
 <PartMaster>
 <Enable>0</Enable>
 !(c) 2012, Manfred Moitzi, smartparts.tzb-moitzi.at
 !License: GPLv3, www.fsf.org
 
-length = REF_X 
-width = 0.067 
-width2 = width / 2 
-thickness = 0.035 
-back_length = 0.15 - thickness 
-radius_back_bar = 0.025 
+! box data
+!---------
+length = ref_x
+width = 0.067
+width2 = width / 2
+thickness = 0.035
+back_length = 0.15 - thickness
+radius_back_bar = 0.025
+id = 1 ! handle id
 
-LAYER "BP_BEW" 
+LAYER "BP_BEW"
 
-GOSUB type 
-GOSUB view 
-END 
+GOSUB type
+GOSUB view
+END
 
-�Grundriss�: 
+�Grundriss�:
+!-----------
 
-! handle to change length
-HANDLE2 0 , 0 , 1 , "ref_x" , 1 
-HANDLE2 REF_X , 0 , 1 , "ref_x" , 2 
-HANDLE2 -1 , 0 , 1 , "ref_x" , 3 
+HANDLE2 (0), (0), id, "ref_x", 1
+HANDLE2 (0+ref_x), (0), id, "ref_x", 2
+HANDLE2 (-1), (0), id, "ref_x", 3
+id = id + 1
 
-WHILE length > 0 DO 
-   IF length > 0.625 THEN 
-      box_length = 1.25 
-      draw_bars = bar_count 
-      ELSE 
-      box_length = 0.625 
-      draw_bars = bar_count / 2 
-   ENDIF 
-   
-   ! draw cavic box
-   PEN cavic_pen 
-   STROKE cavic_stroke 
-   RECT2 0 , -width2 , box_length , width2 
-   
-   ! draw bars
-   
-   bar_x = ( 1.25 - ( bar_count - 1 ) * bar_distance ) / 2 
-   
-   FOR i = 1 TO draw_bars 
-      CIRCLE2 bar_x , 0 , 0.006 
-      bar_x = bar_x + bar_distance 
-   NEXT i 
-   TRANS2 box_length , 0 
-   length = length - box_length 
-ENDWHILE 
+WHILE length > 0 DO
+IF length > 0.625 THEN
+    box_length = 1.25
+    draw_bars = bar_count
+ELSE
+    box_length = 0.625
+    draw_bars = bar_count / 2
+ENDIF
 
-RETURN 
+! draw cavic box
+!---------------
+PEN cavic_pen
+STROKE cavic_stroke
+RECT2 0, -width2, box_length, width2
 
-�Ansicht�: 
-! handle to change length
-HANDLE2 0 , 0 , 1 , "ref_x" , 1 
-HANDLE2 REF_X , 0 , 1 , "ref_x" , 2 
-HANDLE2 -1 , 0 , 1 , "ref_x" , 3 
+! draw bars
+!----------
+bar_x = (1.25 - (bar_count-1) * bar_distance) / 2
 
-WHILE length > 0 DO 
-   IF length > 0.625 THEN 
-      box_length = 1.25 
-      draw_bars = bar_count 
-      ELSE 
-      box_length = 0.625 
-      draw_bars = bar_count / 2 
-   ENDIF 
-   
-   ! draw cavic box
-   PEN cavic_pen 
-   STROKE cavic_stroke 
-   RECT2 0 , 0 , box_length , thickness 
-   
-   ! draw bars
-   
-   bar_x = ( 1.25 - ( bar_count - 1 ) * bar_distance ) / 2 
-   FOR i = 1 TO draw_bars 
-      STROKE bendout_stroke 
-      LINE2 bar_x , thickness , bar_x , thickness + bar_length 
-      STROKE cavic_stroke 
-      IF i > ( bar_count / 2 ) THEN 
-         angle = -180 
-         ELSE 
-         angle = 180 
-      ENDIF 
-      POLY2_ 4 , 1 , 
-      ( bar_x ) , ( 0 ) , ( 0 ) , 
-      ( 0 ) , ( -( back_length - radius_back_bar ) ) , ( 100 + 0 ) , 
-      ( radius_back_bar ) , ( angle ) , ( 2000 + 0 ) , 
-      ( 0 ) , ( 0.05 ) , ( 100 + 0 ) 
-      bar_x = bar_x + bar_distance 
-   NEXT i 
-   
-   TRANS2 box_length , 0 
-   length = length - box_length 
-   
-ENDWHILE 
+FOR i = 1 to draw_bars
+    CIRCLE2 bar_x, 0, 0.006
+    bar_x = bar_x + bar_distance
+NEXT i
+TRANS2 box_length, 0
+length = length - box_length
+ENDWHILE
 
-RETURN 
+RETURN
 
-�Schnitt�: 
+�Ansicht�:
+!---------
+
+HANDLE2 (0), (0), id, "ref_x", 1
+HANDLE2 (0+ref_x), (0), id, "ref_x", 2
+HANDLE2 (-1), (0), id, "ref_x", 3
+id = id + 1
+
+WHILE length > 0 DO
+IF length > 0.625 THEN
+    box_length = 1.25
+    draw_bars = bar_count
+ELSE
+    box_length = 0.625
+    draw_bars = bar_count / 2
+ENDIF
+
 ! draw cavic box
-PEN cavic_pen 
-STROKE cavic_stroke 
-RECT2 0 , -width2 , thickness , width2 
+!---------------
+PEN cavic_pen
+STROKE cavic_stroke
+RECT2 0, 0, box_length, thickness
+
+! draw bars
+!----------
+bar_x = (1.25 - (bar_count-1) * bar_distance) / 2
+FOR i = 1 to draw_bars
+    STROKE bendout_stroke
+    LINE2 bar_x, thickness, bar_x, thickness + bar_length
+    STROKE cavic_stroke
+IF i > (bar_count / 2) THEN
+    angle = -180
+ELSE
+    angle = 180
+ENDIF
+POLY2_ 4, 1,
+(bar_x), (0), (0),
+(0), (-(back_length - radius_back_bar)), (100+0),
+(radius_back_bar), (angle), (2000+0),
+(0), (0.05), (100+0)
+    bar_x = bar_x + bar_distance
+NEXT i
+
+TRANS2 box_length, 0
+length = length - box_length
+
+ENDWHILE
+
+RETURN
+
+�Schnitt�:
+!---------
+
+! draw cavic box
+!---------------
+PEN cavic_pen
+STROKE cavic_stroke
+RECT2 0, -width2, thickness, width2
 
 ! draw bar
-STROKE bendout_stroke 
-LINE2 -back_length , 0 , thickness + bar_length , 0 
+!---------
+STROKE bendout_stroke
+LINE2 -back_length, 0, thickness + bar_length, 0
 
-RETURN 
+RETURN
 
-"C 8/20": 
-bar_distance = 0.2 
-bar_length = 0.3 
-bar_count = 6 
-RETURN 
-"C 8/15": 
-bar_distance = 0.15 
-bar_length = 0.3 
-bar_count = 8 
-RETURN 
-"C 10/20": 
-bar_distance = 0.2 
-bar_length = 0.38 
-bar_count = 6 
-RETURN 
-"C 10/15": 
-bar_distance = 0.15 
-bar_length = 0.38 
-bar_count = 8 
-RETURN 
-"C 12/20": 
-bar_distance = 0.2 
-bar_length = 0.45 
-bar_count = 6 
-RETURN 
-"C 12/15": 
-bar_distance = 0.15 
-bar_length = 0.45 
-bar_count = 8 
-RETURN ]]></Text>
+
+"C 8/20":
+bar_distance = 0.2
+bar_length = 0.3
+bar_count = 6
+RETURN
+
+
+"C 8/15":
+bar_distance = 0.15
+bar_length = 0.3
+bar_count = 8
+RETURN
+
+
+"C 10/20":
+bar_distance = 0.2
+bar_length = 0.38
+bar_count = 6
+RETURN
+
+
+"C 10/15":
+bar_distance = 0.15
+bar_length = 0.38
+bar_count = 8
+RETURN
+
+
+"C 12/20":
+bar_distance = 0.2
+bar_length = 0.45
+bar_count = 6
+RETURN
+
+
+"C 12/15":
+bar_distance = 0.15
+bar_length = 0.45
+bar_count = 8
+RETURN
+
+
+
+
+
+
+
+
+
+
+
+
+]]></Text>
 </Part2D>
 <Part3D>
 <Enable>0</Enable>

File lib/basic.mako

 
 <%def name="palette_parameter(parameter)" filter="trim">
 I_INFIELD "${parameter}" , 1, 1, 1, 1
-</%def>
+</%def>
+
+<%def name="bas_handle2(x, y, param, id='id')" filter="trim">
+HANDLE2 (${x}), (${y}), ${id}, "${param}", 1
+</%def>
+
+<%def name="mov_handle2(x, y, param, id='id')" filter="trim">
+HANDLE2 (${x}), (${y}), ${id}, "${param}", 2
+</%def>
+
+<%def name="ref_handle2(x, y, param, id='id')" filter="trim">
+HANDLE2 (${x}), (${y}), ${id}, "${param}", 3
+</%def>
+
+<%def name="create_x_handle2(x=0, y=0, length='ref_x', param='ref_x', id='id', dir=-1)" filter="trim">
+${bas_handle2(x, y, param, id)}
+${mov_handle2("{}+{}".format(x, length), y, param, id)}
+${ref_handle2(dir, y, param, id)}
+${id} = ${id} + 1
+</%def>
+
+<%def name="create_y_handle2(x=0, y=0, length='ref_y', param='ref_y', id='id', dir=-1)" filter="trim">
+${bas_handle2(x, y, param, id)}
+${mov_handle2(x, "{}+{}".format(y, length), param, id)}
+${ref_handle2(x, dir, param, id)}
+${id} = ${id} + 1
+</%def>

File scripts/CAVIC2.Part2D.mako

 !(c) 2012, Manfred Moitzi, smartparts.tzb-moitzi.at
 !License: GPLv3, www.fsf.org
 
-<%namespace file="poly.mako" import="*" />
-
+! box data
+!---------
 length = ref_x
-
 width = 0.067
 width2 = width / 2
 thickness = 0.035
 back_length = 0.15 - thickness
 radius_back_bar = 0.025
+id = 1 ! handle id
 
 LAYER "BP_BEW"
 
 END
 
 ´Grundriss´:
+!-----------
 
-${set_handle()}
+${create_x_handle2()}
 
 WHILE length > 0 DO
-${choose_length('length')}
+${set_box_length('length')}
 
 ! draw cavic box
+!---------------
 PEN cavic_pen
 STROKE cavic_stroke
 RECT2 0, -width2, box_length, width2
 
 ! draw bars
-
+!----------
 ${set_start_x('bar_x')}
 
 FOR i = 1 to draw_bars
 RETURN
 
 ´Ansicht´:
-${set_handle()}
+!---------
+
+${create_x_handle2()}
 
 WHILE length > 0 DO
-${choose_length('length')}
+${set_box_length('length')}
 
 ! draw cavic box
+!---------------
 PEN cavic_pen
 STROKE cavic_stroke
 RECT2 0, 0, box_length, thickness
 
 ! draw bars
-
+!----------
 ${set_start_x('bar_x')}
 FOR i = 1 to draw_bars
     STROKE bendout_stroke
 RETURN
 
 ´Schnitt´:
+!---------
+
 ! draw cavic box
+!---------------
 PEN cavic_pen
 STROKE cavic_stroke
 RECT2 0, -width2, thickness, width2
 
 ! draw bar
+!---------
 STROKE bendout_stroke
 LINE2 -back_length, 0, thickness + bar_length, 0
 
 RETURN
 
+${cavic_data("C 8/20", distance=0.20, bars=6, length=0.30)}
+${cavic_data("C 8/15", distance=0.15, bars=8, length=0.30)}
+${cavic_data("C 10/20", distance=0.20, bars=6, length=0.38)}
+${cavic_data("C 10/15", distance=0.15, bars=8, length=0.38)}
+${cavic_data("C 12/20", distance=0.20, bars=6, length=0.45)}
+${cavic_data("C 12/15", distance=0.15, bars=8, length=0.45)}
+
+##-----------------------------------------------------------
+##--- macro definitions
+##-----------------------------------------------------------
+<%namespace file="poly.mako" import="*" />
+<%namespace file="basic.mako" import="*" />
+
+<%def name="cavic_data(name, distance, bars, length)">
+"${name}":
+bar_distance = ${distance}
+bar_length = ${length}
+bar_count = ${bars}
+RETURN
+</%def>
+
 <%def name="draw_back_bar(x, pos)" filter="trim">
 STROKE cavic_stroke
 IF ${pos} > (bar_count / 2) THEN
 ${line_rel(0, 0.05)}
 </%def>
 
-<%def name="set_handle()" filter="trim">
-! handle to change length
-HANDLE2 0, 0, 1, "ref_x", 1
-HANDLE2 ref_x, 0, 1, "ref_x", 2
-HANDLE2 -1, 0, 1, "ref_x", 3
-</%def>
-
-<%def name="choose_length(len)" filter="trim">
+<%def name="set_box_length(len)" filter="trim">
 IF ${len} > 0.625 THEN
     box_length = 1.25
     draw_bars = bar_count
 <%def name="set_start_x(x)" filter="trim">
 ${x} = (1.25 - (bar_count-1) * bar_distance) / 2
 </%def>
-
-<%def name="cavic_data(name, distance, bars, length)" filter="trim">
-"${name}":
-bar_distance = ${distance}
-bar_length = ${length}
-bar_count = ${bars}
-RETURN
-</%def>
-
-${cavic_data("C 8/20", distance=0.20, bars=6, length=0.30)}
-${cavic_data("C 8/15", distance=0.15, bars=8, length=0.30)}
-${cavic_data("C 10/20", distance=0.20, bars=6, length=0.38)}
-${cavic_data("C 10/15", distance=0.15, bars=8, length=0.38)}
-${cavic_data("C 12/20", distance=0.20, bars=6, length=0.45)}
-${cavic_data("C 12/15", distance=0.15, bars=8, length=0.45)}