| Descrizione |
|---|
| Crea un solido estrudendo un profilo lungo un percorso. Versione macro: 1.0 Ultima modifica: 2011-12-03 Versione FreeCAD: Tutte versione Download: ToolBar Icon Autore: Normandc |
| Autore |
| Normandc |
| Download |
| ToolBar Icon |
| Link |
| Raccolta di macro Come installare le macro Personalizzare la toolbar |
| Versione macro |
| 1.0 |
| Data ultima modifica |
| 2011-12-03 |
| Versioni di FreeCAD |
| Tutte versione |
| Scorciatoia |
| Nessuna |
| Vedere anche |
| Nessuno |
Questa macro crea un solido estrudendo un profilo 2D lungo una traiettoria precedentemente selezionata nella vista 3D.
Gli elementi 2D possono essere creati attraverso i normali strumenti della GUI di FreeCAD.
Notare che il solido risultante non è parametrico. Se si decide di modificare il profilo o il percorso, si deve nuovamente eseguire la macro.
Nella seguente figura tutte le estrusioni sono realizzate utilizzando la stessa sagoma, ma tre percorsi diversi.
Risultato: Un oggetto Sweep viene creato nella struttura del progetto
Macro_Solid_Sweep.FCMacro
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 = True #1
isFrenet = True #1
# create a 3D shape and assigh it to the current document
Sweep = Part.Wire(traj).makePipeShell([section],makeSolid,isFrenet)
myObject.Shape = Sweep
Grazie a Wmayer per il suo aiuto nella stesura di questo script.
In questa sezione del forum si trovano due esempi di utlizzo e si trovano anche i collegamenti per scaricare i file FCStd. Utilizzando una elica come traiettoria, tramite uno sweep solido si può creare la filettatura di un bullone.