FoamBlade Command Reference-FoamBlade 0.03
This Document contains useful commands for the FoamBlade interactive session. Only QuadColumns (Quads) and DoubleColumns (Doubles) are covered.
Note that PathContainer commands fit for Quads as well as for Doubles. That means that you can call for example X.writeToFile('filename') where X can be a Quad or a Double.
class PathContainer
contains Standard methods for it's subclasses
Containter Constructor
This means for you: Quad(arg) or Double(arg) create a new container by reading for example from a filename, a list or another PathContainer.
Eats filenames, ContentLists,other PathContainers, 'edit' and 'empty'
appendItem(item)
appendPath(path)
calls an external editor (gedit) if no other argument is given
Uses an external editor to edit thefile represetatation of the path.
If you want you can give the editor to use as argument, maybe 'kwrite'.
getContentList( )
Return the underlying content List of the container
getFilename( )
prints and returns the Filename the Path was read from
getItem(num=0)
getListSize( )
isave( )
uses the filename that was given tothe interactive session, to save it back
printContent( )
print information and the contentList
readFromFile(filename)
reverse( )
reverse the complete Path
save( )
uses the filename the path was readfrom, to save it back
writeToFile(filename)
Double =classDoubleColumn(PathContainer)
A List with two values -> twocolumns
Fits to most standard foils.
Alias name is Double
clean( )
clean up
remove two following lines that are
the same
composeQuad(double, points=1000)
tries to compose Quad from two
different shaped Doubles
call q=d1.composeQuad(d2)
Does a spline Interpolation to create two doubles with
the same point amount and merges them together to a quad.
The quad is returned.
A known problem is that both sides don't synchronize well,
when the Doubles differ much in their spape. The Doubles are
equalized over their length and then put together. A possible
Trick is: scale one Double in one direction, merge the quad
and scale the direction of the side you scaled before back to
the correct size.
convertToQuad( )
returns a QuadColumn
The Quad has the Double on both sides.
convertToQuadColumn =convertToQuad( )
getLength( )
returns Length of the path in mm
mergeToQuad(double)
merges two doubles with the same
length and returns a QuadColumn
call q=d1.composeQuad(d2)
plView( )
call the pyton lab viewer
scale(xs, ys)
Scale the Double with xs and ys in x
and y direction.
splineInt(amount=1000, smooth=0,degree=3)
returns a new approximated double
the point density is equalized
view( )
uses the built in viewer to open the quad
Quad = classQuadColumn(PathContainer)
A List with four values -> four
columns
Represents a synchronized cut Path.
Alias name is Quad
ViView(arg=None)
Python Visual Viewer
be warned due to an unkown problem
ViView exits the comlete session after closing.
addOffset(x, y, u, v)
Shift: Add an constant offset
adjustToWidth(block_width,machine_width)
use a machine that has more width than the block you want to cut test it (theoreticaly it works:)
Unimplemented: Speed adjustion: the cut speed at the block ends will be slower than the choosen speed.
clean( )
clean up
remove two following lines that are
the same
convertToDoubles( )
returns two doubles
call: d1,d2=q.convertToDoubles()
convertToStepList(mach)
returns an interpolated StepList in
machine resolution
displace(dxy, duv)
displace path : Burn away correction
returns the new quad
test version!!!
Better Algorithm needed.
-makes problems at small diameters
that should be shifted to inside
-begins to displace in the direction
that is at the top if a positive displacement is choosed
getDimension( )
returns the object sizes in mm
getLength( )
return Length of both pathes
interpolateLinear( )
test it/fix it
do not use directly
mirrorUnits( )
mirror units
flip xy and uv
mirror_xu(x, u)
mirror vertical at x and u
mirror_xu(0,0) : mirror vertically at
zero
mirror_yv(y, v)
mirror horizontal planes at y and v
mirror_yv(0,0) : mirror horizontally
at zero
plView( )
use pyton lab viewer to open the quad
repeatQuad(n, x, y, u, v)
repeats the quad n times by adding the
offset xyuv every time
the new quad is returned
rotate(xorgin, yorgin, uorgin,vorgin, xyangle, uvangle)
rotate around the given orgins
scale(xs, ys, us, vs)
Scale the Double with in x,y,u and v
direction.
setOffset(x, y, u, v)
shifts the begin of the quad to offset
setZeroOffset(side=None)
shifts the begin of the quad to zero,
it can also shift only one side
Parameters:
side= [ none | 'xy' | 'uv'| 'xyuv' ]
splineInt(amount=1000, smooth=0,degree=3)
returns a new interpolated Quad with
equalized
point density using "amount=..."
points
to use it a linear interpolation provide
degree=1 as parameter
split( )
split into returned quads
not implemented
view( )
uses the built in viewer to open the
quad
Other Functions
You don't need a path Container to call this funcions, although these might return a Path Container
notches(width, depth, num)
creates num notches that are width away from each other and
with depth of depth.
returns Path as Quad
(random) Examples
There are also other Examples in the UsageHowto.
This example session cancels 5% from the rear part of a foil and scales it back to the original size. Then it is scaled and pepared for cutting.
********************************************
* starting interactive Foamblade session *
********************************************
# 95% Trick
>>> e=Quad('../Extra/foils/s8035mod10.quad')
read data file with 160 enteries
>>> ee=e.splineApprox() ##ee has now 1000 enteries
>>> s=Quad ( ee.getContentList()[25:975] ) #this is python Magic to throw the first and last 25 lines away.
>>> s.getDimension()
object size: 94.9384400465, 9.99987507397, 94.9384400465, 9.99987507397
overall both sides: 94.9384400465, 9.99987507397
>>> a=100/94.9384400465
>>> s.scale(a,a,a,a)
>>> s.getDimension()
object size: 100.0, 10.5330096735, 100.0, 10.5330096735
overall both sides: 100.0, 10.5330096735
>>> s.mirror_xu(50,50)
>>> s.scale(2.1,2.1,1.05,1.05)
>>> s.getDimension()
object size: 210.0, 22.1193203143, 105.0, 11.0596601572
overall both sides: 209.994736025, 22.1193203143
>>> s.addOffset(0,0,80,0)
>>> s.view()
>>> s.getDimension()
object size: 210.0, 22.1193203143, 265.0, 11.0596601572
overall both sides: 210.0, 22.1193203143
>>> t=s.displace(-1,-1)
>>> t.getDimension()
object size: 211.062809752, 24.119319957, 265.916130295, 13.0596597999
overall both sides: 211.062809752, 24.119319957
>>> t.writeToFile('../Extra/foils/s8035mod10-0.95-extra-pre.quad')
>>> w=Quad('../Extra/foils/s8035mod10-0.95-extra-wing.quad')
>>> w.view()