NEWS
emc2_2.4.1 Release
A fresh bugfix release (Changelog). You can get it: as a source package from sourceforge , from Git , or as a precompiled package which works on Ubuntu as described here .
 
Ubuntu 8.04&EMC2 Live CD
The EMC2 team has a custom Live-CD (EU mirror) based on Ubuntu 8.04 with emc 2.3.x included, that will let you try out EMC2 before installing, and it's also the easiest way to install Ubuntu and EMC2 together. (more)
 
emc2_2.4.0 Release

A new major release. You can get it: as a source package from sourceforge, from Git , or as a precompiled package which works on Ubuntu as described here. (more)

 
Site Search
Google
Web LinuxCNC
Login
Home arrow Forum

EMC Support Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Filters
(1 viewing) 1 Guest
Go to bottom
TOPIC: Filters
#2307
BigJohnT (Admin)
Moderator
Posts: 689
User Online Now Click here to see the profile of this user
Re:Filters 4 Months, 2 Weeks ago Karma: 23  
I saw it this morning on the Developers e mail list so it was there.

John
 
Logged Logged  
  The administrator has disabled public write access.
#2324
eslavko (User)
Senior Boarder
Posts: 51
User Offline Click here to see the profile of this user
Re:Filters 4 Months, 2 Weeks ago Karma: 0  
When I today rebuild emc the filter menu apear. Nice. But it's empty. Where actual filter program's is? A lot of time I need rotate filter..

How to use that new feature... Some sample filter?
 
Logged Logged  
  The administrator has disabled public write access.
#2326
bkubicek (User)
Fresh Boarder
Posts: 14
User Offline Click here to see the profile of this user
Re:Filters 4 Months, 2 Weeks ago Karma: 0  
i have some c++ programmed filters on a machine i cannot access right now.

however, some (improvised and untested) examples are quite simple:
Code:


removeNs.sh:
#!/bin/bash
cat $1|sed 's/N[0-9]* //g'

A very simple mirrored rotate actually just exchanges X and Y coordinates. 
exchangeXY.sh 
#!/bin/bash
cat $1 |sed 's/X/§/g' |sed 's/Y/X/g' |sed 's/§/Y/g'

rotateCCW.sh:
#!/bin/bash
cat $1 |sed 's/X/§/g' |sed 's/Y\([ ]*\)\([-0-9\.]*\)/X[-1*[\2]]/g' |sed 's/§/Y/g

flipX.sh:
#!/bin/bash
cat $1 |sed 's/X\([ ]*\)\([-0-9\.]*\)/X[-1*[\2]]/g'

flipY.sh:
#!/bin/bash
cat $1 |sed 's/Y\([ ]*\)\([-0-9\.]*\)/Y[-1*[\2]]/g'


ok this last is a bit more complex
Code:


parameterizeZ.sh:
#!/bin/bash
###edit this list to your usual z values
###ZLIST="2.0 -5.0 0.1"
ZLIST="2.0 -5.0 0.1"
#####

ori=`cat $1|tr '\n' '§'`
number=500
cur="$ori"

count=0
for i in $ZLIST;
do
 echo "#$[$number+$count] = $i; Z originally $i "
 count=$[$count+1]
done
count=0
for i in $ZLIST;
do
 t=`echo $i |sed 's/\./\\\./g' |sed 's/\-/\\\-/g'`
 
 sedstring="s/Z[ ]*$t/Z #$[$number+$count]/g"
 #echo "TT=$t  sed: $sedstring"
 new=`echo $cur |sed -e "$sedstring"`
 cur=$new
 count=$[$count+1]
done
echo   $cur |tr '§' '\n'



Please remember, this were done created in the last 4 minutes, and have not been tested with e.g. circle moves

trivial: of course they should be executeable: chmod +x whatever.sh

---
at the remote machine I have a "centergcode" which takes the algebraic average of all (X,Y) vectors and shift the position X0Y0 to this average.
maybe i will try to improve my python by doing some filters with them.
And one that replaces relative moves by absolute ones.
 
Logged Logged  
 
Last Edit: 2010/03/16 14:27 By bkubicek.
  The administrator has disabled public write access.
#2336
eslavko (User)
Senior Boarder
Posts: 51
User Offline Click here to see the profile of this user
Re:Filters 4 Months, 2 Weeks ago Karma: 0  
Can't get that to work.
Maybe I just miss something..
Code:


I'm added in my ini file 
section [EMC]
FILTER_DIRECTORY = /home/slavko/emc2/filters

section [FILTERS]
PROGRAM=ExchangeXY


And have script "ExchangeXY.sh" in filters folders and inside is
#!/bin/bash
cat $1 |sed 's/X/§/g' |sed 's/Y/X/g' |sed 's/§/Y/g'



and permision is set to be executable.
The filter option in axis menu appear with submenu ExchangeXY but if I click them nothing happend.
Slavko.
 
Logged Logged  
 
Last Edit: 2010/03/17 05:52 By eslavko.
  The administrator has disabled public write access.
#2337
bkubicek (User)
Fresh Boarder
Posts: 14
User Offline Click here to see the profile of this user
Re:Filters 4 Months, 2 Weeks ago Karma: 0  
Maybe you just need to replace
PROGRAM=ExchangeXY
by
PROGRAM=ExchangeXY.sh
 
Logged Logged  
  The administrator has disabled public write access.
#2338
eslavko (User)
Senior Boarder
Posts: 51
User Offline Click here to see the profile of this user
Re:Filters 4 Months, 2 Weeks ago Karma: 0  
bkubicek wrote:
Maybe you just need to replace
PROGRAM=ExchangeXY
by
PROGRAM=ExchangeXY.sh


Nope...

.. and I has put two files (one without .sh) on dir.
 
Logged Logged  
  The administrator has disabled public write access.
Go to top
© 2010 LinuxCNC.org
Joomla! is Free Software released under the GNU/GPL License.