Author Topic: Archeoastronomy and Sketchup  (Read 12117 times)

construsol

  • New Member
  • *
  • Posts: 20
    • View Profile
Archeoastronomy and Sketchup
« on: April 17, 2010, 12:59:38 PM »
Hi. Just seen the Sun Position Plugin and its great!

I'm really thrilled to know this Plug has been done, because in some way tells me that a similar one I wished to develop can be done. In order for this plug to work, some elementary notions about Alt. and Az. coordinates are needed, and as I can see in the sun position plugin they are understanded very well. The thing is that I'm not a programmer or know Ruby for SketchUp. So, please read this and let me know if anyone can help. I want to know if a plugin can be done that can be called something like "Align Z axiz of Plane to Vector". In such script, trough Azimuth and Altitude coordinates a vector would be drawn starting at 0,0,0, and then a Z axis of a plane would move to be parallel to that vector. This would be very similar to Azimuth and Altitude coordinates needed for a vector to start at 0,0,0 and point to the Sun, but instead, the coordinates would be to point at certain celestial bodies. No need to represent the star or planet, just a vector that points to it, then, select a plane and make its Z axis parallel to that vector so that the plane faces directly to the star or planet.
Besides using SU a lot as an architect, I do research in the Archeoastronomy field, and this plugin would be just fantastic. Can this be done? Thanks in advance for any help. Regards.


construsol

  • New Member
  • *
  • Posts: 20
    • View Profile
Re: Archeoastronomy and Sketchup
« Reply #1 on: April 17, 2010, 02:08:51 PM »


Just as background information, nothing more, my plugin request in the above mail is a much simpler request of a previous one I did. Here is the link:

http://forums.sketchucation.com/viewtopic.php?f=180&t=27480#p238008

I'm putting it here to share trough images some projects I have done, like the human solar clock, among others. As you will see in the link, the plugin began as a much complex request but according to users answers in the forum it changed to something simpler. Hope someone like the projects. Regards.

Hi. Just seen the Sun Position Plugin and its great!

I'm really thrilled to know this Plug has been done, because in some way tells me that a similar one I wished to develop can be done. In order for this plug to work, some elementary notions about Alt. and Az. coordinates are needed, and as I can see in the sun position plugin they are understanded very well. The thing is that I'm not a programmer or know Ruby for SketchUp. So, please read this and let me know if anyone can help. I want to know if a plugin can be done that can be called something like "Align Z axiz of Plane to Vector". In such script, trough Azimuth and Altitude coordinates a vector would be drawn starting at 0,0,0, and then a Z axis of a plane would move to be parallel to that vector. This would be very similar to Azimuth and Altitude coordinates needed for a vector to start at 0,0,0 and point to the Sun, but instead, the coordinates would be to point at certain celestial bodies. No need to represent the star or planet, just a vector that points to it, then, select a plane and make its Z axis parallel to that vector so that the plane faces directly to the star or planet.
Besides using SU a lot as an architect, I do research in the Archeoastronomy field, and this plugin would be just fantastic. Can this be done? Thanks in advance for any help. Regards.



Jon

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
    • YouTube
Re: Archeoastronomy and Sketchup
« Reply #2 on: April 22, 2010, 09:37:20 PM »

As a novice on these topics I have just a bit of input about the above discussion and similar about it.  It would be nice to build a machine that can automatically point in the sky at a certain "direction".  I think there are computer programs that you can buy or something that shows star positions as they were in the past and it's positions and current position.  Maby some kind of simple machine out of wood can have the angles (horizontal and vertical above the horizon....however I think these actually change every minute as the Earth rotates, except the North Pole Star.   I guess, still a motorized machine would be needed if you wanted to "track" a certain star.  With a simple wooden system, or other material, you can attach the angles, and a pointer / sight that would indicate where in the sky you are referencing with those coordinates.   More ideas, but complete novice/amateur when it comes to astronomy.

construsol

  • New Member
  • *
  • Posts: 20
    • View Profile
Re: Archeoastronomy and Sketchup
« Reply #3 on: May 02, 2010, 01:27:33 PM »
Hi Jon, thanks for your output.

As a matter of fact, stars are in constant movement, so I'm interested in pointing at their position of a certain date and time. I can have their azimuth and altitud with free astronomy software. It would be a blast if this software could run inside sketchup so it could be asked for the coordinates of a certain star (or planet) for a certain date and time (I think is a mater of triginomtry programing). For now, I could be happy for a plugin that just asks for azimuth and altitude that has been calculated elsewhere. Regards.


As a novice on these topics I have just a bit of input about the above discussion and similar about it.  It would be nice to build a machine that can automatically point in the sky at a certain "direction".  I think there are computer programs that you can buy or something that shows star positions as they were in the past and it's positions and current position.  Maby some kind of simple machine out of wood can have the angles (horizontal and vertical above the horizon....however I think these actually change every minute as the Earth rotates, except the North Pole Star.   I guess, still a motorized machine would be needed if you wanted to "track" a certain star.  With a simple wooden system, or other material, you can attach the angles, and a pointer / sight that would indicate where in the sky you are referencing with those coordinates.   More ideas, but complete novice/amateur when it comes to astronomy.

Gabriel

  • Administrator
  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Archeoastronomy and Sketchup
« Reply #4 on: May 02, 2010, 01:48:31 PM »
Hello construsol,

Just like to say that I haven't forgotten about the plugin you wanted. It's been a hectic couple of weeks and haven't had much time to work on it. This week is finals week though, so I should have some free time to work on it at the end of this week.

Take Care
Gabriel


construsol

  • New Member
  • *
  • Posts: 20
    • View Profile
Re: Archeoastronomy and Sketchup
« Reply #5 on: May 02, 2010, 07:58:11 PM »

Gabriel, thank you for your help, will be looking forward for your help. I have been reading about ruby like crazy, so maybe if you can come with a script I will understand it. As a mater of fact, did you notice this new book?:

http://autosketchup.com/

It's a book exclusively about modeling in Sketchup with Ruby. You can download the first three chapters and is helping me to understand this language. Regards.
 
Hello construsol,

Just like to say that I haven't forgotten about the plugin you wanted. It's been a hectic couple of weeks and haven't had much time to work on it. This week is finals week though, so I should have some free time to work on it at the end of this week.

Take Care
Gabriel

Gabriel

  • Administrator
  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Archeoastronomy and Sketchup
« Reply #6 on: May 05, 2010, 01:39:29 PM »
No I hadn't seen that book before. It looks like something that I might be able to use too. The chapter on Actions and Animations looks especially interesting.

If you're learning Ruby, the tutorials on this page are a good place to start. http://pine.fm/LearnToProgram/
It's where I first began.

It's not easy to learn, but I think computer programming is one of the most useful skills a person can have.

Good Luck!

construsol

  • New Member
  • *
  • Posts: 20
    • View Profile
Re: Archeoastronomy and Sketchup
« Reply #7 on: May 05, 2010, 04:08:26 PM »
Gabriel:

That page is exactly the one that I'm learning from! I made my first rb file two days ago. The webpage makes an effort to make things as clear as possible. I finished last night a summary of the concepts in that page, the one's of the three downlodable chapters of the Automatic Sketchup book, and now going to the Sketchup Ruby API site. This next step looks like a very steep learning curve for me. So, besides I'm really making an effort to learn at programming I still hope you can help with the plugin. Regards.

No I hadn't seen that book before. It looks like something that I might be able to use too. The chapter on Actions and Animations looks especially interesting.

If you're learning Ruby, the tutorials on this page are a good place to start. http://pine.fm/LearnToProgram/
It's where I first began.

It's not easy to learn, but I think computer programming is one of the most useful skills a person can have.

Good Luck!

Gabriel

  • Administrator
  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Archeoastronomy and Sketchup
« Reply #8 on: May 07, 2010, 02:34:40 PM »
Update:

I've made some progress with the plugin today. It's still not finished, but I've gotten a good start on it. I still have to figure out how to make a face which is pointing in an arbitrary direction rotate to a specific altitude and azimuth. At the moment it has me confused, so I'm taking a break from it for the rest of the day. After a good nights sleep I usually wake up knowing how to solve the problem, so maybe I'll be able to finish it in the morning. We'll see though.  :)

construsol

  • New Member
  • *
  • Posts: 20
    • View Profile
Re: Archeoastronomy and Sketchup
« Reply #9 on: May 08, 2010, 08:18:22 AM »
Hi Gabriel.

I don't know if this is of any help, but is it useful if you make a vector in the 0,0,0 origin as a reference? And then make the Zaxis of the selected plane ?imitate? the orientation of the vector? Being in the origin, shouldn?t be easier to rotate it to a specific azimuth and altitude vector and just pass that orientation to a selected plane? Just some thoughts.


Update:

I've made some progress with the plugin today. It's still not finished, but I've gotten a good start on it. I still have to figure out how to make a face which is pointing in an arbitrary direction rotate to a specific altitude and azimuth. At the moment it has me confused, so I'm taking a break from it for the rest of the day. After a good nights sleep I usually wake up knowing how to solve the problem, so maybe I'll be able to finish it in the morning. We'll see though.  :)

Gabriel

  • Administrator
  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Archeoastronomy and Sketchup
« Reply #10 on: May 08, 2010, 10:18:00 AM »
I think I have it worked out now. The plugin is attached to this post for you to download.

A few notes:

It will only let you select one face at a time because Sketchup would quickly crash if you were to accidentally select a model with too faces.

You can see in the pictures that you can rotate a face to the specified altitude and azimuth regardless of whether it is connected to other faces or not.

Also, the dashed green line(South) is where the azimuth = 0.

Hope it helps!
Gabriel
« Last Edit: May 08, 2010, 10:22:14 AM by Gabriel »

construsol

  • New Member
  • *
  • Posts: 20
    • View Profile
Re: Archeoastronomy and Sketchup
« Reply #11 on: May 08, 2010, 12:32:59 PM »
Hi Gabriel.

Thanks for the script.

I have installed it but I must doing something wrong becaus cant get it to work. I'm reading in the script that "require "sketchup.rb", and it seems that this file is not included in the Plugins folder. I'm going to find this file somewhere.

What happens once installed is that I input the angles and select the plane and it does not rotate. Then I first select the plane and the input the angles and click OK and still nothing. I'm using Free version of SketchUp 7. Regards and thanks for any help.

Gabriel

  • Administrator
  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Archeoastronomy and Sketchup
« Reply #12 on: May 08, 2010, 03:33:02 PM »
Try replacing the above plugin with the one attached to this post. It has the same name, but I removed the line of code which looks for Sketchup.rb, which I don't think is really needed for this plugin. If it doesn't work let me know, and I'll try to fix it.

I know that there are some plugins that require the Sketchup.rb script, and I thought that it was supposed to be already installed when Sketchup is installed.

I wonder if the Sketchup.rb script has become obsolete now since the newest version of Sketchup.

To clarify, you need to select the plane first before running the plugin.

Sorry for the trouble. This is usually how it is though isn't it. Nothing ever works on the first try.  :)

construsol

  • New Member
  • *
  • Posts: 20
    • View Profile
Re: Archeoastronomy and Sketchup
« Reply #13 on: May 08, 2010, 04:52:41 PM »
Hi Gabriel.

Still nothing. Does this means something to you?:

When I download the new rb file, the previous file can bee seen with a little yellow lock. Then if I search for the file trough the windows file browser, all the files that appear with a lock in the download window do not appear in the windows file browser. Even if I make a *.rb file search to all my hard drive the files with a yellow lock are not found. Still, SU loads the rb file. I'm using Windows 7. Please look at attached image.
« Last Edit: May 08, 2010, 04:57:03 PM by construsol »

Gabriel

  • Administrator
  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Archeoastronomy and Sketchup
« Reply #14 on: May 08, 2010, 06:37:08 PM »
I have had a similar type of problem using Vista. For me though, I would somehow have two identical files in the same folder and one of them was invisible. Obviously, this caused a great deal of confusion. I would place an updated plugin in Sketchup's plugin folder, but nothing would change. The new plugin still behaved like the old one. It took me awhile to figure out that the old one wasn't written over when the new plugin was placed in the folder.

I managed to work around the problem, but it is kind of complicated to explain how I did it.

I've been researching the problem on the web to try and find a better solution than my own. Someone said that disabling the User Account Control in Windows might help. Here a link which will show you how to do it in both Vista and Windows 7. http://www.howtogeek.com/howto/windows-vista/disable-user-account-control-uac-the-easy-way-on-windows-vista/

If it fixes the problem with two identical files in the same folder, let me know so I can tell anyone else who might have the same problem what to do.



I also attached a plugin to this post. It's almost identical to the others except it has a slightly different name. Sketchup should see it as an entirely different plugin, but the plugin itself will still do the same thing as the previous versions. This will be useful if you still can't find a way to delete the first plugin.



If it still doesn't work the way it's supposed to, then I'm not sure what the problem is. I can't think of anything that might be wrong with the code. If we can't figure out what's wrong, I'll have to ask if anybody over at the SketchUcation Forum knows what to do.