ArcCAM
 1-6  7-26  27-35

Previous
Next
 From:  Michael Gibson
11543.7 In reply to 11543.6 
Hi probotix, what version of MoI are you using?

The one on the left is registering as an arc:


The one on top is similar to the first one, it's a general curve that is about 0.001 units off from an exact arc. So it's pretty close but not quite enough for MoI to consider it an arc.

- Michael
Attachments:

  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:  stefano (LIGHTWAVE)
11543.8 In reply to 11543.7 

Sounds like an interesting project maybe for specific use cases - I always liked cutting out software in the cad to CNC mix - example I really like the laser driver I have for my pretty high end / decent co2 American laser which goes straight from Coreldraw…

I also have two industrial engraving machines but don’t use them much or almost never - I could maybe contribute by trying to get my head round how they operate some day and seeing if your script output could eventually be pasted from moi or a text file straight into Mach 3…

My process for running one of those machines was coreldraw (.eps) or (.dxf) > Vectric VCarve > Mach 3

My other machine was not retrofitted has a legacy controller box and uses “engrave lab” software / dongle.

You should have a look at Vectric if you don’t already know it - does tool paths - has a visualiser and works pretty intuitively. I doubt that gives bad gcode because you can help or tweak it with your own post processor tweaks I think.

Some Vectric forum posts and HAAS arcs mentioned on one of them I believe…

https://www.google.com/search?q=vectric%20haas%20post%20processor&ie=utf-8&oe=utf-8&client=firefox-b-m

Vectric website:
https://www.vectric.com/

EDITED: 19 Sep by LIGHTWAVE

  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.9 In reply to 11543.7 
I'm using the latest beta July 30 2024.

I have noticed some issues in the past where snapping seems to accumulate rounding errors, or so it seems.

I've gotten my test curve mostly straightened out. One thing I had to do that took me a couple of days to figure out was how to identify whether can arc was clockwise or counterclockwise. I figured out how to do it by calculating the arc angle. Here is my logic:


function find_angle2(p0,p1,c) {
return Math.atan2(p0.y - c.y, p0.x - c.x) - Math.atan2(p1.y - c.y, p1.x - c.x);
}

function isClockwise( angle )
{
var pi = Math.PI;
if ( angle == 0 || angle == pi )
return 0;
else if ( angle > 0 && angle < pi )
return 1;
else if ( angle> pi )
return -1;
else if ( angle < 0 && angle> (pi * -1))
return -1;
else if ( angle < (pi * -1))
return 1;
}

var arcAngle2 = round(find_angle2( segment.getStartPt(), segment.getEndPt(), segment.conicFrame.origin),1);

Problem is that when I have an exact half circle, the arc angle is 1pi and I havent figured out how to identify clockwise or counterclockwise. Any ideas?

Also, is there a way (I could not find a script) to explicitly set the start point of a curve?

>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.10 In reply to 11543.8 
Thanks for your feedback, stefano. I guess I should have given a little more background. My business is building CNC machines. We use LinuxCNC software, and I have modified it extensively to suit our needs. We are about to release a LinuxCNC touchscreen that runs on an embedded Raspberry Pi5. And BTW Mach3 uses the open source core gcode processor from the LinuxCNC project, so anything that runs on Mach3 would also run on LinuxCNC.

I am a Vectric dealer, and while I ackowledge that their software is by far the easiest to use CAM software out there, the gcode it spits out is bloated to say it nicely. For example, it will break any arc that is not a multiple of 90 degrees into segments. It also does not do canned cycles, so just doing a peck drill operation it generates a line for every plunge, and every retract, when you can do that in a single line of code with a canned cycle.

I am also a Fusion360 partner and its probably the best CAM software out there, but it still has its issues and it requires you to either import a mesh, or build your model in their parametric modeler. I can model so much faster in Moi. And parametric modelers stifle creativity with its bloat. So I am eager to keep my workflow inside of Moi as much as possible.

The purpose of this project is to make use of the simple arcs that most mechanical parts are designed with, canned cycles, and built-in pocketing operations that controls like the Haas can do. Anything beyond that is extra. It looks like Michael has done a good job of building an API that will require this to sit outside of the core of Moi.

>Len

EDITED: 19 Sep by PROBOTIX

  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.11 In reply to 11543.5 
>> Do you have an older version with the circle before trimming?

I dont think I do. I do import EPS files from Corel sometimes, but I almost always redraw everything in Moi. But I also cant say for sure that is what happened here. Now that I know what to look for, I'll be more careful in the future. I am a purist and dont like things out of order even if I am the only who can see them. ;-)

Also, the main reason I ever have to work in Corel is to create 2D dimensioned drawings to hand code my gcode off of, which hopefully this project will eliminate.

>Len

EDITED: 19 Sep by PROBOTIX

  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:  stefano (LIGHTWAVE)
11543.12 In reply to 11543.10 
Hi Len, frankly I sense your probably onto a total winner - lots of machines with totally naff controllers and dubious software thrown into the workflow mix.

Part of reason I don’t use the two engraving machines is because there is too much friction to get output and I’m typically too busy to sit there trying to remember “how”.

also most of my jobs are bit specialist so I goto suppliers who are more like ‘associates” they have serious machines. Like 3kw fibre lasers and very expensive CNC stone and marble machines and waterjets.

It’s hilarious to see how some of these factories with expensive machines are still using retro cad-cam software and a few “operators” have issues reading dxfs unless a certain type of flavour. I guess us moi users can just walk in with a USB key and show them ;0)

Where are you based ?

UK (currently) here…
  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.13 In reply to 11543.12 
>> Where are you based ?

We are in Fort Walton Beach, Florida... the good part of Florida. ;-)

>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:  stefano (LIGHTWAVE)
11543.14 In reply to 11543.13 
Wasn’t aware of that side of Florida Looks like a nice place to build machines and go surfing sometimes.

Curious what version of coreldraw you use ?
  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.15 In reply to 11543.9 
Hi probotix,

re:
> One thing I had to do that took me a couple of days to figure out was how to
> identify whether can arc was clockwise or counterclockwise.

If you get 3 distinct points on the arc (on a circle don't get start/mid/end because start and end are the same), you can then calculate the signed area of the 2D triangle which will be negative for clockwise order, positive for counter-clockwise.

Script code for calculating this is here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=11521.42


re:
> Also, is there a way (I could not find a script) to explicitly set the start point of a curve?

Do you mean only moving just the start control point which will mutate the shape of the curve?

Or do you mean moving the whole curve keeping its shape but positioning it so that it's start point is at the given point?

- 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.16 In reply to 11543.15 
I mean on a closed curve (polyline, poly-line-arc), being able to set the start point to any point I pick. I can already use OrderCurves to change the direction, but I want to be able to set the start point as well.

>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.17 In reply to 11543.16 
Hi Len,

re:
> I mean on a closed curve (polyline, poly-line-arc), being able to set
> the start point to any point I pick.

Do you mean like this ChangeClosedCurveSeam script:
http://moi3d.com/forum/index.php?webtag=MOI&msg=10125.8

- 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.18 In reply to 11543.17 
Looks like that does what I need. Thanks!

>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.19 In reply to 11543.17 
Couple of other questions...

How can I access object user text? Can it be set for individual segments?

Is there a moi.filesystem.setSavePath to choose directory to save files in if I want to have the user enter the file name in a text dialog? This would enable creating multiple files from multiple curves in a single operation, and it would make it easier for the user to specify the filenames that get embedded into the text of the gcode files of certain controls systems, ie Haas.

>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.20 In reply to 11543.19 
Hi Len,

re:
> How can I access object user text?

From the UI it's under Details... > Object user text.

From script:

.setUserText( Key, Value ); - Set text value for given key.
.getUserText( Key ); - Returns text value for given key, or undefined if not present.
.removeUserText( Key ); - Remove user text value for given key.
.getAllUserText(); - Return list of all user text, each object has .key and .value properties.
.clearAllUserText(); - Clear all object user text.


> Can it be set for individual segments?

No, not really. You can set it on a segment but it won't show up in the UI and it won't get persisted. It's meant to go on the curve.


> Is there a moi.filesystem.setSavePath to choose directory to save files in if I want to have
> the user enter the file name in a text dialog?

There's moi.filesystem.getSaveFileName() if you want to get a file name from the user, like this:
var filename = moi.filesystem.getSaveFileName( 'Text file name', 'Text files (*.txt)|*.txt' );

If you want to get a directory name from the user instead of a file name, in v5 there is moi.filesystem.getDirName(),like this:
var dir = moi.filesystem.getDirName( 'Dialog caption', 'c:\\initpath' );
returns empty string if canceled.

- 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:  Mik (MIKULAS)
11543.21 In reply to 11543.10 
Hi Len,

>So I am eager to keep my workflow inside of Moi as much as possible.

Me too :-)

... therefore I think that it's excellent idea to have CAM plugin inside MoI.
I think over to purchase some CNC machine (laser, router), but one of the BIG thing, which brake down my decision is potential problem with CAM sw and not enough time to find out the source of problem :-)
CAM plugin tuned for MOI + MOI = reliable CNC workflow for everybody :-)

Thank you .
Mik
  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.22 In reply to 11543.20 
This works:

usertext = curves.item(i).getAllUserText();
for ( var u = 0; u < usertext.length; u++ )
{
alert( usertext.item(u).key + " => " + usertext.item(u).value + "\n");
}


Thanks Michael!

>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:  stefano (LIGHTWAVE)
11543.23 In reply to 11543.22 
hi len - had a look at your website looks interesting...this new Linux-CNC product of yours (in the making)...
Is it going to be touchscreen and totally compact or "industrial" like your other control boxes. Could
consider throwing MACH 3 out of the window - literally.

Cheers

Stefano..
  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.24 In reply to 11543.23 
Hey Stefano

Here is the teaser image for the new machine series that will come with the new touchscreen:



It will be offered in an ethernet based version for interfacing with the Mesa Electronics FPGA control cards, which we use in our new UnityE controllers. It will also be offered with 2x DB25 ports for interfacing with older parallel port based controllers. There will be options for 15" and 10" versions.

>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.25 In reply to 11543.15 
Michael,

Tried your suggestion for clockwise/counterclockwise, but it doesn't work because I need to know clockwise or counterclockwise from the direction of travel, not relative to absolute cartesian space.
code:
// DOESNT WORK
function isClockwise(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 &gt; 0)
		return 1;
	else if( signed_area &lt; 0)
		return -1;
	else 
		return 0;
}

var min = segment.domainMin;
var max = segment.domainMax;
var len = max - min;			
var start = segment.getStartPt();
var midpoint = segment.evaluatePoint( min + (0.5 * len) );
var end = segment.getEndPt();
var clockwise = isClockwise( start, midpoint, end );			

This below works for any arcs that are not 180 deg, but 180 degree arcs resolve to an arc angle of pi, so it doesnt know which direction to turn:
code:
// WORKS FOR ANY ARC THAT IS NOT 180 degrees (pi radians).
function isClockwise( p0,p1,c )
{
		var pi = Math.PI;
                var angle = Math.atan2(p0.y - c.y, p0.x - c.x) - Math.atan2(p1.y - c.y, p1.x - c.x);

		if ( angle == 0 || angle == pi )
 			return 0;
		else if ( angle &gt; 0 && angle &lt; pi )
			return 1;
		else if ( angle&gt; pi )
			return -1;
		else if ( angle &lt; 0 && angle&gt; (pi * -1))
			return -1;
		else if ( angle &lt; (pi * -1))
			return 1;
}

var clockwise = isClockwise( segment.getStartPt(),segment.getEndPt(), segment.conicFrame.origin );


>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.26 In reply to 11543.25 
Hi Len,

re:
> Tried your suggestion for clockwise/counterclockwise, but it doesn't work because I need
> to know clockwise or counterclockwise from the direction of travel, not relative to absolute
> cartesian space.

Can you please post a .3dm file with an example arc that doesn't work?

Could you maybe describe a little more about what coordinate system you need to use if it isn't global coordinates?

- 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
 

Reply to All Reply to All

 

 
Show messages:  1-6  7-26  27-35