RobotExampleTrajectoryOutOfShapes.py

Go to the documentation of this file.
00001 # Examples to generate trajectories out of shapes
00002 
00003 # geting selected edges from the selection and sort them
00004 count = 0
00005 FirstPos1 = None
00006 FirstPos2 = None
00007 LastPos2  = None
00008 SortedEdgeList = []
00009 for so in Gui.Selection.getSelectionEx():
00010         for edge in obj.SubObjects:
00011                 if edge.Type != 'Part::TopoShape':continue 
00012                 pos1 = edge.valueAt(0)
00013                 pos2 = edge.valueAt(edge.Length)
00014                 print pos1,pos2
00015                 if count==0: # first edge
00016                         FirstPos1 = pos1
00017                         FirstPos2 = pos2
00018                 elif count==1 : # second edge
00019                         continue
00020                 else: # the rest
00021                         SortedEdgeList.append( (pos1,pos2,edge) )

Generated on Wed Nov 23 19:00:36 2011 for FreeCAD by  doxygen 1.6.1