News: *** FORUM BACK *** please see 'Latest News' for updates
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2018, 00:01:26 am

Login with username, password and session length

Pages: 1 ... 7 8 [9]
Author Topic: Creating a new type of MOP?  (Read 43468 times)
Offline Offline

Posts: 58

View Profile
« Reply #120 on: April 18, 2017, 09:54:11 am »

Hi Geoff,
Some week or two ago I started to try to do an AutoLeveling Engrave MOP.

My first tries were to see whether I could manipulate the toolparh in such a way that the GCODE generation would take it into account. I notices that just changing the ZOffset is working pretty OK. But... any other, more elmentary translations on the toolpath PolyLines generate a lot of weird artifacts.. Specially the extra 'Bulge' attribute is still a big mystery to me...

Here is a sample how I managed to skew/rotate the plane 10 degrees:

      CADFile cadfile = CamBamUI.MainUI.CADFileTree.CADFile;

      foreach (CAMPart part in cadfile.Parts)
        foreach (MachineOp mop in part.MachineOps)
          if (mop.Toolpaths2 != null)
            foreach (ToolpathItem item in mop.Toolpaths2.Toolpaths)
              item.Toolpath.Transform.RotY(Math.PI / 180f * 10f);
              //for (int i = 0; i != item.Toolpath.Points.Count; i++)
              //  item.Toolpath.Points[i] = new PolylineItem(item.Toolpath.Points[i].Point.X,
              //                                             item.Toolpath.Points[i].Point.Y,
              //                                             item.Toolpath.Points[i].Point.Z + item.Toolpath.Points[i].Point.X * 0.1,
              //                                             item.Toolpath.Points[i].Bulge);

            foreach (Polyline rapid in mop.Toolpaths2.Rapids)
              rapid.Transform = Matrix4x4F.Identity;
              rapid.Transform = Matrix4x4F.Identity;

It does do the majority of the toolpaths *AND* GCODE is generated accordingly  Cool but... still there are sme weird things happening with fairly random lines just suddenly sticking out-of-plane ( either slanted or perpendicular )  Shocked Cry

Also note, that modifying the 'rapids' is only cosmetic, IRL the GCODE Generator only takes the 'Clearance-Height' into account to generate the output Undecided Undecided

So I feel somehow, that it's a nessesity to override the whole ToolPath generation up front, and not trying to modify the already generated toolpath afterwards...

The commented lines in my code do also kinda work, but with the same effects as the rotation transformation...


CNC Jedi
Offline Offline

Posts: 4966

View Profile WWW
« Reply #121 on: April 18, 2017, 18:06:01 pm »


Specially the extra 'Bulge' attribute is still a big mystery to me...

It is not the same than the bulge in a polyline ? (curvature)

Pages: 1 ... 7 8 [9]
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.194 seconds with 18 queries.

Copyright © 2018 HexRay Ltd. | Sitemap