Author Topic: Curved surface script  (Read 54596 times)

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8360
    • View Profile
Re: Curved surface script
« Reply #15 on: June 22, 2014, 00:28:37 am »
Thanks, Geoff!

These are good additions, and can be converted into a nice multi-pocket plugin with only a little work.

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline GeoffreyGRoy

  • Storm Trooper
  • ***
  • Posts: 201
    • View Profile
Re: Curved surface script
« Reply #16 on: June 22, 2014, 01:42:03 am »
Perhaps that is my next challenge, to learn how to write plugins!

Geoff

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8360
    • View Profile
Re: Curved surface script
« Reply #17 on: June 22, 2014, 01:56:15 am »
There have been numerous examples provided (in this sub-forum).

If you don't already have it, I suggest Visual Studio 10.0 as the platform.  It will allow VB and C# projects, and if not exactly 'natural' to an old command-line programmer like me, it works well.

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline GeoffreyGRoy

  • Storm Trooper
  • ***
  • Posts: 201
    • View Profile
Re: Curved surface plugin
« Reply #18 on: July 03, 2014, 08:03:08 am »
Here is my first  ::)  attempt at a plugin for curved surfaces, based on the previously written scripts.  I would appreciate some volunteers to test it out and find the bugs.

I am using CamBam 0.9.8N (which I think is the latest version) for development together with VS 2010.  I am getting some warnings in VS about "architecture mismatches" that do not seem to cause me any problems, but I am not sure what their significance will be for others.

The zip file contains the DLL and a short User Guide.

I would appreciate feedback.  No guarantees, of course.

Geoff

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8360
    • View Profile
Re: Curved surface script
« Reply #19 on: July 03, 2014, 10:36:23 am »
Geoff,
I FIGURED that those banging noises in the closet were you hammering out a plugin!

I'll check it out, ASAP!  Good deal!

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8360
    • View Profile
Re: Curved surface script
« Reply #20 on: July 03, 2014, 11:43:59 am »
Ok... I have a feeling that 'units' might not be always 'current units'.

When working in inches, I find that the position and size of the feature have no immediately apparent relationship to the position and size of the seed line.  In this example, I made the extents of the feature the SAME as the seed line, but as you can see, it did not end up there.

Also, the algorithm blows up on a curved pocket using a flat end mill, creating the jagged line shown.  Since an endmill is inappropriate for a concave curve, anyway, you should disallow it in that circumstance or the hollowed spherical pocket.

More as I have time.

LLoyd
« Last Edit: July 03, 2014, 11:46:14 am by lloydsp »
"Pyro for Fun and Profit for More Than Fifty Years"

Offline BR52

  • Wookie
  • ****
  • Posts: 336
    • View Profile
Re: Curved surface script
« Reply #21 on: July 03, 2014, 13:45:28 pm »
Hello Geoff,

Good work, of the script to plugin you was quick.
A tip when you create a plugin put the name
and the plugin version, example CurvedSurfacePlugin100.zip.
For source code put CurvedSurfacePlugin100-source.zip.
You said:
I am getting some warnings in VS about "architecture mismatches" that do not seem
to cause me any problems, but I am not sure what their significance will be for others.

You could put the source code to analyze the problem?

   Armando
« Last Edit: July 03, 2014, 19:43:32 pm by BR52 »

Offline Garyhlucas

  • CNC Jedi
  • *****
  • Posts: 1380
    • View Profile
Re: Curved surface script
« Reply #22 on: July 04, 2014, 02:20:57 am »
On the subject of doing curved surfaces I have been doing a lot of curved surfaces lately by projecting a polyline like the one in this file on to a curved surface then using engrave with a ball mill.  The most tedious part is drawing this poly line.  It was done in Autocad by drawing an inner and outer arc, then using an array to generate parallel lines and trimming them to the arcs. 

It just hit me that Hatch in CB does it much faster! 

However joining all the lines with short lines to form a complete zigzag path is tedious. If you don't join them into one continuous path CB will insert a lift to safe height then rapid over and feed back down.  I need the tool to stay on the path the whole time.

Wait till you see the size of the part I am doing with my Minimill.  I hope to run the parts tomorrow and I'll post some videos.
Gary H. Lucas

Have you read my blog?
 http://a-little-business.blogspot.com/

Offline GeoffreyGRoy

  • Storm Trooper
  • ***
  • Posts: 201
    • View Profile
Re: Curved surface script
« Reply #23 on: July 04, 2014, 03:30:38 am »
Dear Lloyd and Armando

I have fixed the problems with the END mill.  I appreciate that using and END mill for this type of work is not ideal, or perhaps even appropriate, but none-the-less I think I have fixed the bug.

With regards to units (inches vs mm) I have not been able to reproduce any of the problems you mentioned, could you explain a little further.  

What I have found, however is that my default parameters are set as mm units and if these were not changed to sensible inch units then strange things can happen.  The new version (1.01) includes the facility to automatically change the default (and current) values depending on the units selected.  While the default is still mm, if you have the CamBam units set to inches, these will be converted to  inch units when the plugin is (re)launched.  This will update the parameters - but not the geometry, of course.    There will be always some small round-off error in this conversion that will need to be adjusted/cleaned to suit.

I will publish the source code once we get most of the obvious/critical bugs sorted.


Geoff

(I have removed the attachment, see later post)

« Last Edit: July 04, 2014, 06:31:43 am by GeoffreyGRoy »

Offline GeoffreyGRoy

  • Storm Trooper
  • ***
  • Posts: 201
    • View Profile
Re: Curved surface script
« Reply #24 on: July 04, 2014, 06:30:33 am »
I have just noticed a couple of more bugs: now for V1.02:
  • removes a debug dialog
  • correctly creates a curved pocket along the actual length of the designated geometry seed.  Previously it was twice the length of the polyline.

Geoff

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8360
    • View Profile
Re: Curved surface script
« Reply #25 on: July 04, 2014, 11:06:38 am »
Geoff, that's quick!

There is still a problem with the 'jaggies', even with a ball-end mill.  I generated one with a depth equal to the radius, knowing that was a singular condition.  I got three results that don't look right.

1) jaggies, still
2) an odd full-circle path at the beginning
3) all paths beginning far below the stock surface, guaranteeing 'rapid collision errors' when doing this in metal with a slow speed spindle.

I then generated one with depth equal to 1/2 radius.   The jaggies went away.  The circular path went away.  The paths below stock surface continued, and show a result that says that it's a sweep problem, with the sweep being only about three radians, but varying some.

The scaling bug seems solved, thanks.
LLoyd
« Last Edit: July 04, 2014, 11:09:32 am by lloydsp »
"Pyro for Fun and Profit for More Than Fifty Years"

Offline BR52

  • Wookie
  • ****
  • Posts: 336
    • View Profile
Re: Curved surface script
« Reply #26 on: July 05, 2014, 20:14:04 pm »
Geoff,

The name of the DDL, you keep CurvedSurfacePlugin.dll
In the ZIP file, you put the version CurvedSurfacePlugin-1.02.zip

In Visual Studio you go in menu -> Project -> _______ Propeties...
Click on the button "Assembly Information..." and change the version of the your project.
See the image below.

Please put your source code here.
Has two experts in Visual here.

   Armando

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6211
    • View Profile
    • Cambam V1.0 French Doc
Re: Curved surface script
« Reply #27 on: July 05, 2014, 21:21:18 pm »
Hello,

Very good and useful job that you do there ! .. congratulations !

++
David

Offline GeoffreyGRoy

  • Storm Trooper
  • ***
  • Posts: 201
    • View Profile
Re: Curved surface script
« Reply #28 on: July 07, 2014, 07:02:11 am »
Thanks for the various feedback, I now have a new version (1.0.0.3):

(1) Various bug fixes, I keep finding more also; including one that produced multiple identical cut paths in some situations.
(2) Most "glitches" when using an END mill have been avoided, or substantially reduced.  These may still appear when the tool cannot reasonably follow the geometry.

(3) When the first (and last) cut starts below the material surface (for pockets) I have added a vertical lead-in (out).  This means that this path will cut at the specified feedrate (this may be greater than the appropriate plunge rate).  This workaround may be generally OK (or may not?) as the plunge distance is limited to the tool diameter/2.0.
Is there a way of specifying a lead-in for engrave MOPs? If not this may mean I need to manipulate the G-Code directly.
(4) There is now and option to report the cut statistics.

Please keep the bug reports coming, and in particular where the cut paths look odd.

thanks

Geoff

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8360
    • View Profile
Re: Curved surface script
« Reply #29 on: July 07, 2014, 11:23:22 am »
Geoff,

The curves now look good, and since the plunge for a ball mill is only 1/2D, I see very little problems with it.  The old way, with the cut starts below the surface would have automatically allowed the use of the plunge rate, but it was very confusing to look at and understand.  Maybe I should bow my head and say, "sorry".  You might want to make those lead-ins an option.  (urk!)

The jaggies are still there, even when using a ball mill.
The odd full-circular paths 'above the plane' are still there when depth=radius in a curved pocket.

In my quick test, the Seed line is 2" long, starting at -1,0 and extending to +1,0.
Depth selected is -1  -- so it has a depth exactly equal to the curve's radius.
Ball nose cutter, diameter 0.375"
Stepovers and depth increments of 0.040"
angle of 5

I am confused by one thing.  I fired up your plugin, and the Edit/Intersection Points function became wonky.  It would show intersection points that did not exist.  For instance, select the outermost toolpath created by my test example above.  Without selecting any other lines, do an Edit/intersection points, and one will show up at the begin and end points of the line.  If you rotate the whole array of created curves along X in order to view the lines in the XY plane, it gets even stranger.  Then, intersection points show up at approximately -1/2D (almost where the vertical leadins stop, but not exactly there).  But since these are polylines, there are no 'intersections' there. ???


Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"