[Plugin] Cloud

Re: [Plugin] Cloud update

Postby TIG » Sat Nov 27, 2010 2:04 pm

Aerostreak

The links you gave refer to some tweaks I did to v6~.
This thread starts with v71.zip.
Have you downloaded that ??
That was fixed after I spotted a mistake in Didier Bur's coding of v70...
It works fine for me and other users on PC/MAC.
It's under Menu > File > Points Cloud > Import.
BUT the file MUST have 3 or more values per line separated by the specified character - e.g. ','
If you only have two it will return an error.
To add trailing zeros [,0] to the file you need to do some processing in a plain-text editor.
Do NOT use a word-processor - that will add hidden characters in the text and mess up big time.
Not sure what the MAC equivalent app' to Notepad++.exe is, but you need to ensure proper carriage-returns on line ends too - is there an option in the MAC text-editor for this ?
To edit the file in Ruby this one liner should do it - paste into the Ruby Console...
Code: Select all
filei="path_to_file/mypoints2.csv";filei="path_to_file/mypoints3.csv";;file=File.new(fileo, "w");IO.readlines(filei).each{|t|next if t=="\n";file.puts(t.gsub("\n",",0\n"));};file.close;
- edit it to replace path_to_file with the actual path to the folder containing the csv
the ..3.csv version has ,0 appended to each line...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Cloud update

Postby aerostreak » Sat Nov 27, 2010 9:23 pm

TIG,
Thanks very much for your reply. I had previously tried the v71 zip file. At your suggestion, I re-downloaded it anew, placed into my plugins folder, and accessed it from the file menu as you indicated. I also used TextEdit on the Mac to edit the file to have three values per line as you indicate. TextEdit on the Mac usually edits in Rich Text Format (RTF); however, there is an option to switch to Plain Text, which I did before editing. I tried two versions of the file. In one version I had values separated by commas (and used the dialog to tell the script that). In another version, I separated values with semicolons as shown in all of the examples in the v71 folder. Both gave the exact same failure, see screenshot below.

I have also tried saving the CSV file directly from Excel on the Mac. And also from Word on the Mac, where I had Word display only plain text. I also opened the file using two different programming editors on the Mac, NetBeans and Xcode. Both have 'plain text' editors that I use to write software. It doesn't matter what text editor I save the file from, it simply will not work. No matter what I do. I am an aerospace engineer and know my way around a computer, though I am only an amateur programming. Believe me when I say, I would not come to you unless I had exhausted every possible option that I could possibly find or conceive of. No joy. The one thing I have not done is use the Ruby statements you show below. I have no experience with Ruby and don't know how to do that yet, but I will go figure it out next.

In any case, attached are 1) the exact file I am trying to pull in using (now) Cloud v7.1 and 2) the screenshot of the result. This screen shot is taken as follows. I activate the Cloud plugin using File menu item. It brings up a dialog box to select the file, which I do. Then it brings up the dialog box asking for the delimiter. The last line of that dialog box (fourth line) shows the 'line example', and it is highlighted all in blue. I can scroll inside there using the arrow keys, and it appears there is a massive amount of data in there. Clearly, something is not reading the values correctly from the file, as if the program does not know where the end of the line is. When I hit return, I get the screenshot below: a dialog box asking me to pick the meaning for a long list of values. However, the dialog is off the bottom of the screen. I have discovered no way to view the bottom ('amateur Mac user'). I go ahead and hit return anyway, and script loads one point into the Sketchup drawing space. No other points are loaded. (By the way, earlier versions of the script had the option for 'Nothing' in the pick list for the attribute meanings - no longer an option for some reason, although, it currently doesn't matter as I can't see the bottom of the dialog.)

Others have had problems getting the Cloud plugins to work correctly. I have absolutely scoured their threads trying to find out what, exactly, they did to solve their problem and what, exactly, I am doing wrong. If the answer I need is in fact in those threads, I am completely missing it, if you or someone else could point out to me precisely my mistake I would be grateful.

I'm going to try three more things: a) type the file in by hand from scratch one more time into a guaranteed plain-text editor on Mac (probably Xcode) b) type the file in by hand from scratch on WinXP and move the file over to Mac before loading c) delete out the last [,0] on each line and process that [x,y] version with your Ruby script, which appears to look for '\n' explicitly. If you have any ideas at all please let me know, I am willing to try anything at this point (other than relenting to always loading skp files in WinXP and moving them over to Mac then copying into main drawing... ugh).

I'm out of ideas. Please advise. Thank you for your help.
0

aerostreak 
 

Re: [Plugin] Cloud update

Postby TIG » Sat Nov 27, 2010 9:33 pm

I think it's something to do with the way your file has carriage-returns at the ends of lines etc ???
Can you post the actual file you have the big problem with... I'll look at it and re-post a 'fixed' version to see if it's any better...
Then we might be one step nearer a solution... :?:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Cloud update

Postby aerostreak » Sat Nov 27, 2010 9:45 pm

TIG,
Thanks for quick reply. I found the problem, you were exactly right, problem was with Mac linefeeds. I posted the original file above, the link to it is dwarfed by the screenshot.

I found the solution in Xcode. There is an editor option to convert the linefeeds on any file between Unix (LF), Mac (CR), and Win (CF/LF). Saving the file with either Unix or Win worked great - Cloud script worked in Sketchup exactly as advertised. Saving the file with Mac (CR) - failure.

Here is the screenshot of the fix, once I found the menu option I had the whole file loaded into Sketchup in less than 60 seconds.
cloud71_linefeeds.png


Man alive, this trivial problem cost me probably six hours in total and about a week off the end of my life...

Thanks for your patience, I appreciate the help.

p.s. Seems like it might be worthwhile to mod the script to automatically fix this (i.e., to properly handle the Mac CR-only default), or, to provide a separate plugin that can pre-process input files for people before they try to load data with other plugins...
0

aerostreak 
 

Re: [Plugin] Cloud update

Postby TIG » Sat Nov 27, 2010 10:11 pm

Hoo-bloody-ray! :D
Didier - you listening ?
I thought that Ruby's '\n' took any version of carriage-return appropriately ???
Weird.............
At least we have a 'fix'...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Cloud update

Postby Didier Bur » Sun Nov 28, 2010 10:38 am

:oops: :oops: :oops:
Seems that CR in Ruby is "\r" while CRLF is "\n".
I've tweaked the script to check if lines end with CRLF or CR, and here's what I got from the file:
naca36.jpg


See new release at top of this thread.
0
Didier Bur
Ecole Nationale Supérieure d'Architecture de Nancy (F)
User avatar
Didier Bur 
 

Re: [Plugin] Cloud update

Postby aerostreak » Sun Nov 28, 2010 9:26 pm

Cool, thanks Didier. Your image is correct except I delete all the internal edges/faces and use only the outer edge. Next I am trying to learn how to loft multiple edges/curves in Sketchup.

I downloaded your new cloud_v8.rbs and tested it on my iMac. Sorry to be such a pest but unfortunately I believe it is broken. When I run the plugin, it goes immediately to selecting an origin for placing the point cloud, and never gives the dialog box to select the input file, etc. The plugin throws the following error to the Ruby console:

Error: #<TypeError: no implicit conversion from nil to integer>
(eval):252:in `[]'
(eval):252:in `initialize'
(eval):164:in `new'
(eval):164:in `endTool'
(eval):105:in `onLButtonUp'

At first I thought I must have done something wrong, so I quit Sketchup, cleared out all plugins (completely empty plugins folder), downloaded a new copy of cloud_v8.zip, and put cloud_v8.rbs into the (now empty) plugins folder. This way I could guarantee that only Cloud plugin was installed. I started Sketchup again and verified that only Cloud_v8 available (i.e., no Plugins menu, and 'Points Cloud' option available via File menu). Unfortunately same result, plugin appears broken.

I am confident this is not a LF-CR-CR/LF problem as the script is never letting me pick a file. it goes straight to 'pick origin'. Just to be certain, I reverted back to cloud_v71.rbs as the only script in the plugins folder, and it works great on iMac (as long as I pick Unix LF or Win CR/LF as end-of-line, and do not pick Mac CR).

Sorry Didier but can you make another try at cloud_v8.zip? It would be nice to have it so as to avoid converting every file, etc. :) I will be happy to test for you.

Thanks for your support on this, I appreciate it.
0

aerostreak 
 

Re: [Plugin] Cloud update

Postby thomthom » Sun Nov 28, 2010 9:45 pm

Didier Bur wrote::oops: :oops: :oops:
Seems that CR in Ruby is "\r" while CRLF is "\n".

CR = \r
LF = \n
CRLF = \r\n (best compatibility between systems)
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Cloud update

Postby Jim » Sun Nov 28, 2010 9:59 pm

It is common to use .strip! or .chomp! on lines read from file. Either should take care of whitespace chars. This make the strings more consistent and less prone to comparison errors.

chomp will remove trailing whitespace from a String.

strip will remove both leading and trailing whitespace.

whitespace is: spaces, tabs, \n, \r, and \r\n
0
Hi

Jim 
Global Moderator
 

Re: [Plugin] Cloud update

Postby Didier Bur » Mon Nov 29, 2010 9:14 pm

Hi,

Error: #<TypeError: no implicit conversion from nil to integer>

I see. Bug found (although the script works on my machine).

When I run the plugin, it goes immediately to selecting an origin for placing the point cloud

Yes, this is normal. The updated PDF doc says it: "The first thing you'll have to do is click a point to set the points cloud origin". ;)

Download the new version at top of the thread and replace the 'old' RBS file with the one in the archive.

Hope it will work now :?
0
Didier Bur
Ecole Nationale Supérieure d'Architecture de Nancy (F)
User avatar
Didier Bur 
 

Re: [Plugin] Cloud (Updated 29/11/10)

Postby aerostreak » Wed Dec 01, 2010 9:41 am

Didier,
Thanks for the update, it works great. Well, almost. On my setup (Mac OS 10.5.8, Sketchup 8.0.3161) the plugin now handles files correctly with Unix (LF) ending and with Mac (CR) ending... but now it does not correctly handle Win (CR/LF) ending! I feel for you buddy, apparently Ruby is not so easy to coax into the desired behavior.

Here is my report. I downloaded your latest plugin (cloud_v8a) and tested it as the only plugin. I tested Unix (LF) ending first - worked great. Then I tested Mac (CR) ending - worked great. I almost wasn't going to test Win (CR/LF) ending but thought for completeness that I should. So I did that and (if memory serves) it worked great. However, I just happened to click again in the window and the file box came up again. So I thought that the plugin was set up to load another point cloud without having to re-initiate the script (via file menu). So I thought, ok great, I'll do it again. However, the second load of the same file to a different location, and it only loaded one point (first point in the file). It would did not load the rest of the file. So I thought, hmm, maybe I should try this again. I selected another tool and drew a random shape, then re-selected cloud and it failed again to load, only loaded one point. On the plus side: in the past when it loaded only one point (or no points), the dialog box for assigning coordinates to data in the line would always be very long as in my previous post in this thread; however, that dialog is now always working correctly, i.e., the dialog box only has three coordinates even if the cloud does not load properly. Now here is the problem, I have to confess that I was not paying close attention when I tested CR/LF; and I am not certain that the first load worked correctly. I may be confusing that test with another.

So I quit and re-started Sketchup and tested each file ending again. I notice that for Unix and Mac endings, the script always works; however, it will not correctly load the point cloud a second time. In other words, to load multiple point clouds, it is required to select another tool (like the pointer) and restart the script via file menu. So I went and RTFM per your suggestion (lol, point taken) and the manual does not say whether the script should be 'looping' or whether it should end after the loading of the first point cloud that I could find. I've sort-of concluded that the second appearance of the file dialog box, resulting from clicking in the window after loading the first point cloud, is actually a minor defect? In any case it is not critical, it always worked to select another tool (like pointer), restart the script, and load a new point cloud.

So I could always very easily and quickly load multiple point clouds in Mac when the lines are terminated with Unix (LF) or Mac (CR). In that sense it is a great script and will be very useful on Mac now.

However, when continuing on to test Win (CR/LF) line termination on Mac, no joy. On all subsequent tests, I could not get the script to properly load the point cloud. I restarted Sketchup several times and re-verified the line endings via Xcode several times, no joy. It always loaded only the first point. So I am convinced that my memory is flawed, and that the first time I tested Win line ending (described above) I actually was testing Unix or Mac and didn't realize it; thus the first load would work, but not the second (as described). So I believe that Win endings on Mac machines are not working in this latest cloud_v8a version. Now on one of the tests when it loaded only one point, I did happen to select 'triangularize' the point cloud, with the following result:
cloud_mac_crlf.png

which I found a bit odd, since there is only one construction point, but clearly the script thinks there are other points not at the origin, which do not have construction points, and which do not match data in the file (i.e., compare to pictures of correct loadings in your previous post). I don't think this is a major problem since the script isn't loading the data correctly in this case to begin with, however I describe this here in case it provides any additional clues for troubleshooting purposes.

Apologies for yet another long post, I know this must be frustrating. I am trying to describe what is happening in as much detail as possible and as accurately as possible to help you find any problems. If it would help for me to post a video of me doing the testing, please let me know and I will try that also, maybe I am making a mistake somewhere and you will then be able to see it.

Conclusion, the script is working great on Mac now with the one exception, a Mac user attempting to load a point cloud file originating from Win (with CR/LF in it) will not work. Some people may be able to fix it on their own, more inexperienced users may not.

In any case the best option for a Mac user needing to load a point cloud is Cloud_v8a. :sketchstatic:

Thanks for your continued effort, I am using the plugin heavily and appreciate it.
0

aerostreak 
 

Re: [Plugin] Cloud (Updated 29/11/10)

Postby Didier Bur » Wed Dec 01, 2010 8:50 pm

Weird...
So v8b is here.
Hope it will work in all cases now, although v8a was working with CRLF line endings here.
0
Didier Bur
Ecole Nationale Supérieure d'Architecture de Nancy (F)
User avatar
Didier Bur 
 

Re: [Plugin] Cloud (Updated 29/11/10)

Postby Ben Ritter » Wed Dec 01, 2010 10:51 pm

Thx for the update Didier.

Ben
0

Ben Ritter 
 

Re: [Plugin] Cloud (Updated 29/11/10)

Postby aerostreak » Thu Dec 02, 2010 7:57 pm

Success with all line endings!
:sketchstatic:

Thanks Didier!
0

aerostreak 
 

Re: [Plugin] Cloud (Updated 29/11/10)

Postby mozzie » Sun Dec 05, 2010 5:45 am

Encore - merci beaucoup.
0

mozzie 
 

Re: [Plugin] Cloud (Updated 29/11/10)

Postby thomthom » Thu Jul 07, 2011 3:16 pm

Why so many versions? There are four threads for Cloud - and even this one got multiple downloads. Hard to find the "correct" one. At least the old redundant versions should be removed and untagged so they don't appear in the Plugin Index.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Cloud (Updated 29/11/10)

Postby bmeg » Sun Nov 20, 2011 2:29 pm

Didier Bur,

I'm a new and relatively inexperienced user of SU, my introduction is in the newbie forum.

First of all. I Just tried your cloud tools and it's really good. Thank you for sharing.

I'd like to pick your brains a little, do you know of any other point cloud tools or tools for manipulating the meshes created from point clouds. I would be particularly interested in a tool which could produce a best fit surface from
a number of selected meshes and perhaps report on the fit residuals i.e difference between the best fit surface and the
individual points.It would be particularly good if the tool enable a best fit planar surface, dome, pyramid etc.


Thank you in advance


Brian.

Here is an updated version of my cloud script:
- Imports and exports (new!) DEM points cloud, several CSV formats supported.
- All units (import/export) supported.
- Saves id's, altitudes, or any other field as attributes or insert them as texts (new!).
- Manage layers, triangulation option.
- Doc, sample files and tutorial included.

Also downloadable at my RLDsite: http://rhin.crai.archi.fr/RubyLibraryDepot/plugin_details.php?id=678

Enjoy,

EDIT: 23.06.10: (Cloud_v71) units bug fix, especially for users of SU 7.1
Cloud_v71.zip

EDIT: 28.11.10: (Cloud_v8) support for CR/CRLF text files, cloud origin selectable.
Cloud_v8.zip

EDIT 29.11.10 Bug fix.
Cloud_v8a.zip

EDIT 01.12.10
Cloud_v8b.zip
0

bmeg 
 

Re: [Plugin] Cloud (Updated 29/11/10)

Postby Didier Bur » Tue Nov 22, 2011 12:57 pm

Hi,
I'm not aware of a free plugin that do these kinds of thing, but here is a (payware) interesting plugin:
http://scanable.org/software/modeling/pointools-introduces-point-cloud-plug-in-for-google-sketchup/
Rather expensive :(
0
Didier Bur
Ecole Nationale Supérieure d'Architecture de Nancy (F)
User avatar
Didier Bur 
 

Re: [Plugin] Cloud (Updated 29/11/10)

Postby qconsult » Tue Sep 17, 2013 1:48 pm

Dear Sir,

Please advise on possible work-flow concerning storing the "ID" tag from CSV as a component attribute.

Any/all advice will be appreciated.

Kind regards,

Q
0

qconsult 
 

Re: [Plugin] Cloud (Updated 29/11/10)

Postby jaspergardner » Wed Nov 06, 2013 3:21 am

I am having problems trying to install Cloud_v8b on my mac, does this version work for mac?
0

jaspergardner 
 

Re: [Plugin] Cloud (Updated 29/11/10)

Postby Didier Bur » Wed Nov 06, 2013 10:23 am

Hi,
What kind of problem to install ? Please describe it more precisely so I can help.
0
Didier Bur
Ecole Nationale Supérieure d'Architecture de Nancy (F)
User avatar
Didier Bur 
 

Re: [Plugin] Cloud (Updated 29/11/10)

Postby George » Mon Mar 31, 2014 2:32 pm

Hello Didier,

It seems Cloud and SU 2014 are not getting along.

When I open SketchUp 2014, cloud_v8b.rbs throws a Load Error.
Fixable?

Error: #<SyntaxError: c:/users/george/appdata/roaming/sketchup/sketchup 2014/sketchup/plugins/cloud_v8b.rbs:347: Invalid break>
c:/users/george/appdata/roaming/sketchup/sketchup 2014/sketchup/plugins/cloud_v8b.rbs


Dell Precision T3400
MS Windows 8.1 32-bit
Intel Core 2 Quad Q9650 @ 3.00GHz
4GB RAM
NVIDIA Quadro FX 1800 768GB
1
"Everyone is entitled to his own opinions, but not to his own facts." ~Patrick Moynihan
User avatar
George 
 

Re: [Plugin] Cloud (Updated 29/11/10)

Postby TIG » Mon Mar 31, 2014 3:34 pm

For v2014 compatibility I suspect that it's something simple that Didier needs to fix is his RB version and recompile into the RBS...
Unfortunately, because it encrypted only Didier knows what is going on inside the code...

I suggest you PM him - he needs nagging to get several of his plugins updated to be v2014 compatible.
Where he has supplied a 'packed' RB file I have offered a temporary fix using the final .to_s -> [0] - which several users are successfully using, BUT unfortunately for his RBS versions that's NOT possible :roll:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Cloud (Updated 29/11/10)

Postby ninomayda » Wed May 07, 2014 1:25 pm

Having trouble installing on SU-2014. Am I missing something? Alternatives available?

Regards
Nino
0
User avatar
ninomayda 
 

Re: [Plugin] Cloud (Updated 29/11/10)

Postby TIG » Wed May 07, 2014 3:23 pm

My post [just before yours] already 'explains' this viewtopic.php?p=518532#p518532
There are several tools that do some of these things...
What do you want to do, exactly?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Cloud (Updated 29/11/10) - Cloud_v8b.rbs

Postby michelmtl » Wed Jun 18, 2014 5:31 pm

Hi Didier,
I got a problem just trying to load this plugin on SU14, win 8.1

Error: #<SyntaxError: c:/users/appdata/roaming/sketchup/sketchup 2014/sketchup/plugins/cloud_v8b.rbs:347: Invalid break>
c:/users/appdata/roaming/sketchup/sketchup 2014/sketchup/plugins/cloud_v8b.rbs

Any ideas?
0

michelmtl 
 

Re: [Plugin] Cloud (Updated 29/11/10) - Cloud_v8b.rbs

Postby TIG » Thu Jun 19, 2014 9:22 am

michelmtl wrote:Hi Didier,
I got a problem just trying to load this plugin on SU14, win 8.1

Error: #<SyntaxError: c:/users/appdata/roaming/sketchup/sketchup 2014/sketchup/plugins/cloud_v8b.rbs:347: Invalid break>
c:/users/appdata/roaming/sketchup/sketchup 2014/sketchup/plugins/cloud_v8b.rbs

Any ideas?
If you read the few previous posts you'd see that it's incompatible with v2014.
It's probably an easy fix BUT Didier ought to do it :roll:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Cloud (Updated 29/11/10) - Cloud_v8b.rbs

Postby George » Sun Nov 02, 2014 8:40 pm

TIG wrote:...it's incompatible with v2014.
It's probably an easy fix BUT Didier ought to do it :roll:



Sadly it seems Didier hasn't the time to do it.
Might he consider handing the task to a trusted fellow developer?
It's a shame to lose such a useful tool for even a short time; more so when left to languish for months.
0
"Everyone is entitled to his own opinions, but not to his own facts." ~Patrick Moynihan
User avatar
George 
 

Re: [Plugin] Cloud

Postby TIG » Tue Nov 04, 2014 1:35 pm

Didier is too busy, but he has given me permission to update his script for him.
That new version 'v8.0bx' is available in the PluginStore.

Download


It is now compatible with v2014...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Cloud

Postby sherwood111 » Sun Jan 04, 2015 4:10 am

very useful, thank you very much !

v8 works for me with SU8 pro x32, windows 8.1

v8b does not appear to work with SU 2015 x64, windows 8.1
vertical (z axis) data appears to be ignored
all points are on a flat horizontal plane
X Y positions/locations render correctly
same .csv data file imports into both SU8pro (v8) and SU2015 (v8b)

I don't know if it matters . . .
I notice extra characters in v8b 'points cloud options' input dialog window
the extra characters "] do not appear in v8 SU8pro

I'm unable to tinker with the .rbs file
0

sherwood111 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

PreviousNext


 

Return to Plugins

Who is online

Users browsing this forum: nabilmelika, rv1974 and 13 guests

Visit our sponsors: