Create a new closed sketch on the XY plane. You will use it as poly-v belt section. I've fixed corner point to (0,0) but in real application x=0 should be somewhere around half of the v-groove height. Close the sketch (Sketch).
Next create a trajectory. You have to draw it on the YZ plane. Trajecory for the v-belt should be closed but for other purposes it can be open. Set vertical line to x=0 and close the sketch (Sketch001).
Sketches should be perpendicular to each other (picture above). Now you need a python script. I've borrowed one from this forum topic.
import Part, FreeCAD, math, PartGui, FreeCADGui
from FreeCAD import Base
# get the selected objects, with first selection for the trajectory and second for the section
s = FreeCADGui.Selection.getSelection()
try:
shape1=s[0].Shape
shape2=s[1].Shape
except:
print "Wrong selection"
traj = Part.Wire([shape1])
section = Part.Wire([shape2])
# create Part objec in the current document
myObject=App.ActiveDocument.addObject("Part::Feature","Sweep")
# variable makeSolid = 1 to create solid, 0 to create surfaces
makeSolid = 1
isFrenet = 1
# create a 3D shape and assigh it to the current document
Sweep = Part.Wire(traj).makePipeShell([section],makeSolid,isFrenet)
myObject.Shape = Sweep
Save it as a macro (post about macros). Select the trajectory sketch (Sketch001) and then with [Ctrl] the section sketch (Sketch). After that execute the macro.
In the picture above you can see the effect. The sweep isn't parametric (a sketch change doesn't affect to the sweep) but script can be easily modified:)
Download file.
Download RAW Video.
FreeCAD 0.12 5211 SVN
No comments:
Post a Comment