Pages

Saturday, November 19, 2011

Engine: 8 - liner blueprint (FreeCAD+LibreCAD)

(In this tutorial I'm using alternative DXF-export algoritm.)
Start Freecad and open liner model created in older tutorial.



Select the last feature (Pocket) and write in Python console:

import Part,Drawing,FreeCADGui,FreeCAD
from FreeCAD import Base
filename = "/home/adi/Pulpit/xy.dxf"
FILE = open(filename,"w")
sel = FreeCADGui.Selection.getSelection()
sel = sel[0]
shape = sel.Shape
dxf_output = Drawing.projectToDXF(shape,Base.Vector(0,0,1))
FILE.write(dxf_output)
FILE.close()


You should change filename = "/home/adi/Pulpit/xy.dxf" to your path and filename. A view will be exported to 2D DXF. Open it in LibreCAD.

In the same way export other views:


import Part,Drawing,FreeCADGui,FreeCAD
from FreeCAD import Base
filename = "/home/adi/Pulpit/yz.dxf"
FILE = open(filename,"w")
sel = FreeCADGui.Selection.getSelection()
sel = sel[0]
shape = sel.Shape
dxf_output = Drawing.projectToDXF(shape,Base.Vector(1,0,0))
FILE.write(dxf_output)
FILE.close()


import Part,Drawing,FreeCADGui,FreeCAD
from FreeCAD import Base
filename = "/home/adi/Pulpit/xz.dxf"
FILE = open(filename,"w")
sel = FreeCADGui.Selection.getSelection()
sel = sel[0]
shape = sel.Shape
dxf_output = Drawing.projectToDXF(shape,Base.Vector(0,1,0))
FILE.write(dxf_output)
FILE.close()


As you can see, direction can be specified by Base.Vector().


Now you have 3 DXF with 3 views. Select all in xy.dxf and use Edit-Copy. In the left side of the LibreCAD window you can see column menu with acive actions. Geometry is selected, so click Continue action and Snap to grid. Then select base point for a copy.
Important:
  • to back to previous active action right click somewhere,
  • in the statusbar you can see tips for active actions.
Open xz.dxf and use Edit-Paste to paste your geometry. You can flip it by mirror tool: select geometry, choose from left column: Edit-Mirror-Continue action-Snap to grid and draw horizontal mirror line. After operation return to first column menu by right-clicking. 



Now is time to adjust some layers, lines colors and widths. You can do this in Layer list (right column). Create 3 layers:

  • contour - simply rename sheet_layer layer,
  • axis
  • dimensions
Add axes. Select axis layer and from column menu: Show menu "Lines"-Line with two points-Snap to grid or Snap to middle points.


Add dimensions. Select dimensions layer and from column menu: Show menu "Dimensions". Then:

  • for linear dimensions select Horizontal Dimension or Vertical Dimension, select Snap to intersections automatically and pick two points. To set dimension line position you have to select Snap to grid or Free positioning,
  • for angles select Angular Dimension and pick two lines,
  • for diameters select Diametric Dimension and pick circle.
To add φ select Edit-Edit Text from column menu and pick a dimension.



Save the drawing with a new name. You can print it - use File-Print Preview and adjust scale and style (Toggle Black / White mode) using toolbar above preview window.

Download DXF.
Download PDF.

Download RAW Video.


FreeCAD 0.12 5150 SVN

1 comment:

  1. Thank you really much from these great blogs. I've been searching open source 3D modelling program and you pointed me out how great freeCad is. Great work!!

    ReplyDelete