Form Fitting Tootbox Ellipse3d (Software)

ColinT @, Sydney, Dienstag, 31. Januar 2017, 06:27 (vor 259 Tagen)

Hi,
I think you solutions are fantastic! We have used them for many problems in 3d space.
We would like to run FFTb <Ellipse3d> as a .bat file. Is this possible? Similar to your solution provided for Circle3d, however it can be ellipse as the circle is another form of an ellipse.
We try to call this external .bat file from within another program.
Call style "FFTb.bat Ellipse3d inputfile.txt resultfile.txt".
Col

Avatar

Form Fitting Tootbox Ellipse3d

Micha ⌂, Bad Vilbel, Samstag, 04. Februar 2017, 10:23 (vor 255 Tagen) @ ColinT

Hi,

We would like to run FFTb <Ellipse3d> as a .bat file. Is this possible?

Due to some changes, the (old) source code does not work anymore with the current version. A new version can be found tmp. here: FormFittingToolboxConsole.zip

Let me know, how it works.

/Micha


 /**********************************************************************
 *                     FormFittingToolboxConsole                        *
 ************************************************************************
 * Copyright (C) by Michael Loesler, http//derletztekick.com            *
 *                                                                      *
 * This program is free software; you can redistribute it and/or modify *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation; either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * This program is distributed in the hope that it will be useful,      *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with this program; if not, see <http://www.gnu.org/licenses/>  *
 * or write to the                                                      *
 * Free Software Foundation, Inc.,                                      *
 * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.            *
 *                                                                      *
 **********************************************************************/
 
package com.derletztekick.geodesy.formFittingToolbox.v2.console;
 
import java.io.File;
import java.util.Locale;
 
import com.derletztekick.geodesy.formFittingToolbox.v2.form.Form;
import com.derletztekick.geodesy.formFittingToolbox.v2.form.form3d.Circle3D;
import com.derletztekick.geodesy.formFittingToolbox.v2.form.form3d.CircularCylinder;
import com.derletztekick.geodesy.formFittingToolbox.v2.form.form3d.Cylinder;
import com.derletztekick.geodesy.formFittingToolbox.v2.form.form3d.Ellipse3D;
import com.derletztekick.geodesy.formFittingToolbox.v2.gui.FormManager;
import com.derletztekick.geodesy.formFittingToolbox.v2.io.PointFileReader;
 
public class FormFittingToolboxConsole {
 
 /**
  * @param args
  */
 public static void main(String[] args) {
  System.setProperty("com.github.fommil.netlib.BLAS", "com.github.fommil.netlib.F2jBLAS");
  System.setProperty("com.github.fommil.netlib.LAPACK", "com.github.fommil.netlib.F2jLAPACK");
  System.setProperty("com.github.fommil.netlib.ARPACK", "com.github.fommil.netlib.F2jARPACK");
 
  int dim = 3;
  double levmar = 0;
 
  String formType = args[0];
  try {levmar = Double.parseDouble(args[1]);} catch(NumberFormatException nfe) {nfe.printStackTrace();}
  File pointFile  = new File(args[2]);
  File exportFile = new File(args[3]);
 
  FormManager formManager = new FormManager(null, Locale.getDefault());
  formManager.setDimension(dim);
  formManager.setLevMarDampingValue(Math.abs(levmar));
  formManager.adjustUnknownParametersOnly(true);
 
  if (formType.equalsIgnoreCase("ELLIPSE3D"))
   formManager.setFormClass(Ellipse3D.class);
  else if (formType.equalsIgnoreCase("CYLINDER"))
   formManager.setFormClass(Cylinder.class);
  else if (formType.equalsIgnoreCase("CIRCULARCYLINDER"))
   formManager.setFormClass(CircularCylinder.class);
  else
   formManager.setFormClass(Circle3D.class);
 
  PointFileReader reader = new PointFileReader(pointFile, dim);
  reader.ignoreLinesWhichStartWith("#");
  int status = -1;
  if (reader.readSourceFile()) {
   formManager.setPointGroup(reader.getPoints());
   Form form = formManager.createForm();
   status = form.estimateModel();
  }
  System.out.println(status==1?"\n\nEstimation successfully finished!":"\n\nEstimation failed!");
  if (status == 1) 
   formManager.exportFormParametersToFile(exportFile);
 }
 
}

--
kostenlose Scripte und Software nicht nur für Geodäten || Portal für Geodäten mit angeschlossenem Forum-Vermessung

Tags:
Ellipse3d, Circle, Cylinder, Fitting

Form Fitting Tootbox Ellipse3d

ColinT @, Sydney, Montag, 13. Februar 2017, 09:11 (vor 246 Tagen) @ Micha

Hi Micha,

Yes, the Ellipse3d extension does work. We would like to thank you for your help on this. It is very much appreciated.

Col

RSS-Feed dieser Diskussion