NGCGUI "Teardrop" routine

Home Model Engine Machinist Forum

Help Support Home Model Engine Machinist Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

vederstein

Must do dumb things....
Joined
Feb 26, 2011
Messages
917
Reaction score
744
I've been working on this on and off for months and I think I finally got it to work.

It's a routine for NGCGUI that creates a slot with two different radii. This is much more powerful than the sample "Slot" routine supplied with NGCGUI for LinuxCNC. This shape is seen time and time again, particularly for cranks and offset handles. You can also use it to replace the slot routine (make R1 and R2 the same).

R1 or R2 can be any size. The angle between them can be anything. It will offset the endmill inside or outside of the contour (depending if the endmill diameter is positive or negative).

The routine will fail is the arcs are too close (e.g. the line segments cannot be created) or one arc encompasses another arc. But that's different shape. (strangely it will create a circle if the two arcs are exactly the same size and position).

It's a non-sensical combination, but it will also fail and/or do funky things if the the endmill diameter is both negative and larger than one of the radii.

If a couple of people could please test it and let me know if you find any bugs, I'd appreciate it.

Also note, this routine is used at your own risk. If something goes bad, I am not liable for anything.

teardrop.gif


View attachment teardrop.zip
 
I've been working on this on and off for months and I think I finally got it to work.

It's a routine for NGCGUI that creates a slot with two different radii. This is much more powerful than the sample "Slot" routine supplied with NGCGUI for LinuxCNC. This shape is seen time and time again, particularly for cranks and offset handles. You can also use it to replace the slot routine (make R1 and R2 the same).

R1 or R2 can be any size. The angle between them can be anything. It will offset the endmill inside or outside of the contour (depending if the endmill diameter is positive or negative).

The routine will fail is the arcs are too close (e.g. the line segments cannot be created) or one arc encompasses another arc. But that's different shape. (strangely it will create a circle if the two arcs are exactly the same size and position).

It's a non-sensical combination, but it will also fail and/or do funky things if the the endmill diameter is both negative and larger than one of the radii.

If a couple of people could please test it and let me know if you find any bugs, I'd appreciate it.

Also note, this routine is used at your own risk. If something goes bad, I am not liable for anything.

didn't i just see this on the linux cnc forum? good to see there is some overlap from the two forums. and nice work. i probably wouldn't have thought to do this in a subroutine. i tend to just program as i go and not think too much about reusing code.

thanks for sharing.
 
Yes, I did post it on LinuxCNC as well. I'm really curious if anyone finds any bugs in the code so I can squash them. There wasn't any response here so I posted it there as well.

...Ved.
 

Latest posts

Back
Top