FormFittingToolboxConsole

by ColinT, Sunday, January 20, 2019, 22:23 (211 days ago)

Hi Michael,

Just wondering if you can include the parameter "PLANE3D" with the console version of FFT?

It currently uses ELLIPSE3D, CIRCULARCYLINDER, CYLINDER, CIRCLE3D only. (with my version).

We run this as an external batch file, with our other programs and have very good confidence with the results!

Thank you for you excellent program!

FormFittingToolboxConsole

by Micha ⌂ @, Monday, January 21, 2019, 07:58 (211 days ago) @ ColinT

Hello Colin,

It currently uses ELLIPSE3D, CIRCULARCYLINDER, CYLINDER, CIRCLE3D only. (with my version).

I found the source code of this console version and extend the argument list by the keyword PLANE, see code below.

Please download the modified version and check it out:

https://dev.applied-geodesy.org/tmp/FormFittingToolboxConsole.jar

Let my know, if/how it works.

regards
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.form.form3d.Plane;
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);
 
  // ELLIPSE3D/CIRCULARCYLINDER/CYLINDER/CIRCLE3D/PLANE
  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 if (formType.equalsIgnoreCase("CIRCLE3D"))
   formManager.setFormClass(Circle3D.class);
  else if (formType.equalsIgnoreCase("PLANE"))
   formManager.setFormClass(Plane.class);
  else {
   System.err.println("Error, unknwon surface type: " + formType);
   return;
  }
 
  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();
  }
 
  if (status == 1) {
   formManager.exportFormParametersToFile(exportFile);
   System.out.println("\n\nEstimation successfully finished!");
  }
  else {
   System.err.println("Estimation failed!");
   return;
  }
 }
 
}

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Tags:
console, form fitting, form analysis, ellipse 3d, circular cylinder, circle 3d, plane

FormFittingToolboxConsole

by ColinT, Thursday, January 31, 2019, 05:16 (201 days ago) @ Micha

Hi Michael,

I cannot get result from the new file FormFittingConsole.JAR file using
PLANE parameter.

It may be not compiled?
Had no success to compile the .java file also.

Win10.
Do I use JavaW or JavaC ?


Here the source Plane3d.txt

1 767659.947 5972685.904 11.458
2 767661.151 5972684.602 11.358
3 767661.152 5972684.602 11.880
4 767661.148 5972684.602 12.530
5 767660.621 5972685.171 12.560
6 767659.928 5972685.920 12.617
7 767659.939 5972685.910 12.079
8 767660.305 5972685.518 12.027
9 767660.973 5972684.795 11.934
10 767660.520 5972685.283 12.297
11 767660.510 5972685.298 11.521

and the shell script

rem ARGS: {ELLIPSE3D/CIRCULARCYLINDER/CYLINDER/CIRCLE3D/PLANE}  LVERM  POINTS  REPORT
java -jar FormFittingToolboxConsole.jar PLANE 0 PLANE3d.txt PLANE3d.out
pause

Thank you

FormFittingToolboxConsole

by Micha ⌂ @, Thursday, January 31, 2019, 09:17 (201 days ago) @ ColinT

Hi Colin,

I transfer you mail to the forum. Please respect the note of the mail and reply only to your related forum thread and not to the mail:

this is an automatically generated information message. You receive this
email, because you have enabled the notification function. Please do not
reply to this email but respond to the specific thread.

It may be not compiled?

It is already compiled.

Using your data and script, I got the results of the estimated plane.

[image]


        Nx =                 -0.733956083892                 +0.000311959172
        Ny =                 -0.679190879893                 +0.000337437711
        Nz =                 -0.002866284759                 +0.000745242995
         D =           -4620022.516427744000              +1775.941196239705

Do I use JavaW or JavaC ?

No, javaC ist the java compiler. The javaw command is identical to java, except that with javaw there is no associated console window. Use javaw when you do not want a command prompt window to appear.

Please remove the rem in the last line to execute the pause command to get the error message, i.e.

rem ARGS: {ELLIPSE3D/CIRCULARCYLINDER/CYLINDER/CIRCLE3D/PLANE}  LVERM  POINTS  REPORT
java -jar FormFittingToolboxConsole.jar PLANE 0 PLANE3d.txt PLANE3d.out
pause

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Tags:
java, formfittingtoolbox, console, plane, shell

FormFittingToolboxConsole

by ColinT, Thursday, January 31, 2019, 20:38 (201 days ago) @ Micha

Michael,

I get exception error. Reason for asking if compiled? I renamed ..Console_.jar as downloaded again to make sure have correct version. Same result as below.

Using JavaC.exe, _.java file does not compile with class error.
My test directory has write access.

Copied command shell output from script:-

C:\Plane_Calc>rem ARGS: {ELLIPSE3D/CIRCULARCYLINDER/CYLINDER/CIRCLE3D/PLANE} LVERM POINTS REPORT

C:\Plane_Calc>java -jar FormFittingToolboxConsole_.jar PLANE 0 PLANE3d.txt PLANE3d.out
Exception in thread "main" java.lang.NoClassDefFoundError: com/derletztekick/geodesy/formFittingToolbox/v2/gui/FormManager
at com.derletztekick.geodesy.formFittingToolbox.v2.console.FormFittingToolboxConsole.main(FormFittingToolboxConsole.java:56)
Caused by: java.lang.ClassNotFoundException: com.derletztekick.geodesy.formFittingToolbox.v2.gui.FormManager
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more


So, not sure what is going on here?
Col

FormFittingToolboxConsole

by ColinT, Thursday, January 31, 2019, 22:22 (200 days ago) @ Micha

Michael,

yes, error from script seems to be write permissions on my directory.
It works elsewhere but not in the directory created for testing?
Thanks.:-)

FormFittingToolboxConsole

by Micha ⌂ @, Friday, February 01, 2019, 07:27 (200 days ago) @ ColinT

Hello,

It works

Fine! :cool:

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

RSS Feed of thread