Excel Data to Model
-
aspaddict,
I've been playing with Excel a little, and I think your problem is that the SIN and COS functions expect the angle parameter to be in units of RADIANS. If you haven't already, try these:
=B2*COS(RADIANS(A2))
=B2*SIN(RADIANS(A2))
I'll keep testing in Excel, to see if there might be some other "gotchas" to confound your calculations.Taff
-
Taff, this is epic! You really need a blog page to show off the cool stuff you do with SketchUp, that is totally different to what everyone else does!
Hwyl
[Edit: Actually this reminds me of something I have been thinking about for some time. You are obviously very mathematically-inclined, how difficult would it be to do a similar thing for a rippled surface in SketchUp. Lots of people have trouble with this, and I'm guessing that it's a mathematical function relating to amplitude. Accurender has a nifty function which can add one of 2 types of ripple to surfaces. Water is the main use for this. For rendering it makes a big difference. Is it possible, given a predetermined surface, to plot the mathematical function relating to ripples, and create the geometry to describe these sorts of surfaces? For rendering purposes, it would be really useful.]
-
@bigstick said:
...need a blog page to show off the cool stuff you do with SketchUp, that is totally different to what everyone else does!
Jim,
Hah! History repeats itself. What I'm doing here is actually an 'old school' technique from the introductory IBM-PC days (early 1980s.)
DXF was a ubiquitous file format back then, as it is now. Getting spreadsheet data (anyone remember VisiCalc?) into a CAD program was handled in the manner I used. Conceptually, it's simple, relatively easy to understand, nothing but text, and can be used with many programs (...and I'm getting to be an old dog, comfortable with my old tricks.)
Regarding ripples and waves, even PhotoShop can apply such 'distortions' to an image. The mathematical simulation of waves has been "algorithmized" in many ways, and 3D graphics articles/papers have been published by students/professors in the major graphics journals. These guys know much, MUCH more than do I on the subject. Modification and application into a SketchUp ruby is the missing exercise, but with a bit of homework, shouldn't be too difficult for an experienced ruby 'scripter' (of which, I am not.)
-
aspaddict,
I've a fair amount of experience in scientific/mathematical use of Excel, so producing a DXF file from a spreadsheet isn't too difficult for me. I realize that may not be true for you, so I've attached a ZIP file containing a spreadsheet that demonstrates how it's done.
(Please don't ask about the rather convoluted Excel formulae, 'cause it would require instruction in Excel. I suspect the formulae could be simplified further, as the newest version of Excel is giving me fits!)
The spreadsheet is protected to prevent structural changes, as that would 'break' its functionality. The only cells that can be modified are those that specify the length of the radial distances. The angles, and formulae for the x,y data are locked. They can not be modified unless you unprotect the spreadsheet. The formulae in the column of text for the DXF file are also locked from modification. You can copy and paste the DXF text, after your changes to the length parameters automatically modify the DXF info for you.
The spreadsheet should allow you to do plenty of "what if" adjustments to the length values.
I've also included the resulting DXF file, and a screengrab image of the SketchUp import (depicting 360 line entities.)
Regards,
Taff
-
Taff,
hay thanks for this thread it is just what I was looking for. I an trying your method and an having a problem and I am hoping you can help.when I try to import excel data I get this error in the ruby window.
Error: #<TypeError: nil can't be coerced into Length>
(eval):147:in*' (eval):147:in
import_points_cloud'
(eval):144:ineach' (eval):144:in
import_points_cloud'
(eval):481
(eval):147:in `call'
(eval):147I have tried opening the file in text edit but can see no problem.
here is the CVS file I am trying to use.any suggestions to what I am doing wrong and how I can fix it would be greatly appreciated.
Thank you and keep up the good work
Uberchurch
-
That worked BEAUTIFULLY! The RADIANS function is what I was missing out on...
...and yes, I was one of THOSE kids who said "Meh, I'll never need this later in life..." (Time to call my kids and warn THEM!)
Is there any quick and dirty way to connect all the points, or do I just need to use the line tool to achieve this? I need to connect them, then group them all together...
I think I can handle drawing 360 little lines at this point - the hard part is done - but if there's a smoother way of doing this, I'd prefer to go that route...
Thanks for the help!
-
@aspaddict said:
Is there any quick and dirty way to connect all the points...
Um,
The "Excel&DXF" example files I provided do precisely that. Extract the zip files and see if they do the trick. -
uberchurch,
I downloaded your file, opened it with Wordpad, copied everything to the clipboard, opened Notepad, pasted, and saved the file with a '.csv' extension.
The contents look okay. It may be that the extra carriage-return/line-feed info that Wordpad inserts is causing a problem. (I don't know for certain.) I can tell you that, with your data in an ASCII-text '.csv' file, the "import cloud" plugin worked fine. (See attached.)
-
Taff,
thanks for your help. I think the problem has to have something to do with the fact that I am on a mac because when I open the file that your created (thank you) which we know works I get the same error. But when I open it on a PC it is OK, although only with control points not components which is what I really need. So for now I will just create the point clouds on the PC and then bring it back to the MAC. Thanks again for your help and if you have any idea how I can replace the points with geometry that would be great.
Thanks Again
Uberchurch -
hello everyone,
i need the same tool as describe, but to make another shape:
i must draw line (i have the length),circle arc (i have the rayon and the angle of courbure), and slope (i have the length up or down).
all my data are in an excel
Can i use it automatically to make my way?
thx u 4 adavnce
Advertisement