ArcCAM
 1-7  8-27  28-35

Previous
Next
 From:  probotix
11543.28 In reply to 11543.27 
For the algorithm you suggested, I'm thinking maybe I could take the entry angle (tangent of the first point I think) and rotate the mid and end points to align with cartesian before doing the calculation.

BTW, I'm not worried about circles yet because they will be a completely different tool path, and Haas has a circular pocket op from center and radius.

>Len
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
11543.29 In reply to 11543.28 
Hi Len,

re:
> For the algorithm you suggested, I'm thinking maybe I could take the entry angle (tangent of the first point I think)
> and rotate the mid and end points to align with cartesian before doing the calculation.

The property of clockwise/counter-clockwise direction is invariant to 2D rotation.

It looks like you have a typo in the isClockwise2() function.

You have this:

code:
function isClockwise2(k,l,m)
{
	var XLK = l.x - k.x;
	var XMK = m.x - k.x;
>>>	var YLK = m.y - k.y;        <<<
	var YMK = m.y - k.y;

	signed_area = 0.5 * (( XLK*YMK ) - ( XMK*YLK ));
	if( signed_area > 0)
		return 1;
	else if( signed_area < 0)
		return -1;
	else 
		return 0;
}


There is a typo in the line marked with >>> <<< , it should be
(from http://moi3d.com/forum/index.php?webtag=MOI&msg=11521.42):

code:
var YLK = l.y - k.y;


- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  probotix
11543.30 In reply to 11543.29 
Michael,

Thanks! See that's why you make the big bucks. ;-)

>Len
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  probotix
11543.31 In reply to 11543.30 
Michael,
I'm getting a much better understanding of arcs in Moi, now. But I am puzzled by this behaviour.

Here is the starting arc.



In this next image, I add a point snapped to the midpoint of an arc, and it adds another control point instead and keeps the arc intact.



In this third image, I trim the arc using the orange line and it splits the arc, but the top half has only one control point while the bottom has two.



>Len

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
11543.32 In reply to 11543.31 
Hi Len, when you show edit points on a circle, ellipse, or arc curve the points you see are from an automatically rebuilt approximation curve.

That's so that if you edit the points you'll get a smooth curve and not get kinks at internal fully multiple knots.

But if the segment is an arc with only 3 control points (without any internal fully multiple knots) it won't do the automatic rebuild because editing those points won't produce a sharp kink. The upper segment in your 3rd image falls into this category.


> In this next image, I add a point snapped to the midpoint of an arc, and it adds another control
> point instead and keeps the arc intact.

One thing to note is after you have added the control point, the result will be a rebuilt general spline curve and not a precise arc anymore.

If you want to keep exact arcs then you shouldn't edit their control points, when you do control point manipulation it is assumed that you want to make a squishable smooth curve.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  probotix
11543.33 In reply to 11543.32 
Yeah, not trying to add or edit the control points, but it wont let me add a point to the curve. It adds the point to the control points. The only way I can find to split the curve is to trim it with a line.

>Len
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
11543.34 In reply to 11543.33 
Hi Len, what is it you are trying to accomplish by adding a point to the curve?

re:
> The only way I can find to split the curve is to trim it with a line.

The Trim command is the right tool to use for splitting an arc into 2 arc pieces.

If you want to cut it at a particular point you don't have to use a line, there is an "Add trim points" button that you can use to pick a splitting point on the curve.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  probotix
11543.35 In reply to 11543.34 
I have added an origin point selector so that you can select the point that you want to be X0 Y0 of the gcode, plus some code cleanup after Michael helped me solve my clockwise/counterclockwise problem.

https://github.com/probotix/ArcCAM

I have been cutting parts with this all day on the Haas. Its saving me a ton of time, wasted parts, and broken tools already. I'm in the middle of a new product roll-out and building the production code is the most painful part.

>Len
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages:  1-7  8-27  28-35