avión - plane

avión - plane

FREECAD

Estoy usando FREECAD para dibujar un avión.
Colaboraciones aceptadas.

Using FREECAD to draw a plane.
Colaborations welcomed.

macro fuselaje 1

freecadPosted by Je 23 Dec, 2015 21:58:48
# Macro para construir el fuselaje del avion +++++++++++++++++++
import FreeCAD, FreeCADGui, Part, Draft
# PySide is not loaded with Python by default, it must be requested prior to using it.
from PySide import QtGui, QtCore
#to work on the FreeCAD interface, create a reference to the FreeCAD
main window: app = QtGui.qApp mw = FreeCADGui.getMainWindow()

#clean the console--------------------------------------
c=mw.findChild(QtGui.QPlainTextEdit, "Python console") c.clear()
r=mw.findChild(QtGui.QTextEdit, "Report view") r.clear()

#display the axes----------------------------------
Gui.ActiveDocument.ActiveView.setAxisCross(True)

# dibuja los ejes------------------------------------------
#Draft.makeWire([FreeCAD.Vector(1000.0,0.0,0.0),FreeCAD.Vector(-1000.0,0.0,0.0)])
#App.ActiveDocument.ActiveObject.Label = "eje-x"
#FreeCADGui.ActiveDocument.ActiveObject.LineColor = (1.0,0.00,0.00)

#Draft.makeWire([FreeCAD.Vector(0.0,1000.0,0.0),FreeCAD.Vector(0.0,-1000.0,0.0)])
#App.ActiveDocument.ActiveObject.Label = "eje-y"
#FreeCADGui.ActiveDocument.ActiveObject.LineColor = (0.0,1.00,0.00)

#Draft.makeWire([FreeCAD.Vector(0.0,0.0,1000.0),FreeCAD.Vector(0.0,0.0,-1000.0)])
#App.ActiveDocument.ActiveObject.Label = "eje-z"
#FreeCADGui.ActiveDocument.ActiveObject.LineColor = (0.0,0.00,1.00)

pl = FreeCAD.Placement()
pl.Rotation.Q=(0,1,0.0,1)

r = 420

for i in range(16):
# parte inferior de la carlinga ------------------------
pl.Base = FreeCAD.Vector(100*i,0.0,390.0)
Draft.makeCircle(r,placement=pl,face=False,support=None)
FreeCADGui.ActiveDocument.ActiveObject.LineColor = (1.0,0.5,0.5)
# parte superior de la carlinga ------------------------
pl.Base = FreeCAD.Vector(100*i,0.0,610.0+33*i-2.2*i**2)
Draft.makeCircle(r,placement=pl,face=False,support=None)
FreeCADGui.ActiveDocument.ActiveObject.LineColor = (0.5,0.5,1.0)

for i in range(16,27):
# parte inferior de la carlinga ------------------------
pl.Base = FreeCAD.Vector(100*i,0.0,390.0)
Draft.makeCircle(420+(i-15)-3.5*(i-15)**2,placement=pl,face=False,support=None)
FreeCADGui.ActiveDocument.ActiveObject.LineColor = (1.0,0.5,0.5)
# parte superior de la carlinga ------------------------
pl.Base = FreeCAD.Vector(100*i,0.0,610.0+33*i-2.2*i**2-(i-15)+3.5*(i-15)**2)
Draft.makeCircle(420+(i-15)-3.5*(i-15)**2,placement=pl,face=False,support=None)
FreeCADGui.ActiveDocument.ActiveObject.LineColor = (0.5,0.5,1.0)

# recomputa los graficos-------------------------
App.ActiveDocument.recompute()
Gui.SendMsgToActiveView("ViewFit")
Gui.activeDocument().activeView().viewAxometric()