User Tools

Site Tools


animation:pather

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

animation:pather [2015/12/04 18:46] (current)
freek angelegt
Line 1: Line 1:
 +====== Pather ======
 +
 +Properties
 +|src|a ​ Draft.BSpline Object|
 +|Placement |Position at time|
 +
 +{{youtube>​large:​6VU0eQOHPo0}}
 +
 +<​code>​
 +# pather testcase
 +
 +import Animation,​Draft
 +import Pather
 +import Placer
 +
 +box=App.ActiveDocument.addObject("​Part::​Box","​Box"​)
 +
 +points=[FreeCAD.Vector(22.0,​6.0,​0.0),​
 + FreeCAD.Vector(8.,​60.5,​0.0),​
 + FreeCAD.Vector(-20,​-27.3,​0.0),​
 + FreeCAD.Vector(16.32,​-41.3,​0.0)]
 +
 +bspline=Draft.makeBSpline(points)
 +
 +pa=Pather.createPather('​BSpline as Path')
 +pa.src=bspline
 +
 +pl=Placer.createPlacer('​Placer for Box',​box)
 +pl.x='​sx-5'​
 +pl.y='​sy-5'​
 +pl.arc='​0'​
 +pl.src=pa
 +
 +
 +m=Animation.createManager()
 +m.addObject(p)
 +m.addObject(pl)
 +
 +def run(a):
 + a.Proxy.run()
 +
 +run(m)
 +
 +</​code>​
 +
 +Der Quader bewegt sich entlang des Pfades.
  
animation/pather.txt ยท Last modified: 2015/12/04 18:46 by freek