Wednesday, September 30, 2009

OCC offset

After "geo" from #cam mentioned using Open CASCADE's Test Harness and gave me an example, I produced these offsets, which look promising for pocketing with a permissive license. It seemed to produce the offsets very fast.

6 comments:

Dan Heeks said...

This was the Test Harness script

clear
pload ALL
vertex v1 0 0 0
vertex v2 10 0 0
vertex v3 7 10 0
vertex v4 10 20 0
vertex v5 0 20 0
vertex v6 3 10 0
edge e1 v1 v2
edge e2 v2 v3
edge e3 v3 v4
edge e4 v4 v5
edge e5 v5 v6
edge e6 v6 v1
vertex v7 2 2 0
vertex v8 8 2 0
vertex v9 7 3 0
vertex v10 3 3 0
edge e7 v7 v8
edge e8 v8 v9
edge e9 v9 v10
edge e10 v10 v7
wire w1 e1 e2 e3 e4 e5 e6
mkplane f w1
wire w2 e7 e8 e9 e10
mkplane f2 w2
cut f3 f f2
top
mkoffset offset f3 50 0.12
fit

andyw said...

Hi Dan,
I wrote some drop-cutter code in matlab and then C# a while ago. This is for surface-finishing of STL surfaces. I also have some ideas on waterline paths.
Would you be interested in making them work in HeeksCAD/CNC if I converted them to C++ (with BOOST-libraries) and released under GPL licence?

Anders

Dan Heeks said...

Anders,
Yes. Maybe you could put it in a Google Code project.
I will probably make a python module of it, for using in HeeksCNC, or maybe an executable that reads a STL file and writes a text file.

I converted your DropCutter.cs to DropCutter.cpp, myself, in May 2009.
http://code.google.com/p/heekscnc/source/browse/trunk/src/DropCutter.cpp
However, apparently, "edge-test for the toroidal cutter is wrong, or at least only an approximation to the exact geometry".
This file is still in HeeksCNC, because I was hoping to use it again, but it would be better if it was in a separate project belonging to you.

Dan.

geo01005 said...

Dan, are these results better than the original results with OCC? I know that you had previously been unimpressed by the OCC offset tools. Also, I don't think that these particular tools (by themselves) are useful for profiling operations. There is another set of offsetting tools for curves, but I think that you have to offset one curve at a time and check and correct for intersections.

Dan Heeks said...

geo,
It is not good for profile operations, which need to be able to cut open shapes, but these results look great for pocket operation. It will not be necessary to check for intersections for pocketing. The shapes will always be closed shapes.
I should make an Open CASCADE version of libarea ( http://code.google.com/p/libarea/ ), if I get the time, to test it with HeeksCNC. Maybe I could just use PythonOCC.

Dan Heeks said...

geo, I am not sure what my original results were. It may be that when I offset a face too far, it crashed, because my error handling was incorrect.