The Higher Education and Research forge

Home My Page Projects Code Snippets Project Openings Complex Surface Machining Optimization
Summary Activity SCM

SCM Repository

authorJean-Max Redonnet <jean-max.redonnet@unniv-tlse3.fr>
Mon, 18 May 2020 15:18:49 +0000 (17:18 +0200)
committerJean-Max Redonnet <jean-max.redonnet@unniv-tlse3.fr>
Mon, 18 May 2020 15:18:49 +0000 (17:18 +0200)
src/org/ica/cosmo/tests/MachiningDemo.java

index af581dd..14b7742 100644 (file)
@@ -7,13 +7,13 @@ import org.ica.cosmo.clustering.Clustering;
 import org.ica.cosmo.clustering.METRIC;
 import org.ica.cosmo.machining.AveragePDE;
 import org.ica.cosmo.machining.MillingContext;
-import org.ica.cosmo.machining.ZoneMilling_PPV3A_Approx;
+import org.ica.cosmo.machining.ZoneMilling_PPV3A_Approx3;
 import org.ica.cosmo.zoning.SurfaceMap;
 import org.ica.cosmo.zoning.Zone;
 import org.ica.vtkviewer.VtkViewer;
 import org.ica.vtkviewer.model.Color4d;
-import org.ica.vtkviewer.model.VtkCurve;
 import org.ica.vtkviewer.model.VtkModel;
+import org.ica.vtkviewer.model.VtkPolyline;
 import org.ica.vtkviewer.model.VtkSurface;
 import org.lgmt.dgl.curves.SurfacePointsCurve;
 import org.lgmt.dgl.surfaces.Surface;
@@ -75,7 +75,7 @@ public class MachiningDemo {
                }
                k = c.getCentroids().length;
 
-               ArrayList<ZoneMilling_PPV3A_Approx> zma = new ArrayList<ZoneMilling_PPV3A_Approx>(k);
+               ArrayList<ZoneMilling_PPV3A_Approx3> zma = new ArrayList<ZoneMilling_PPV3A_Approx3>(k);
                double totalLength = 0.0;
                double totalTime = 0.0;
                long start_time = System.currentTimeMillis();
@@ -92,8 +92,8 @@ public class MachiningDemo {
                        // z.setEvaluator(new SinglePointPDE(z, c.getCentroid(zj)));
                        double angle = z.evalPrefDir();
                        System.out.println("angle = " + angle);
-                       ZoneMilling_PPV3A_Approx.APPROX_LEVEL apxl = ZoneMilling_PPV3A_Approx.APPROX_LEVEL.FINE;
-                       ZoneMilling_PPV3A_Approx zMilling = new ZoneMilling_PPV3A_Approx(z, angle, true, apxl);
+                       ZoneMilling_PPV3A_Approx3.APPROX_LEVEL apxl = ZoneMilling_PPV3A_Approx3.APPROX_LEVEL.FINE;
+                       ZoneMilling_PPV3A_Approx3 zMilling = new ZoneMilling_PPV3A_Approx3(z, angle, true, apxl);
                        zma.add(zMilling);
                        zMilling.run();
 
@@ -110,10 +110,10 @@ public class MachiningDemo {
                System.out.println("longueur de trajectoire d'usinage = " + totalLength);
                System.out.println("durée de l'usinage = " + totalTime + " s");
 
-               for (ZoneMilling_PPV3A_Approx zMilling : zma) {
+               for (ZoneMilling_PPV3A_Approx3 zMilling : zma) {
                        for (ArrayList<SurfacePointsCurve> spcList : zMilling.getToolpathApprox())
                                for (SurfacePointsCurve spc : spcList) {
-                                       model.add(new VtkCurve(spc.getPoints(), 2.0, new Color4d(1.0, 1.0, 0.0)));
+                                       model.add(new VtkPolyline(spc, 2.0, new Color4d(1.0, 1.0, 0.0)));
                                }
                }
        }