• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

Sketchup ruby geometry parsing

Scheduled Pinned Locked Moved Developers' Forum
3 Posts 2 Posters 882 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    calmze
    last edited by 9 Jun 2008, 20:09

    Hi,

    I'm working a project where I would like to get ruby drawing info using the Sketchup API and then translate that into a more reasonable data format (basically ADTs). So I would ideally have info about each major object (vaguely defined) such as a wall, a window, a ceiling, etc and where each component belongs and what is adjacent to each component. Then I would like to export this data to Java and optimize the amount of daylight in the room by moving the windows around. Then write the results back to sketchup to make a new drawing.

    Has anyone done anything like this before? It seems like a lot of work to build the data structures, but I can do something like

    for ent in Sketchup.active_model.active_entities and then check
    ent.is_a? Face (then check if it's opaque or not to see if it's a window)

    to build the data structures and the relationships between them.

    How should I go about exporting the data I gather? I could write it to a text file and then read the text file into Java. Or I could put it into a database. I haven't done any database programming, but ruby has a lot of database libraries.

    Any suggestions?

    Thanks.

    1 Reply Last reply Reply Quote 0
    • C Offline
      calmze
      last edited by 9 Jun 2008, 23:49

      This is for a research project that I'm doing for school for the summer.

      1 Reply Last reply Reply Quote 0
      • D Offline
        dkendig
        last edited by 1 Jul 2008, 17:17

        We've had a hard time with scene parsing too. It seems that SU just doesn't know what it has in the scene very well. We've contacted Google and are still waiting for some sort of a response. I'm not all that familiar with the exact details behind our scene parsing process. Some of it is done in C++, the rest in Ruby. If you download the demo of V-Ray for SketchUp, there should be a file that it installs named "VRayForSketchUp.rb" that at least appears to have a good bit of scene parsing stuff in there. I hope it helps.

        Below is our cry for help to Google ::weeps:: no love.
        http://groups.google.com/group/Ruby-API/browse_thread/thread/1c69cc4490e0f6d/e63df2c6561af900#e63df2c6561af900

        Devin Kendig
        Developer

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement