Sunday, September 30, 2012
Our book on FreeCAD has been published
Brad and I have been working on a small book on FreeCAD for Packt Publishing, since February of this year. It has now been published and can be purchased through Packt and Amazon. It was an interesting experience writing the book. I think we initially wrote the whole thing in the span of two weeks and spent the remainder of our time until August editing it. I think we learned a lot about writing and a lot about FreeCAD itself.
Friday, June 8, 2012
Experimental Online APT360 Processor
Edit-I have disabled the server for this, since I needed it for something else. This doesn't work anymore.
I have been playing with websockets and a Linode server. A friend of mine, Brent Muller, set up APT360 on the linode server and I created a python-tornado websocket interface to it.
Paste Apt code in the top text box and press the Post Code button. If there are no errors (be careful to make sure the first line of code begins on column one and that there is a line after 'fini') you should get gcode in the bottom pane. For those of you who know what APT360 is, have fun.
Available Post Processors: a1100m, cent1, cent2, dmb, dmb2, e4axvt, e5axtr, e5axvt, emc, webgl2
Sunday, May 13, 2012
Javascript post processing
This is a test to see how javascript could work for post processing. In the left textarea, add terms like 'g0(0,0,0)' for rapid moves, 'g1(1,0,0)' for feed moves and then press the 'Post' button to get some GCode in the right textarea box. Some of you might wonder why? This is just a test for something bigger.
GCode Post Processor
g0(x,y,z) - rapid
g1(x,y,z) - feed move
g2(x,y,i,j) - clockwise arc - i,js in absolute coordinates
g3(x,y,i,j) - counter clockwise arc
feedrate = 33.0 - feedrate
JavaScript Post Processor
Saturday, May 12, 2012
Javascript blogger test
This free script provided by
JavaScript
Kit
Sunday, April 15, 2012
Cloud CADCAM via twisted python
I have been working a bit with Julian Todd of FreeSteel . We have started working on a way of serving out toolpaths, using his 'Slicer' routine from a server. The server takes triangle vertices in and returns tool location paths, for waterline type machining. Julian is very familiar with twisted python and plans on using it for his own server. At the moment, I am running his library locally.
Here is an image of a part that I designed in FreeCAD and applied this 'Slicer' scheme to:

The python code that I used for this doesn't post process into actual g-code, but it could.
import Mesh
import Part,FreeCAD
from FreeCAD import Base,Vector
import freesteelpy as kernel
s=Gui.Selection.getSelectionEx()
s1 = s[0]
m1 = s1.Object
m1.Mesh.write("/home/danfalck/mesh1.py") #write the triangle list to a file
f1 = m1.Mesh.Facets #returns out a list of facets
fssurf = kernel.FsSurf.New()
for f in f1:
fssurf.PushTriangle(f.Points[0][0],f.Points[0][1],f.Points[0][2], f.Points[1][0],f.Points[1][1],f.Points[1][2], \
f.Points[2][0],f.Points[2][1],f.Points[2][2])
def doit(fssurf, z , rad):
fssurf.Build(1.0)
fshoriztoolsurf = kernel.FsHorizontalToolSurface.New()
fshoriztoolsurf.AddSurf(fssurf)
fshoriztoolsurf.AddCylinder(rad, z, 10.0, 0) #cylinder radius, lower Z, upper Z, how the cylinder is connected to the rest of the tool -tangential etc.
fsimplicitarea = kernel.FsImplicitArea.New(0)
fsimplicitarea.AddHorizToolSurf(fshoriztoolsurf)
fsimplicitarea.SetContourConditions(0.99, -1.0, 0.002, 2, -1.0, 0.9)
fsweave = kernel.FsWeave.New()
fsweave.SetShape(-25, 25, -25, 25,.1) #(-x, -y, x , y of bounding area, last arg is granularity of path)
fsimplicitarea.GenWeaveZProfile(fsweave)
fsweave.GetNContours()
fspath2x = kernel.FsPath2X.New(0)
fspath2x.RecordContour(fsweave, False, 0, 0.0)
fspath2x.GetNpts()
[ (fspath2x.GetD(i,0), fspath2x.GetD(i,1)) for i in range(fspath2x.GetNpts()) ]
[ (fspath2x.GetD(i,0), fspath2x.GetD(i,1), fspath2x.GetD(i,2)) for i in range(fspath2x.GetNpts()) ]
pt0 = (fspath2x.GetD(0,0), fspath2x.GetD(0,1), fspath2x.GetD(0,2))
#FreeCAD.ActiveDocument.addObject("Part::Feature","rapids)\n")
c = Part.Compound([])
for i in range(fspath2x.GetNpts()-1):
line = ( Part.makeLine( (fspath2x.GetD(i,0), fspath2x.GetD(i,1), fspath2x.GetD(i,2) ) , ( fspath2x.GetD(i+1,0), fspath2x.GetD(i+1,1), fspath2x.GetD(i+1,2) ) ) )
c.add(line)
c.Placement=Base.Placement(Base.Vector(0.00,0.00,z),Base.Rotation(0.00,0.00,0.00,1.00))
Part.show(c)
rad = 1.0
startdepth = 2.5
zdepth = -3.0
stepdown = .25
steps = startdepth
while startdepth >= zdepth:
z = startdepth
doit(fssurf,z,rad)
startdepth =startdepth-stepdown
Sorry for the poor formatting of the source code- I need to figure that out soon.
Here is an image of a part that I designed in FreeCAD and applied this 'Slicer' scheme to:

The python code that I used for this doesn't post process into actual g-code, but it could.
import Mesh
import Part,FreeCAD
from FreeCAD import Base,Vector
import freesteelpy as kernel
s=Gui.Selection.getSelectionEx()
s1 = s[0]
m1 = s1.Object
m1.Mesh.write("/home/danfalck/mesh1.py") #write the triangle list to a file
f1 = m1.Mesh.Facets #returns out a list of facets
fssurf = kernel.FsSurf.New()
for f in f1:
fssurf.PushTriangle(f.Points[0][0],f.Points[0][1],f.Points[0][2], f.Points[1][0],f.Points[1][1],f.Points[1][2], \
f.Points[2][0],f.Points[2][1],f.Points[2][2])
def doit(fssurf, z , rad):
fssurf.Build(1.0)
fshoriztoolsurf = kernel.FsHorizontalToolSurface.New()
fshoriztoolsurf.AddSurf(fssurf)
fshoriztoolsurf.AddCylinder(rad, z, 10.0, 0) #cylinder radius, lower Z, upper Z, how the cylinder is connected to the rest of the tool -tangential etc.
fsimplicitarea = kernel.FsImplicitArea.New(0)
fsimplicitarea.AddHorizToolSurf(fshoriztoolsurf)
fsimplicitarea.SetContourConditions(0.99, -1.0, 0.002, 2, -1.0, 0.9)
fsweave = kernel.FsWeave.New()
fsweave.SetShape(-25, 25, -25, 25,.1) #(-x, -y, x , y of bounding area, last arg is granularity of path)
fsimplicitarea.GenWeaveZProfile(fsweave)
fsweave.GetNContours()
fspath2x = kernel.FsPath2X.New(0)
fspath2x.RecordContour(fsweave, False, 0, 0.0)
fspath2x.GetNpts()
[ (fspath2x.GetD(i,0), fspath2x.GetD(i,1)) for i in range(fspath2x.GetNpts()) ]
[ (fspath2x.GetD(i,0), fspath2x.GetD(i,1), fspath2x.GetD(i,2)) for i in range(fspath2x.GetNpts()) ]
pt0 = (fspath2x.GetD(0,0), fspath2x.GetD(0,1), fspath2x.GetD(0,2))
#FreeCAD.ActiveDocument.addObject("Part::Feature","rapids)\n")
c = Part.Compound([])
for i in range(fspath2x.GetNpts()-1):
line = ( Part.makeLine( (fspath2x.GetD(i,0), fspath2x.GetD(i,1), fspath2x.GetD(i,2) ) , ( fspath2x.GetD(i+1,0), fspath2x.GetD(i+1,1), fspath2x.GetD(i+1,2) ) ) )
c.add(line)
c.Placement=Base.Placement(Base.Vector(0.00,0.00,z),Base.Rotation(0.00,0.00,0.00,1.00))
Part.show(c)
rad = 1.0
startdepth = 2.5
zdepth = -3.0
stepdown = .25
steps = startdepth
while startdepth >= zdepth:
z = startdepth
doit(fssurf,z,rad)
startdepth =startdepth-stepdown
Sorry for the poor formatting of the source code- I need to figure that out soon.
Friday, January 13, 2012
Sunday, January 1, 2012
More Progress
Subscribe to:
Comments (Atom)

