Author Topic: Digitizer Import plugin  (Read 75749 times)

Offline GeoffreyGRoy

  • Wookie
  • ****
  • Posts: 270
    • View Profile
Digitizer Import plugin
« on: August 10, 2014, 07:26:49 am »
I am attaching for comment and feedback my first version of a digitizer import  plugin for CamBam.  Given that we have a point cloud (as a text file containing point X,Y,Z coordinates, one point per line) then the plugin will:

(1) Import the data, and display the number of points and the X, Y and Z ranges
(2) Allow the user to set offsets (in X,Y and X) and scales for X, Y and Z to transform the data
(3) Create a triangulated surface using a Delaunay triangulation process on the transformed model.
(4) Save the result in an STL file
(5) Optionally import this file/model into CamBam

The plugin does not generate the digitized cloud data, that must come form another source ;D

Comments, feedback and bug reports appreciated

Geoff

Note: The latest version is also attached here.
« Last Edit: January 14, 2015, 05:42:18 am by GeoffreyGRoy »

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8969
    • View Profile
Re: Digitizer Import plugin
« Reply #1 on: August 10, 2014, 11:49:36 am »
First comment, Geoff...
Boy!  That must've been a bit of work! <G>

LLoyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: Digitizer Import plugin
« Reply #2 on: August 10, 2014, 15:37:03 pm »
Hello,

Very nice !! a great addition to cambam.

I'll do the translation, but I think that Ralf and me we will have the same problem with the length of the field in column 2 et 3. I'll add a picture when translated.

++
David

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: Digitizer Import plugin
« Reply #3 on: August 10, 2014, 16:14:23 pm »
re

I do a test on a file that cause problem with my converter because points are missing ; no problem with yours ... fine !!

Just a suggestion ; it takes time to compute (~ 4min)  ... maybe a progress bar or just a % completion display can be added. (the face number increase, but only if the window stay active ; if we activate another window, then come back to the plugin window, the text in the 'face number' no longer change).

I add the defect file that I use to do the test ; the resulting model is very good ! (164 572 faces)

a bug I just found: if the file in 'input file' not exists, the plugin crash.

in this case it happens because the plugin remember the file name in 'input file' fields, and I click on 'Load' without clicking on 'Browse' before ... but the file in the fields no longer exists on the hard disk.

The plugin don't ask for overwriting if the stl file already exists.

++
David

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1826
    • View Profile
Re: Digitizer Import plugin
« Reply #4 on: August 11, 2014, 00:46:46 am »
Geoff
        I tested the plugin with the first point cloud file I made, Which I know had an errant z height in the data that caused a small pyramid structure in the stl and also two holes. The holes are fine, However the pyramid
remains, I repaired this by averaging this point to the data points around it.
I don't expect that you could or should do anything about this, But I'll post the original file it as a curiosity.
As an aside the coin was minted in 1983 and very worn and some of the features on the interior were less than
0.1 mm.
Also are you using the full version of Visual Studio or the express version to make your plugins, As I would like to write some plugins myself and have installed the express version (C#) and have found that I need the full version to make some processor optimisations.
My hats off to you, That's a fine plugin.
Dave.

Offline GeoffreyGRoy

  • Wookie
  • ****
  • Posts: 270
    • View Profile
Re: Digitizer Import plugin
« Reply #5 on: August 11, 2014, 23:04:50 pm »
David and Dave

I am attaching an updated version (1.0.2) of my DigitizePlugin with the following fixes:

(1) A progress bar has been added.  This, together with the triangle count, should now update correctly even if the dialog looses focus.  Please check this and let me know if it works for you. There is also a new Cancel button that should terminate a long running computation if required.

(2) If the input file is not found then a warning dialog is shown.

(3) If the STL file already exists then a warning is given before overwriting.

The "glitch" in the 5centpiece data file can be found at (X=15.8, Y=12.7), the Z coordinate is clearly incorrect at this point, this caused the pyramid and can be adjust out as required.

I am using the free (express) version of VS2010 for C#.

Geoff

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1826
    • View Profile
Re: Digitizer Import plugin
« Reply #6 on: August 12, 2014, 08:05:10 am »
Geoff
       
I have tested the plugin with all the probing files I have and all seems fine, love the progress bar as it gives me a sense of knowing what's going on during a long process with big files.
As an aside I've finally got VS to compile the plugins here including the demo and AutoDiagrammer  from the Code Project and have started to read the msdn manual, So I've at least made a tentative  start on the way to write some plugins.
Dave

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8969
    • View Profile
Re: Digitizer Import plugin
« Reply #7 on: August 12, 2014, 10:42:41 am »
 ::)
Good luck, Dave.  You'll find VS to be quite easy to use, and flip-flopping back and forth between C and BASIC environments is almost seamless.

I'm right now learning Python, and it's about to kill this old brain to absorb all the object-oriented stuff along with the 'contracted' syntax features.

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2652
    • View Profile
Re: Digitizer Import plugin
« Reply #8 on: August 12, 2014, 10:50:18 am »
... along with the 'contracted' syntax features.

Lloyd
Yeah, one mis-indented line and you get unexpected results  ;D

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: Digitizer Import plugin
« Reply #9 on: August 12, 2014, 17:51:11 pm »
Hello,

Thanks for this quick release ..  ;)

a view of the French translation.



The doc is also translated in French.

Note: if a non saved drawing already exists in CB when the plugin is used, no warning is displayed to save the current drawing before erasing.

after a 3D surface as been created by the plugin, if we close Cambam, no warning is displayed if the file as been not saved.

++
David

Offline pixelmaker

  • CNC Jedi
  • *****
  • Posts: 1967
    • View Profile
    • pixelmaker
Re: Digitizer Import plugin
« Reply #10 on: August 12, 2014, 21:12:06 pm »
Hello,
I try to do the german translations today but this is not possible.
I can translate the pdf file but with the UI I get some problems.
The larger the translation file is the slower start CamBam. For this reason I think it is important that the translations are clean.
• There are the problem that a longer text then the english writes over the value fields. If you make the text right justified it can´t overlap the value fields but expands to the left site. Then every word has the same distance to the value field.
• There are different spaces between the first and second and between the second and third column. Between the second and third column one character space is less.
• The UI has a size of 610 to 366 pixel. I don´t know how small your monitor is but I think a minimum of 1024px is the standard today. I see no reason to make the UI so small and have too little space for the translations.
• Number of Faces - is CamBam vocabulary, but there is no space for the standard translation. A right justify of the text will solve this problem or more place in the user interface.
• If I hit "Cancel" the progress bar should be resetted.

I id the translation of the pdf file, the UI I will translate if a clean translation is possible
Attached you see the problems with the translation.

I try a txt file from the mach3 forum. I get a System.ArgumentOutOfRangeException

System.ArgumentOutOfRangeException: The value 114 is invalid for value. Value should be between 'minimum' and 'maximum'.

But in the text file there is no value 114

ralf
« Last Edit: August 12, 2014, 21:34:27 pm by pixelmaker »

Offline pixelmaker

  • CNC Jedi
  • *****
  • Posts: 1967
    • View Profile
    • pixelmaker
Re: Digitizer Import plugin
« Reply #11 on: August 12, 2014, 22:54:12 pm »
Geoff,
I have the problem that all the stl files comming from the plugin 1.0.2 don´t work in other software.
I get a error: Premature End of file
Also in Cambam I cant open the saved stl files.

A ascii stl file has to start with "solid name" not " with only the path"
It has to end with "endsolid name" and not with "endsolid path"
The decimal point has to be a decimal point.

After change the first line from "Y:\Desktop\points\flower.stl" to "solid flower.stl" and the last line from "endsolid Y:\Desktop\points\flower.stl" to "endsolid flower.stl"
and after changing all comma to points ,
e.g. line 4 from
vertex 1,195005E+002 0,000000E+000 0,000000E+000
to
vertex 1.195005E+002 0.000000E+000 0.000000E+000

the saved stl files are working, in Cambam and in other software

ralf
« Last Edit: August 12, 2014, 22:59:07 pm by pixelmaker »

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8969
    • View Profile
Re: Digitizer Import plugin
« Reply #12 on: August 13, 2014, 00:10:21 am »
 There are the problem that a longer text then the english writes over the value fields. If you make the text right justified it can´t overlap the value fields but expands to the left site. Then every word has the same distance to the value field.
-----------------
Yeahbut!  Ralf, some 'simple' German words are 40 letters! <G>

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline joel.r1

  • Droid
  • **
  • Posts: 69
    • View Profile
Re: Digitizer Import plugin
« Reply #13 on: August 13, 2014, 06:59:42 am »
Hi Goeff,
Would it be possible to add for the Zmin and Zmax the X,Y location like, for example :
  Zmin = -0.27139 @ X= 5.000 and Y= 8.1234
  Zmax = 1.23456 @ X= 8.987 and Y= 2.3456
Not required, but nice to have, as I can get it separately by manually looking into the point file.
The reason is, after scanning a stone, I usually setup the highest point as the Z0 to start engraving my text.
Cheers. Joel

Offline pixelmaker

  • CNC Jedi
  • *****
  • Posts: 1967
    • View Profile
    • pixelmaker
Re: Digitizer Import plugin
« Reply #14 on: August 13, 2014, 09:03:54 am »
Lloyd,
Quote
Yeahbut!  Ralf, some 'simple' German words are 40 letters!
No problem if the translation apply only to the plugin. But Geoff uses the variables from the Cambam translation and I don´t change the cambam translation for a plugin.

But as long as the plugin generates unusable stl objects it is no need to translate it.

ralf