Commits

Manfred Moitzi committed 5bfc23a

added RangingRebars.smt

  • Participants
  • Parent commits 135b50a

Comments (0)

Files changed (10)

File .idea/workspace.xml

 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="d10fe02a-bdc8-4418-9494-70adbe7601f3" name="Default" comment="">
-      <change type="DELETED" beforePath="O:\Office\MySmartParts\mako2smt\scripts\CurvedText.Part3D.mako" afterPath="" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Curved3DText.smt" afterPath="$PROJECT_DIR$/Curved3DText.smt" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/CurvedText.smt" afterPath="$PROJECT_DIR$/CurvedText.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/Curved3DText.Part3D.mako" afterPath="$PROJECT_DIR$/scripts/Curved3DText.Part3D.mako" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/scripts/CurvedText.Part2D.mako" afterPath="$PROJECT_DIR$/scripts/CurvedText.Part2D.mako" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/mako2smt.py" afterPath="$PROJECT_DIR$/src/mako2smt.py" />
     </list>
     <ignored path="mako2smt.iws" />
     <ignored path=".idea/workspace.xml" />
       <created>1352648258994</created>
       <updated>1352648258994</updated>
     </task>
-    <option name="localTasksCounter" value="27" />
+    <task id="LOCAL-00027" summary="reset uuid of smartpart at every compiler run">
+      <created>1353081150745</created>
+      <updated>1353081150745</updated>
+    </task>
+    <option name="localTasksCounter" value="28" />
     <servers />
   </component>
   <component name="ToolWindowManager">
     <frame x="-8" y="-8" width="1874" height="1216" extended-state="6" />
     <editor active="false" />
     <layout>
+      <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="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="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="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" />
       <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
     <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="extended Klothoide.smt" />
+    <option name="LAST_COMMIT_MESSAGE" value="reset uuid of smartpart at every compiler run" />
     <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" />
     <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
     <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
     <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
-    <MESSAGE value="added smartpart updater" />
     <MESSAGE value="added Part script extraction from *.smt files; using argparser;" />
     <MESSAGE value="added debug option" />
     <MESSAGE value="refactorings and cleanup" />
     <MESSAGE value="added simple profiling tools and code polish" />
     <MESSAGE value="added Spline2D Smartpart" />
     <MESSAGE value="extended Klothoide.smt" />
+    <MESSAGE value="reset uuid of smartpart at every compiler run" />
   </component>
   <component name="XDebuggerManager">
     <breakpoint-manager>

File Curved3DText.smt

 <LibPath><![CDATA[]]></LibPath>
 <Type>1</Type>
 <SubType>0</SubType>
-<UUID>edf885d0-0aa7-47ab-8aa4-306a35746fdf</UUID>
+<UUID>f3df091b-011c-424a-aa40-fb033410597b</UUID>
 <Language>de</Language>
 <StringTable>
 </StringTable>
 <Value>
 <Type>6</Type>
 <StringValue/>
-<DoubleValue>5.000000000000</DoubleValue>
+<DoubleValue>400.0000000000</DoubleValue>
 </Value>
 </CurrentValue>
 </Parameter>
 <Value>
 <Type>6</Type>
 <StringValue/>
-<DoubleValue>90.000000000000</DoubleValue>
+<DoubleValue>0.000000000000</DoubleValue>
 </Value>
 </CurrentValue>
 </Parameter>
 	vx = result[1]
 	vy = result[2]
 	GOSUB "vector_to_angle" 
+	! result: alpha = angle of curve tangent
 	
 TRANS x, y, 0
 ROTZ alpha
 IF PREV_MODE THEN
 	IF chars[i] <> " " THEN
 		TRANSX -real_text_height/2
-		ROTX x_char_rotation
-		ROTY y_char_rotation
-		ROTZ z_char_rotation
-		SCALEX char_width_factor
+		
+	ROTX x_char_rotation
+	ROTY y_char_rotation
+	ROTZ z_char_rotation
+	SCALEX char_width_factor
+
 		BOX real_text_height, real_text_height, ref_z
 		RESTORE 5
 	ENDIF
 ELSE
 	IF chars[i] <> " " THEN
-		ROTX x_char_rotation
-		ROTY y_char_rotation
-		ROTZ z_char_rotation
-		SCALEX char_width_factor
+		
+	ROTX x_char_rotation
+	ROTY y_char_rotation
+	ROTZ z_char_rotation
+	SCALEX char_width_factor
+		
 		TEXT ref_z, 0, chars[i]
 		RESTORE 4
 	ENDIF
 	pos = pos + STW(chars[i])
 NEXT i
 
+GOSUB "place_bezier_handles"
+END
+!--------------------------------------------------------------
 
+"place_bezier_handles":
 ! place handle for bezier point (1)
 HANDLE (bezier_points[1][1]), (0), (0), 1, bezier_points[1][2], 1
 HANDLE (bezier_points[1][1]), (bezier_points[1][2]), (0), 1, bezier_points[1][2], 2
 HANDLE (0), (bezier_points[4][2]), (0), 4, bezier_points[4][1], 1
 HANDLE (bezier_points[4][1]), (bezier_points[4][2]), (0), 4, bezier_points[4][1], 2
 HANDLE (-1), (bezier_points[4][2]), (0), 4, bezier_points[4][1], 3
-
-
-END
-
-!--------------------------------------------------------------
-
-"place_text_size_ handle":
-x = bezier_points[1][1]
-y = bezier_points[1][2]
-
-! normalize direction vector
-size_handle_length = SQR(size_handle_vx^2 + size_handle_vy^2)
-vx = size_handle_vx / size_handle_length
-vy = size_handle_vy / size_handle_length
-
-dx = vx * real_text_height
-dy = vy * real_text_height
-
-! calibrate handle
-HANDLEFACTOR text_size/real_text_height
-
-! place character size handle
-HANDLE2 (x), (y), 5, text_size, 1
-HANDLE2 (x+dx), (y+dy), 5, text_size, 2
-HANDLE2 (x-dx), (y-dy), 5, text_size, 3
 RETURN
 
 

File CurvedText.smt

 <LibPath><![CDATA[]]></LibPath>
 <Type>1</Type>
 <SubType>0</SubType>
-<UUID>4ffd75be-d7f3-46b0-9336-8652edc69efb</UUID>
+<UUID>82149440-3ed6-4519-9ea3-013a99cad29a</UUID>
 <Language>de</Language>
 <StringTable>
 </StringTable>
 	GOSUB "vector_to_angle" 
 	
 	! result: alpha = angle of curve tangent
-	IF i = 1 THEN ! store direction perpendicular to tangent of first character
-		size_handle_vx = -vy
-		size_handle_vy = vx
-	ENDIF
 	! place character at x,y with rotation alpha
 	TRANS2 x, y
 	ROT2 alpha
+	IF i = 1 GOSUB "place_text_size_handle"
 	SCALE2 char_width_factor, 1.0
 	! Allplan 2013 doesn't scale 2D Text, perhaps it works in a later version
 	TEXT2 0, 0, chars[i]
 	pos = pos + STW(chars[i])
 NEXT i
 
+GOSUB "place_bezier_handles"
+END
+!--------------------------------------------------------------
 
+"place_bezier_handles":
 ! place handle for bezier point (1)
 HANDLE2 (bezier_points[1][1]), (0), 1, bezier_points[1][2], 1
 HANDLE2 (bezier_points[1][1]), (bezier_points[1][2]), 1, bezier_points[1][2], 2
 HANDLE2 (0), (bezier_points[4][2]), 4, bezier_points[4][1], 1
 HANDLE2 (bezier_points[4][1]), (bezier_points[4][2]), 4, bezier_points[4][1], 2
 HANDLE2 (-1), (bezier_points[4][2]), 4, bezier_points[4][1], 3
+RETURN
 
-GOSUB "place_text_size_ handle"
-
-
-
-END
-
-!--------------------------------------------------------------
-
-"place_text_size_ handle":
-x = bezier_points[1][1]
-y = bezier_points[1][2]
-
-! normalize direction vector
-size_handle_length = SQR(size_handle_vx^2 + size_handle_vy^2)
-vx = size_handle_vx / size_handle_length
-vy = size_handle_vy / size_handle_length
-
-dx = vx * real_text_height
-dy = vy * real_text_height
-
+"place_text_size_handle":
 ! calibrate handle
 HANDLEFACTOR text_size/real_text_height
-
 ! place character size handle
-HANDLE2 (x), (y), 5, text_size, 1
-HANDLE2 (x+dx), (y+dy), 5, text_size, 2
-HANDLE2 (x-dx), (y-dy), 5, text_size, 3
+HANDLE2 (0), (0), 5, text_size, 1
+HANDLE2 (0), (real_text_height), 5, text_size, 2
+HANDLE2 (0), (-1), 5, text_size, 3
+HANDLEFACTOR 1
 RETURN
 
 

File RangingRebars.ini

+[Parts]
+PartParameter = RangingRebars.PartParameter.mako
+Part2D = RangingRebars.Part2D.mako
+PartDialog = RangingRebars.PartDialog.mako
+

File RangingRebars.smt

+<?xml version="1.0" encoding="UTF-8"?><ScriptObject><Version>1.0</Version>
+<ScriptVersion>1.0</ScriptVersion>
+<Name><![CDATA[RangingRebars]]></Name>
+<LibPath><![CDATA[]]></LibPath>
+<Type>1</Type>
+<SubType>0</SubType>
+<UUID>b03f7c20-889a-4bb4-9828-578a2cbfe944</UUID>
+<Language>de</Language>
+<StringTable>
+</StringTable>
+<RelativeOrigin>0.5000000000000000 0.5000000000000000 0.5000000000000000</RelativeOrigin>
+<AbsoluteOrigin>0.0000000000000000 0.0000000000000000 0.0000000000000000</AbsoluteOrigin>
+<SeparateExecParts>1</SeparateExecParts>
+<Group>0</Group>
+<AutoPlaceResourceObjects>1</AutoPlaceResourceObjects>
+<AutoReferenceBox>0</AutoReferenceBox>
+<Scale>1</Scale>
+<Use3DPreview>0</Use3DPreview>
+<Link>0</Link>
+<Consider>0</Consider>
+<SimplePlacing>0</SimplePlacing>
+<HeightReference>0</HeightReference>
+<HeightOffset>0.0000000000000000</HeightOffset>
+<UnitFactor>1.0000000000000000</UnitFactor>
+<PositionNumber>1</PositionNumber>
+<IsLocked>0</IsLocked>
+<IsEncrypted>0</IsEncrypted>
+<Key><![CDATA[]]></Key>
+<DependentFiles>
+</DependentFiles>
+<Parameters>
+<Type>1</Type>
+<AutoUpdateValues>1</AutoUpdateValues>
+<MapPenToColor>0</MapPenToColor>
+<Parameter>
+<Identifier>defpoints</Identifier>
+<Name><![CDATA[Definitionspunkte]]></Name>
+<Group><![CDATA[]]></Group>
+<Type>1</Type>
+<Attribute>-1</Attribute>
+<SystemID>0</SystemID>
+<Expandable>0</Expandable>
+<Hidden>0</Hidden>
+<Lock>0</Lock>
+<Export>0</Export>
+<Save>1</Save>
+<CurrentValue>
+<Value>
+<Type>6</Type>
+<StringValue/>
+<DoubleValue>0.000000000000</DoubleValue>
+</Value>
+</CurrentValue>
+<ValueArray>
+<Dimension>2</Dimension>
+<Bounds>
+<Bound Expandable="0">4</Bound>
+<Bound Expandable="0">2</Bound>
+<Bound Expandable="0">0</Bound>
+<Bound Expandable="0">0</Bound>
+<Bound Expandable="0">0</Bound>
+<Bound Expandable="0">0</Bound>
+<Bound Expandable="0">0</Bound>
+<Bound Expandable="0">0</Bound>
+<Bound Expandable="0">0</Bound>
+<Bound Expandable="0">0</Bound>
+</Bounds>
+<Values>
+<Value>
+<Type>6</Type>
+<StringValue/>
+<DoubleValue>0.000000000000</DoubleValue>
+</Value>
+<Value>
+<Type>6</Type>
+<StringValue/>
+<DoubleValue>1.000000000000</DoubleValue>
+</Value>
+<Value>
+<Type>6</Type>
+<StringValue/>
+<DoubleValue>1.000000000000</DoubleValue>
+</Value>
+<Value>
+<Type>6</Type>
+<StringValue/>
+<DoubleValue>0.000000000000</DoubleValue>
+</Value>
+<Value>
+<Type>6</Type>
+<StringValue/>
+<DoubleValue>0.000000000000</DoubleValue>
+</Value>
+<Value>
+<Type>6</Type>
+<StringValue/>
+<DoubleValue>0.000000000000</DoubleValue>
+</Value>
+<Value>
+<Type>6</Type>
+<StringValue/>
+<DoubleValue>1.000000000000</DoubleValue>
+</Value>
+<Value>
+<Type>6</Type>
+<StringValue/>
+<DoubleValue>1.000000000000</DoubleValue>
+</Value>
+</Values>
+</ValueArray>
+</Parameter>
+<Parameter>
+<Identifier>cut_line_end_pos</Identifier>
+<Name><![CDATA[Endposition]]></Name>
+<Group><![CDATA[]]></Group>
+<Type>1</Type>
+<Attribute>-1</Attribute>
+<SystemID>0</SystemID>
+<Expandable>0</Expandable>
+<Hidden>0</Hidden>
+<Lock>0</Lock>
+<Export>0</Export>
+<Save>1</Save>
+<CurrentValue>
+<Value>
+<Type>6</Type>
+<StringValue/>
+<DoubleValue>0.500000000000</DoubleValue>
+</Value>
+</CurrentValue>
+</Parameter>
+<Parameter>
+<Identifier>layer0</Identifier>
+<Name><![CDATA[Layer]]></Name>
+<Group><![CDATA[]]></Group>
+<Type>10</Type>
+<Attribute>-1</Attribute>
+<SystemID>0</SystemID>
+<Expandable>0</Expandable>
+<Hidden>0</Hidden>
+<Lock>0</Lock>
+<Export>0</Export>
+<Save>1</Save>
+<CurrentValue>
+<Value>
+<Type>5</Type>
+<StringValue/>
+<DoubleValue>0.000000000000</DoubleValue>
+</Value>
+</CurrentValue>
+</Parameter>
+<Parameter>
+<Identifier>rebar_color</Identifier>
+<Name><![CDATA[Stabfarbe]]></Name>
+<Group><![CDATA[]]></Group>
+<Type>7</Type>
+<Attribute>-1</Attribute>
+<SystemID>0</SystemID>
+<Expandable>0</Expandable>
+<Hidden>0</Hidden>
+<Lock>0</Lock>
+<Export>0</Export>
+<Save>1</Save>
+<CurrentValue>
+<Value>
+<Type>6</Type>
+<StringValue/>
+<DoubleValue>7.000000000000</DoubleValue>
+</Value>
+</CurrentValue>
+</Parameter>
+<Parameter>
+<Identifier>rebar_count</Identifier>
+<Name><![CDATA[Stabanzahl]]></Name>
+<Group><![CDATA[]]></Group>
+<Type>5</Type>
+<Attribute>-1</Attribute>
+<SystemID>0</SystemID>
+<Expandable>0</Expandable>
+<Hidden>0</Hidden>
+<Lock>0</Lock>
+<Export>0</Export>
+<Save>1</Save>
+<CurrentValue>
+<Value>
+<Type>5</Type>
+<StringValue/>
+<DoubleValue>2.000000000000</DoubleValue>
+</Value>
+</CurrentValue>
+</Parameter>
+<Parameter>
+<Identifier>rebar_length</Identifier>
+<Name><![CDATA[Stabl�nge]]></Name>
+<Group><![CDATA[]]></Group>
+<Type>1</Type>
+<Attribute>-1</Attribute>
+<SystemID>0</SystemID>
+<Expandable>0</Expandable>
+<Hidden>0</Hidden>
+<Lock>0</Lock>
+<Export>0</Export>
+<Save>1</Save>
+<CurrentValue>
+<Value>
+<Type>6</Type>
+<StringValue/>
+<DoubleValue>1.000000000000</DoubleValue>
+</Value>
+</CurrentValue>
+</Parameter>
+<Parameter>
+<Identifier>rebar_pen</Identifier>
+<Name><![CDATA[Stabstift]]></Name>
+<Group><![CDATA[]]></Group>
+<Type>8</Type>
+<Attribute>-1</Attribute>
+<SystemID>0</SystemID>
+<Expandable>0</Expandable>
+<Hidden>0</Hidden>
+<Lock>0</Lock>
+<Export>0</Export>
+<Save>1</Save>
+<CurrentValue>
+<Value>
+<Type>5</Type>
+<StringValue/>
+<DoubleValue>1.000000000000</DoubleValue>
+</Value>
+</CurrentValue>
+</Parameter>
+<Parameter>
+<Identifier>rebar_pitch</Identifier>
+<Name><![CDATA[Stababstand]]></Name>
+<Group><![CDATA[]]></Group>
+<Type>1</Type>
+<Attribute>-1</Attribute>
+<SystemID>0</SystemID>
+<Expandable>0</Expandable>
+<Hidden>0</Hidden>
+<Lock>0</Lock>
+<Export>0</Export>
+<Save>1</Save>
+<CurrentValue>
+<Value>
+<Type>6</Type>
+<StringValue/>
+<DoubleValue>0.000000000000</DoubleValue>
+</Value>
+</CurrentValue>
+</Parameter>
+<Parameter>
+<Identifier>rebar_stroke</Identifier>
+<Name><![CDATA[Stabstrich]]></Name>
+<Group><![CDATA[]]></Group>
+<Type>9</Type>
+<Attribute>-1</Attribute>
+<SystemID>0</SystemID>
+<Expandable>0</Expandable>
+<Hidden>0</Hidden>
+<Lock>0</Lock>
+<Export>0</Export>
+<Save>1</Save>
+<CurrentValue>
+<Value>
+<Type>6</Type>
+<StringValue/>
+<DoubleValue>1.000000000000</DoubleValue>
+</Value>
+</CurrentValue>
+</Parameter>
+<Parameter>
+<Identifier>ref_x</Identifier>
+<Name><![CDATA[X-Abmessung]]></Name>
+<Group><![CDATA[]]></Group>
+<Type>1</Type>
+<Attribute>-1</Attribute>
+<SystemID>1</SystemID>
+<Expandable>0</Expandable>
+<Hidden>0</Hidden>
+<Lock>0</Lock>
+<Export>0</Export>
+<Save>1</Save>
+<CurrentValue>
+<Value>
+<Type>6</Type>
+<StringValue/>
+<DoubleValue>1.000000000000</DoubleValue>
+</Value>
+</CurrentValue>
+</Parameter>
+<Parameter>
+<Identifier>ref_y</Identifier>
+<Name><![CDATA[Y-Abmessung]]></Name>
+<Group><![CDATA[]]></Group>
+<Type>1</Type>
+<Attribute>-1</Attribute>
+<SystemID>2</SystemID>
+<Expandable>0</Expandable>
+<Hidden>0</Hidden>
+<Lock>0</Lock>
+<Export>0</Export>
+<Save>1</Save>
+<CurrentValue>
+<Value>
+<Type>6</Type>
+<StringValue/>
+<DoubleValue>1.000000000000</DoubleValue>
+</Value>
+</CurrentValue>
+</Parameter>
+<Parameter>
+<Identifier>ref_z</Identifier>
+<Name><![CDATA[Z-Abmessung]]></Name>
+<Group><![CDATA[]]></Group>
+<Type>1</Type>
+<Attribute>-1</Attribute>
+<SystemID>3</SystemID>
+<Expandable>0</Expandable>
+<Hidden>0</Hidden>
+<Lock>0</Lock>
+<Export>0</Export>
+<Save>1</Save>
+<CurrentValue>
+<Value>
+<Type>6</Type>
+<StringValue/>
+<DoubleValue>1.000000000000</DoubleValue>
+</Value>
+</CurrentValue>
+</Parameter>
+<Parameter>
+<Identifier>cut_line_start_pos</Identifier>
+<Name><![CDATA[Startposition]]></Name>
+<Group><![CDATA[]]></Group>
+<Type>1</Type>
+<Attribute>-1</Attribute>
+<SystemID>0</SystemID>
+<Expandable>0</Expandable>
+<Hidden>0</Hidden>
+<Lock>0</Lock>
+<Export>0</Export>
+<Save>1</Save>
+<CurrentValue>
+<Value>
+<Type>6</Type>
+<StringValue/>
+<DoubleValue>0.500000000000</DoubleValue>
+</Value>
+</CurrentValue>
+</Parameter>
+</Parameters>
+<Script><PartParameter>
+<Enable>1</Enable>
+<Text><![CDATA[! gef�cherte St�be
+! (c) 2012, Manfred Moitzi, smartparts.tzb-moitzi.at
+! License: GPLv3, www.fsf.org
+
+
+
+start_length = SQR( (defpoints[1][1]-defpoints[4][1])^2 + (defpoints[1][2]-defpoints[4][2])^2 )
+end_length = SQR( (defpoints[2][1]-defpoints[3][1])^2 + (defpoints[2][2]-defpoints[3][2])^2 )
+
+VALUES "rebar_count" RANGE [2, ) STEP 2, 1
+VALUES "cut_line_start_pos" RANGE [0, start_length]
+VALUES "cut_line_end_pos" RANGE [0, end_length]]]></Text>
+</PartParameter>
+<PartMaster>
+<Enable>1</Enable>
+<Text><![CDATA[! gef�cherte St�be
+! (c) 2012, Manfred Moitzi, smartparts.tzb-moitzi.at
+! License: GPLv3, www.fsf.org
+]]></Text>
+</PartMaster>
+<Part2D>
+<Enable>1</Enable>
+<Text><![CDATA[! gef�cherte St�be
+! (c) 2012, Manfred Moitzi, smartparts.tzb-moitzi.at
+! License: GPLv3, www.fsf.org
+
+
+
+!--- definitions
+spaces = rebar_count - 1
+! base line = defpoints[1] -> defpoints[2]
+DIM base_points[rebar_count][2] ! coords of: base line divided into 'spaces' points 
+! target line = defpoints[4] -> defpoints[3]
+DIM target_points[rebar_count][2] ! coords of: target line divided into 'spaces' points 
+DIM unit_vectors[rebar_count][2] ! unit vectors for lines from base line to target line
+DIM cut_line_distances[rebar_count] ! distance from base line to cut line
+DIM cut_points[rebar_count][2] ! coords of the cutting points = interscetion of rebar with cut line
+DIM rebar_start_points[rebar_count][2] ! coords
+DIM rebar_end_points[rebar_count][2] ! coords
+
+!--- calculations
+GOSUB "set_base_line"
+GOSUB "set_target_line"
+GOSUB "calc_unit_vectors"
+GOSUB "calc_cut_line_distances"
+GOSUB "calc_cut_points"
+GOSUB "calc_rebar_points"
+
+!--- graphics
+GOSUB "set_properties"
+IF PREV_MODE GOSUB "draw_preview"
+FOR counter = 1 to rebar_count
+	GOSUB "draw_rebar"
+NEXT counter
+
+!--- interactive part
+GOSUB "place_handles"
+END
+
+!--- subroutines
+"draw_preview":
+AUX_MODE 1
+LINE2 cut_points[1][1], cut_points[1][2], cut_points[rebar_count][1], cut_points[rebar_count][2]
+FOR i = 1 to rebar_count
+	LINE2 base_points[i][1], base_points[i][2],
+	target_points[i][1], target_points[i][2]
+NEXT i
+AUX_MODE 0
+RETURN
+
+"draw_rebar":
+LINE2 rebar_start_points[counter][1], rebar_start_points[counter][2],
+rebar_end_points[counter][1], rebar_end_points[counter][2]
+RETURN
+
+"set_properties":
+LAYER layer0
+COLOR rebar_color
+PEN rebar_color
+STROKE rebar_stroke
+RETURN
+
+"set_base_line": ! divide base line = defpoints[1] -> defpoints[2]
+
+delta_x = (defpoints[2][1] - defpoints[1][1]) / spaces
+delta_y = (defpoints[2][2] - defpoints[1][2]) / spaces
+FOR i = 1 to rebar_count
+	base_points[i][1] = defpoints[1][1] + delta_x * (i - 1)
+	base_points[i][2] = defpoints[1][2] + delta_y * (i - 1)
+NEXT i
+
+RETURN
+
+"set_target_line": ! divide target line = defpoints[4] -> defpoints[3]
+
+delta_x = (defpoints[3][1] - defpoints[4][1]) / spaces
+delta_y = (defpoints[3][2] - defpoints[4][2]) / spaces
+FOR i = 1 to rebar_count
+	target_points[i][1] = defpoints[4][1] + delta_x * (i - 1)
+	target_points[i][2] = defpoints[4][2] + delta_y * (i - 1)
+NEXT i
+
+RETURN
+
+"calc_unit_vectors":
+FOR i = 1 TO rebar_count
+	dx = target_points[i][1] - base_points[i][1]
+	dy = target_points[i][2] - base_points[i][2]
+	vector_length = SQR(dx^2 + dy^2)
+	unit_vectors[i][1] = dx / vector_length
+	unit_vectors[i][2] = dy / vector_length
+NEXT i
+RETURN
+
+"calc_cut_line_distances":
+! interpolate from cut_line_start_pos to cut_line_end_pos
+! cut_line_distance = distance from base line to cut line
+delta = (cut_line_end_pos - cut_line_start_pos) / spaces
+FOR i = 1 TO rebar_count
+	cut_line_distances[i] = cut_line_start_pos + delta * (i - 1)
+NEXT i
+RETURN
+
+"calc_cut_points":
+! calculate cutting points of rebar with the cut line
+FOR i = 1 TO rebar_count
+	FOR axis = 1 TO 2
+		cut_points[i][axis] = base_points[i][axis] + cut_line_distances[i] * unit_vectors[i][axis]
+	NEXT axis
+NEXT i
+RETURN
+
+"calc_rebar_points":
+! calculate start and end points of rebars
+! mid point of rebar = cutting point
+FOR i = 1 TO rebar_count
+	FOR axis = 1 TO 2
+		half_rebar = unit_vectors[i][axis] * rebar_length / 2
+		cut_point = cut_points[i][axis]
+		rebar_start_points[i][axis] = cut_point - half_rebar
+		rebar_end_points[i][axis] = cut_point + half_rebar
+	NEXT axis
+NEXT i
+RETURN
+
+"place_handles":
+! defpoint[1] handle
+HANDLE2 (defpoints[1][1]), (0), 1, defpoints[1][2], 1
+HANDLE2 (defpoints[1][1]), (defpoints[1][2]), 1, defpoints[1][2], 2
+HANDLE2 (defpoints[1][1]), (-1), 1, defpoints[1][2], 3
+HANDLE2 (0), (defpoints[1][2]), 1, defpoints[1][1], 1
+HANDLE2 (defpoints[1][1]), (defpoints[1][2]), 1, defpoints[1][1], 2
+HANDLE2 (-1), (defpoints[1][2]), 1, defpoints[1][1], 3
+
+! defpoint[2] handle
+HANDLE2 (defpoints[2][1]), (0), 2, defpoints[2][2], 1
+HANDLE2 (defpoints[2][1]), (defpoints[2][2]), 2, defpoints[2][2], 2
+HANDLE2 (defpoints[2][1]), (-1), 2, defpoints[2][2], 3
+HANDLE2 (0), (defpoints[2][2]), 2, defpoints[2][1], 1
+HANDLE2 (defpoints[2][1]), (defpoints[2][2]), 2, defpoints[2][1], 2
+HANDLE2 (-1), (defpoints[2][2]), 2, defpoints[2][1], 3
+
+! defpoint[3] handle
+HANDLE2 (defpoints[3][1]), (0), 3, defpoints[3][2], 1
+HANDLE2 (defpoints[3][1]), (defpoints[3][2]), 3, defpoints[3][2], 2
+HANDLE2 (defpoints[3][1]), (-1), 3, defpoints[3][2], 3
+HANDLE2 (0), (defpoints[3][2]), 3, defpoints[3][1], 1
+HANDLE2 (defpoints[3][1]), (defpoints[3][2]), 3, defpoints[3][1], 2
+HANDLE2 (-1), (defpoints[3][2]), 3, defpoints[3][1], 3
+
+! defpoint[4] handle
+HANDLE2 (defpoints[4][1]), (0), 4, defpoints[4][2], 1
+HANDLE2 (defpoints[4][1]), (defpoints[4][2]), 4, defpoints[4][2], 2
+HANDLE2 (defpoints[4][1]), (-1), 4, defpoints[4][2], 3
+HANDLE2 (0), (defpoints[4][2]), 4, defpoints[4][1], 1
+HANDLE2 (defpoints[4][1]), (defpoints[4][2]), 4, defpoints[4][1], 2
+HANDLE2 (-1), (defpoints[4][2]), 4, defpoints[4][1], 3
+
+! cut_line_start_pos handle
+HANDLE2 (defpoints[1][1]), (defpoints[1][2]), 5, cut_line_start_pos, 1
+HANDLE2 (cut_points[1][1]), (cut_points[1][2]), 5, cut_line_start_pos, 2
+HANDLE2 (-unit_vectors[1][1]), (-unit_vectors[1][2]), 5, cut_line_start_pos, 3
+
+! cut_line_end_pos handle
+HANDLE2 (defpoints[2][1]), (defpoints[2][2]), 6, cut_line_end_pos, 1
+HANDLE2 (cut_points[rebar_count][1]), (cut_points[rebar_count][2]), 6, cut_line_end_pos, 2
+HANDLE2 (-unit_vectors[rebar_count][1]), (-unit_vectors[rebar_count][2]), 6, cut_line_end_pos, 3
+RETURN
+
+
+]]></Text>
+</Part2D>
+<Part3D>
+<Enable>0</Enable>
+<Text><![CDATA[]]></Text>
+</Part3D>
+<PartDialog>
+<Enable>1</Enable>
+<Text><![CDATA[]]></Text>
+</PartDialog>
+</Script>
+<Drawing2D>
+</Drawing2D>
+<Drawing3D>
+</Drawing3D>
+<Pictures>
+<ImportBitmaps>0</ImportBitmaps>
+<ManageInList>1</ManageInList>
+<Picture Name="0" Type="png" Width="146" Height="159"><![CDATA[89504E470D0A1A0A0000000D49484452000000920000009F080600000012E58050000000017352474200AECE1CE90000000467414D410000B18F0BFC6105000000097048597300000EC300000EC301C76FA864000002C849444154785EEDD2310D00000CC3B0F127DD91C8E902E811F9660A04052EF870A1C040822029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A80946474021203490190928C4E40622029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A80946474021203490190928C4E40622029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A80946474021203490190928C4E40622029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A80946474021203490190928C4E40622029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A80946474021203490190928C4E40622029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A80946474021203490190928C4E40622029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A80946474021203490190928C4E40622029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A80946474021203490190928C4E40622029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A80946474021203490190928C4E40622029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A3C6FCC6270DCC766460000000049454E44AE426082]]></Picture>
+</Pictures>
+</ScriptObject>

File scripts/Curved3DText.Part3D.mako

 IF PREV_MODE THEN
 	IF chars[i] <> " " THEN
 		TRANSX -real_text_height/2
-		ROTX x_char_rotation
-		ROTY y_char_rotation
-		ROTZ z_char_rotation
-		SCALEX char_width_factor
+		${char_transformations()}
 		BOX real_text_height, real_text_height, ref_z
 		RESTORE 5
 	ENDIF
 ELSE
 	IF chars[i] <> " " THEN
-		ROTX x_char_rotation
-		ROTY y_char_rotation
-		ROTZ z_char_rotation
-		SCALEX char_width_factor
+		${char_transformations()}		
 		TEXT ref_z, 0, chars[i]
 		RESTORE 4
 	ENDIF
 RESTORE 2
 </%block>
 
-<%block name="create_handles">
+<%block name="place_handles">
+"place_bezier_handles":
 ! place handle for bezier point (1)
 ${xy_handle('bezier_points[1][1]', 'bezier_points[1][2]', 1)}
 
 
 ! place handle for bezier point (4)
 ${xy_handle('bezier_points[4][1]', 'bezier_points[4][2]', 4)}
+RETURN
 </%block>
 
-END
-!--------------------------------------------------------------
+<%def name="char_transformations()">
+	ROTX x_char_rotation
+	ROTY y_char_rotation
+	ROTZ z_char_rotation
+	SCALEX char_width_factor
+</%def>
+
 <%def name="xy_handle(x, y, id)" filter="trim">
 ${y_handle_at_x(y, x, id)}
 ${x_handle_at_y(x, y, id)}
 ${bas_handle(x,  0, 0, y, id)}
 ${mov_handle(x,  y, 0, y, id)}
 ${ref_handle(x, -1, 0, y, id)}
-</%def>
+</%def>

File scripts/CurvedText.Part2D.mako

 	vx = result[1]
 	vy = result[2]
 	GOSUB "vector_to_angle" 
+	! result: alpha = angle of curve tangent
 	<%block name="place_char">
-	! result: alpha = angle of curve tangent
-	IF i = 1 THEN ! store direction perpendicular to tangent of first character
-		size_handle_vx = -vy
-		size_handle_vy = vx
-	ENDIF
 	! place character at x,y with rotation alpha
 	TRANS2 x, y
 	ROT2 alpha
+	IF i = 1 GOSUB "place_text_size_handle"
 	SCALE2 char_width_factor, 1.0
 	! Allplan 2013 doesn't scale 2D Text, perhaps it works in a later version
 	TEXT2 0, 0, chars[i]
 	pos = pos + STW(chars[i])
 NEXT i
 
-<%block name="create_handles">
+GOSUB "place_bezier_handles"
+END
+!--------------------------------------------------------------
+<%block name="place_handles">
+"place_bezier_handles":
 ! place handle for bezier point (1)
 ${xy_handle2('bezier_points[1][1]', 'bezier_points[1][2]', 1)}
 
 
 ! place handle for bezier point (4)
 ${xy_handle2('bezier_points[4][1]', 'bezier_points[4][2]', 4)}
+RETURN
 
-GOSUB "place_text_size_ handle"
-
-</%block>
-
-END
-
-!--------------------------------------------------------------
-<%block name="place_text_size_handle">
-"place_text_size_ handle":
-x = bezier_points[1][1]
-y = bezier_points[1][2]
-
-! normalize direction vector
-size_handle_length = SQR(size_handle_vx^2 + size_handle_vy^2)
-vx = size_handle_vx / size_handle_length
-vy = size_handle_vy / size_handle_length
-
-dx = vx * real_text_height
-dy = vy * real_text_height
-
+"place_text_size_handle":
 ! calibrate handle
 HANDLEFACTOR text_size/real_text_height
-
 ! place character size handle
-${bas_handle2('x', 'y', 'text_size', 5)}
-${mov_handle2('x+dx', 'y+dy', 'text_size', 5)}
-${ref_handle2('x-dx', 'y-dy', 'text_size', 5)}
+${bas_handle2(0, 0, 'text_size', 5)}
+${mov_handle2(0, 'real_text_height', 'text_size', 5)}
+${ref_handle2(0, -1, 'text_size', 5)}
+HANDLEFACTOR 1
 RETURN
 </%block>
 

File scripts/RangingRebars.Part2D.mako

+! gefächerte Stäbe
+! (c) 2012, Manfred Moitzi, smartparts.tzb-moitzi.at
+! License: GPLv3, www.fsf.org
+<%namespace file="vectors2.mako" import="*" />
+<%namespace file="basic.mako" import="xy_handle2, bas_handle2, mov_handle2, ref_handle2" />
+
+!--- definitions
+spaces = rebar_count - 1
+! base line = defpoints[1] -> defpoints[2]
+DIM base_points[rebar_count][2] ! coords of: base line divided into 'spaces' points 
+! target line = defpoints[4] -> defpoints[3]
+DIM target_points[rebar_count][2] ! coords of: target line divided into 'spaces' points 
+DIM unit_vectors[rebar_count][2] ! unit vectors for lines from base line to target line
+DIM cut_line_distances[rebar_count] ! distance from base line to cut line
+DIM cut_points[rebar_count][2] ! coords of the cutting points = interscetion of rebar with cut line
+DIM rebar_start_points[rebar_count][2] ! coords
+DIM rebar_end_points[rebar_count][2] ! coords
+
+!--- calculations
+GOSUB "set_base_line"
+GOSUB "set_target_line"
+GOSUB "calc_unit_vectors"
+GOSUB "calc_cut_line_distances"
+GOSUB "calc_cut_points"
+GOSUB "calc_rebar_points"
+
+!--- graphics
+GOSUB "set_properties"
+IF PREV_MODE GOSUB "draw_preview"
+FOR counter = 1 to rebar_count
+	GOSUB "draw_rebar"
+NEXT counter
+
+!--- interactive part
+GOSUB "place_handles"
+END
+
+!--- subroutines
+"draw_preview":
+AUX_MODE 1
+LINE2 cut_points[1][1], cut_points[1][2], cut_points[rebar_count][1], cut_points[rebar_count][2]
+FOR i = 1 to rebar_count
+	LINE2 base_points[i][1], base_points[i][2],
+	target_points[i][1], target_points[i][2]
+NEXT i
+AUX_MODE 0
+RETURN
+
+"draw_rebar":
+LINE2 rebar_start_points[counter][1], rebar_start_points[counter][2],
+rebar_end_points[counter][1], rebar_end_points[counter][2]
+RETURN
+
+"set_properties":
+LAYER layer0
+COLOR rebar_color
+PEN rebar_color
+STROKE rebar_stroke
+RETURN
+
+"set_base_line": ! divide base line = defpoints[1] -> defpoints[2]
+${divide_line("base_points", 1, 2)}
+RETURN
+
+"set_target_line": ! divide target line = defpoints[4] -> defpoints[3]
+${divide_line("target_points", 4, 3)}
+RETURN
+
+"calc_unit_vectors":
+FOR i = 1 TO rebar_count
+	dx = target_points[i][1] - base_points[i][1]
+	dy = target_points[i][2] - base_points[i][2]
+	vector_length = SQR(dx^2 + dy^2)
+	unit_vectors[i][1] = dx / vector_length
+	unit_vectors[i][2] = dy / vector_length
+NEXT i
+RETURN
+
+"calc_cut_line_distances":
+! interpolate from cut_line_start_pos to cut_line_end_pos
+! cut_line_distance = distance from base line to cut line
+delta = (cut_line_end_pos - cut_line_start_pos) / spaces
+FOR i = 1 TO rebar_count
+	cut_line_distances[i] = cut_line_start_pos + delta * (i - 1)
+NEXT i
+RETURN
+
+"calc_cut_points":
+! calculate cutting points of rebar with the cut line
+FOR i = 1 TO rebar_count
+	FOR axis = 1 TO 2
+		cut_points[i][axis] = base_points[i][axis] + cut_line_distances[i] * unit_vectors[i][axis]
+	NEXT axis
+NEXT i
+RETURN
+
+"calc_rebar_points":
+! calculate start and end points of rebars
+! mid point of rebar = cutting point
+FOR i = 1 TO rebar_count
+	FOR axis = 1 TO 2
+		half_rebar = unit_vectors[i][axis] * rebar_length / 2
+		cut_point = cut_points[i][axis]
+		rebar_start_points[i][axis] = cut_point - half_rebar
+		rebar_end_points[i][axis] = cut_point + half_rebar
+	NEXT axis
+NEXT i
+RETURN
+
+"place_handles":
+! defpoint[1] handle
+${xy_handle2("defpoints[1][1]", "defpoints[1][2]", 1)}
+
+! defpoint[2] handle
+${xy_handle2("defpoints[2][1]", "defpoints[2][2]", 2)}
+
+! defpoint[3] handle
+${xy_handle2("defpoints[3][1]", "defpoints[3][2]", 3)}
+
+! defpoint[4] handle
+${xy_handle2("defpoints[4][1]", "defpoints[4][2]", 4)}
+
+! cut_line_start_pos handle
+${bas_handle2("defpoints[1][1]", "defpoints[1][2]", "cut_line_start_pos", 5)}
+${mov_handle2("cut_points[1][1]", "cut_points[1][2]", "cut_line_start_pos", 5)}
+${ref_handle2("-unit_vectors[1][1]", "-unit_vectors[1][2]", "cut_line_start_pos", 5)}
+
+! cut_line_end_pos handle
+${bas_handle2("defpoints[2][1]", "defpoints[2][2]", "cut_line_end_pos", 6)}
+${mov_handle2("cut_points[rebar_count][1]", "cut_points[rebar_count][2]", "cut_line_end_pos", 6)}
+${ref_handle2("-unit_vectors[rebar_count][1]", "-unit_vectors[rebar_count][2]", "cut_line_end_pos", 6)}
+RETURN
+
+############################################################################
+## M A C R O S
+<%def name="divide_line(result, from_, to_)">
+delta_x = (defpoints[${to_}][1] - defpoints[${from_}][1]) / spaces
+delta_y = (defpoints[${to_}][2] - defpoints[${from_}][2]) / spaces
+FOR i = 1 to rebar_count
+	${result}[i][1] = defpoints[${from_}][1] + delta_x * (i - 1)
+	${result}[i][2] = defpoints[${from_}][2] + delta_y * (i - 1)
+NEXT i
+</%def>

File scripts/RangingRebars.PartDialog.mako

Empty file added.

File scripts/RangingRebars.PartParameter.mako

+! gefächerte Stäbe
+! (c) 2012, Manfred Moitzi, smartparts.tzb-moitzi.at
+! License: GPLv3, www.fsf.org
+
+<%namespace file="vectors2.mako" import="*" />
+
+${distance('start_length', 'defpoints[1]', 'defpoints[4]')}
+${distance('end_length', 'defpoints[2]', 'defpoints[3]')}
+
+VALUES "rebar_count" RANGE [2, ) STEP 2, 1
+VALUES "cut_line_start_pos" RANGE [0, start_length]
+VALUES "cut_line_end_pos" RANGE [0, end_length]