I found the idea quite intriguing, and thought about integrating the surface 
correction idea better. After bouncing a few ideas with Andy, this is what I 
have so far:

probekins: a kinematics module which be default behaves like trivkins
it accepts a mesh of triangles which define Z correction values (actually an 
approximation of the workpiece surface, or machine surface for that matter)

this mesh might eventually generated by probing, but also used as a general 
machine Z correction 


this isnt finished or polished, but I'm posting it anyway to see what folks 
think about it.

see http://git.mah.priv.at/gitweb/emc2-dev.git/shortlog/refs/heads/probekins

- Michael

--------



v0.1 README:

Z correction by triangular mesh
-------------------------------

The probekins kins module is a trivial kinematics module unless loaded with a Z 
correction mesh.

It helps dealing with warped workpiece surfaces (or machines), and was inspired 
by a recent thread on emc-users about PCB milling.

the correction mesh is a set of triangles specified by an STL file. This file 
might eventually be generated by probing a few points, 
and creating a triangular mesh from it, for instance by a Delauney 
triangulation,

If a point (x,y) lies within the one of the triangles, it's z value is adjusted 
by the interpolated value on the enclosing triangle.
Points outside any triangle are not corrected for. This means the correction 
value currently 'falls off the cliff' at the convex hull of the 
triangles (the enclosing polygon if you will).

The triangles are applied in the order specified in the file, so there could be 
a 'later' larger triangle enclosing or overlapping
an earlier one.

The algorithm currently is based on a brute-force test of all triangles until 
first match. 
The ray/triangle intersection test is very fast, nevertheless this is an 
O(number of triangles) implementation.
There are numerous ways to optimize this which are left as an exercise for the 
reader;).

To load an STL Z correction file:
---------------------------------
python stlcorr.py <file,stl>

To inspect the current correction:
----------------------------------
python stlcorr.py

To clear the correction:
------------------------
python stlcorr.py -c




Example STL file containing two triangles:
--------------------
solid
facet normal 0 1 1 
  outer loop
    vertex 0 0 0 
    vertex 0 5 0
    vertex 5 0 2
  endloop
endfacet
facet normal 2 3 4
  outer loop
    vertex 1 1 1 
    vertex -1 -1 1
    vertex 1 -1 2
  endloop
endfacet
endsolid
-----------------
The normal vectors are ignored and can be left out for the purpose of 
describing a correction mesh.




------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to