Re: How to 'crop' a g-code
A late response on this problem...
Quote:
Originally Posted by
Greeny
In geometry, the term for what you want to do is 'clipping'
Try a search for 'polygon clipping'
It seems like a simple task but is made difficult by lots of tricky edge cases.
If you can code in c++ or c# or Delphi i can recommend Angus Johnsons excellent freeware 'Clipper'
http://www.angusj.com/delphi/clipper.php
Cheers
First of all thanks a lot Greeny for pointing me in the right direction!
For a programmer it was a 5 minutes job. The solution was simpler than the clipper library (certainly included in the library as well), it is called ray casting algorithm.
Here are code examples.
Quote:
Originally Posted by
magicniner
I don't think you realise just how complex a mathematical problem what you're asking for constitutes
Nick, I'm sorry to tell you that this complex mathematical problem is done by a computer in less than a second, by comparing 50k points against a 12 points defined polygon.
Re: How to 'crop' a g-code
Quote:
Originally Posted by
paulus.v
Nick, I'm sorry to tell you that this complex mathematical problem is done by a computer in less than a second, by comparing 50k points against a 12 points defined polygon.
Paulus,
I'm sorry to have to tell you that how quickly a computer runs a chink of code has no relationship to the complexity of the maths used by the programmer to address the problem or how smart the programmer had to be to write the code :D
Or could any dummy have done the job? ;-)