Author Topic: Paraboloid Script  (Read 14551 times)

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1345
    • View Profile
Paraboloid Script
« on: January 09, 2015, 00:38:39 am »
HI All
I'm in the process of writing a Paraboloid script,(early days yet)  And produced a parabola, and wish to
add the focal point to a pointlist and display it along with the paraboloid, However I can't seem to get it
to display. The pointlist is added to the document but it's empty.
I'm sure it's something simple I'm missing.
Dave

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8331
    • View Profile
Re: Paraboloid Script
« Reply #1 on: January 09, 2015, 02:13:19 am »
I don't have time right now to edit, correct, and re-post.

1) it doesn't look much like a parabola at d=1, h=1.
2) you're assigning the focal point to a points list that never gets added to the drawing.
     (you add an empty one that does not contain the focal point info)

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

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1345
    • View Profile
Re: Paraboloid Script
« Reply #2 on: January 09, 2015, 02:21:12 am »
Hi loyd
Yes the values I started with are dia = 90 (mm) and 25 depth and a value of 3 for the density
and yes I can see the pointlist is added to the tree and I thought that
this code would add a point to the list
        dim plist as Point3FArray = new Point3FArray()
   dim f as point3F = new Point3F(0,0,focal_point)
   plist.add(f)
Dave.

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1345
    • View Profile
Re: Paraboloid Script
« Reply #3 on: January 09, 2015, 04:54:32 am »
HI all
Gee I made that harder than it needed to be this code worked fine
'***************** insert focal point ******************
 
   'create a pointlist and add focal point
        dim plist as pointlist = new pointlist
   dim f as point3F = new Point3F(0,0,focal_point)
   plist.add(f)
        doc.add(plist)
Lloyd I'd forgotten about the metric/imperial thing so I'll add that to the to do list.
I was going to introduce some bounds checking as my mills working area is (x) 320mm (y) 160mm z(250)
I was thinking torch/flashlight reflectors or directional antennas, however the solar furnace/cooker crowd
would be able to find the focal point of their units if I left bounds checking alone.So we will see.
This is still very much a work in progress and when it crosses ver 1.0 I'll post another file.
 

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4463
    • View Profile
Re: Paraboloid Script
« Reply #4 on: January 09, 2015, 12:38:23 pm »
Lloyd I'd forgotten about the metric/imperial thing

Dave,
What are you going to do different because of this ?
also I would leave bounds checking out.
Made in England

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8331
    • View Profile
Re: Paraboloid Script
« Reply #5 on: January 09, 2015, 22:32:12 pm »
What are you going to do different because of this ?
also I would leave bounds checking out.
--------------
Eddy, I won't put words in his mouth, but if I were doing it, I'd make the rotations and resolution a product of the magnitudes selected, without regard to whether it was Imperial or Metric.  The script doesn't need to know which measurement system is in force.

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

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1345
    • View Profile
Re: Paraboloid Script
« Reply #6 on: January 10, 2015, 00:06:18 am »
HI EddyCurrent,Lloyd,All

A little background, I went through my middle high school years when we changed from
imperial units to metric, So I intuitively  know that for example that 2 inches is 51.8 mm ect.       

My son and his cohort however would not have a clue, And would need to make the
conversion themselves.

1. With the view to making the script easy to use (as there is a plethora of information on the
net in both units) So the script could ask what units your using and if its Imperial/Metric make
the conversion for you.

Now my thoughts have turned to roughing strategy.
Regarding Maximum  Metal removal rate.

1.Using engraving mops suitably scaled and offset (I tried various tool dia's and offsets)
Nice for shallow parabola not so good for deep ones. (Have not tried tool changes you know
large dia roughing tool followed by smaller dia finishing tool.)

2.Using Pocket mops and a final engraving mop. Much the same as above although less
math involved. In general Takes longer than all engraving mops.

3. For deep narrow parabolas a drilling mop followed by a engraving mop. Not applicable to
shallow parabola.

4. A Lathe mop Fastest Material removal rate/Best finish of machine. Limited on the inside by
minimum boring bar dim.

I think that there is no one best solution and you may need to choose which strategy is
appropriate for your particular parabola.

Right now,  I'm working on Number 1 ie. You enter your tool dia and offset and the script
generates the paraboloid, Right now you have to select each entity and apply an engraving
mop to it.

   
Lloyd Yes you are correct and in truth I didn't want to post this code all as it's wrong in so
many ways, I could not  get past the pointlist problem (It turns out that I could not see the trees
for the forest) this often happens on large projects where I've cut and pasted large swathes of
code and forgot to change just one variable.

If you have any thoughts on Machining/Programing strategy or things I've missed.
That would be welcome.

Dave


 

Offline Garyhlucas

  • CNC Jedi
  • *****
  • Posts: 1369
    • View Profile
Re: Paraboloid Script
« Reply #7 on: January 10, 2015, 01:31:42 am »
Dave,
I cut PVC flanges with a large radius so they can be bolted against a round tank. I do the programming by extruding an arc as a surface then projecting a spiral onto the surface and copying the polyline vertically by the desired cutting depth.  I then explode the polylines, and delete all the lines above the surface of the stock. Finally I join them all back together as spirals.  The top one is the first MOP and they go top to bottom. So the cutting operation is continuous with a constant step over and goes as fast as my machine can cut. I would think you could cut the parabola the same way using a parabolic surface and projecting the spiral on to it.
Gary H. Lucas

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

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8331
    • View Profile
Re: Paraboloid Script
« Reply #8 on: January 10, 2015, 02:13:01 am »
Dave,
Please don't think we think less of you for supplying unfinished code.  We all swap 'snippets' and ideas here, and much of the tentative code we throw out for scrutiny is anything BUT finished.

I guess I'm confused as to why a ball-end mill would not do a deep ratio (short focal length) parabola just fine.  If you study my hemispherical pocket script, you'll find an algorithm that generates very uniform (not perfectly) steps both downward, and then translating to horizontal/vertical, and finally nearly horizontal steps... all of approximately the same size.

As Gary mentioned above: "I would think you could cut the parabola the same way using a parabolic surface and projecting the spiral on to it. "

The hemi algorithm uses a tangent-to-the-curve method to calculate how far to move in z and radius to accomplish that. It essentially 'projects' a fairly uniform spiral onto the surface of the curve, but using trig, on-the-fly.

It goes a little wonky as it asymptotically approaches horizontal, because Tan(anything) begins to break down near the horizontal.  I could switch trig somewhere around a 45-degee tangent, but this algorithm works pretty well, and the steps get smaller (rather than larger) near horizontal, which hurts nothing except for taking a little more time at the tippy-tip of the profile.

On the matter of units, I'd like to make my earlier comment into a stronger statement:  You should not determine units.  The session of CamBam you're in interprets any unit you supply as being whatever its working units are at the time.

The last thing you want is for a guy to be using metric units in an Imperial session of CamBam, or vice versa.  And what if he's not using the millimeters setting, but centimeters or meters, or thousandths instead of inches?

If I draw the parabola of any dimension in any system of measurement, it should calculate the number of turns based upon the user-supplied depth step and various radii as it plunges, not upon some arbitrary number you choose for the operator; anything you hard-code will be wrong for someone, some time.

If I were machining a cylinder 1 unit deep, and I specified a 0.030 units depth increment, I'd expect it to make 33-1/3 turns to depth, regardless of whether it was 1", or 1mm, or one light year deep.

(PS... the hemi algorithm will cause a curved pocket to take more turns than the calculated depth/increment because it must move horizontally, also.)

LLoyd
« Last Edit: January 10, 2015, 03:02:21 am by lloydsp »
"Pyro for Fun and Profit for More Than Fifty Years"

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1345
    • View Profile
Re: Paraboloid Script
« Reply #9 on: January 10, 2015, 04:16:19 am »
Hi Garry and Lloyd
Garry I'll do as you say and create a cb file in the same manner to get a feel for what your

saying and perhaps try to automate the process some, within the script.

Lloyd totally agree with your sentiments clear and logical.

Originally I had a look at the Hemi script and was going to use it as a model to work from.
However I came unstuck as you say the depth increment is specified by the user as (so much
per revolution) and the way i generated the parabola the z increment was a value generated
by the radii and the total z depth, So I'll have to rethink the algorithm.
Dave

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1345
    • View Profile
Re: Paraboloid Script
« Reply #10 on: January 11, 2015, 02:23:18 am »
HI all
So I did a few experiments, And rewrote the code shamelessly using the bulk of the Conic Helix code
adapted to generate  paraboloids (to be able to set the z depth per turn) However I've ran into a snag
for me anyway as I wanted to generate a shallow  150mm dia by perhaps less than 10 mm deep (most likely in the 5-7 mm range) concave (bowl shape) reflector. Which caused the stepover to be larger at the centre
So I'm going to rejig the original code (thanks Murray Bourne  from the IntMath Blog) to get it to provide a Z depth step per revolution. And Perhaps I'll add the ability  to choose Concave or Convex Paraboloids and machining direction.
They say a picture is worth a thousand words so here is a cb file with the differences between the two
methods of generating a paraboloid.

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8331
    • View Profile
Re: Paraboloid Script
« Reply #11 on: January 11, 2015, 03:18:09 am »
Dave,
You're FAST! That's great.  However, the conic helix algorithm doesn't handle the trig properly to manage the horizontal areas.

For that, you should take a look at the code for the hemispherical pocket.  It maintains (as far as I can tell) a pretty equal distance per move regardless of the angle, until it approaches almost exactly horizontal.  Then it gets finer.

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

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1345
    • View Profile
Re: Paraboloid Script
« Reply #12 on: January 11, 2015, 12:41:16 pm »
HI Lloyd
Yes I've tried to get a flying start as I'll be a bit scarce this week as we have visitors staying over for the next 5 or 6 days and I may be only able to get to the forum now and then.
I'll definitely have a look at the hemispherical script.
Dave

Offline klystron

  • Ewok
  • *
  • Posts: 36
    • View Profile
Re: Paraboloid Script
« Reply #13 on: January 11, 2015, 21:55:35 pm »
Bonne soirée ami Lloyd,
bonne année 2015, à vous et a vos proches.
Yves.
Good evening friend Lloyd,
Happy New Year 2015 to you and your loved ones.
Yves

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8331
    • View Profile
Re: Paraboloid Script
« Reply #14 on: January 11, 2015, 22:31:57 pm »
Et bonne année à vous aussi, Yves.  Je suis encore 960 km de la maison !



And happy new year to you too , Yves.  I'm still 600 mi from my home!

 :'(

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