Ruby translator example
-
Newbie here! I've been using SketchUp for about two months now and wouldn't pick up AutoCAD, Catia, Patran, and Unigraphics again even if I could throw away that kind of cash. I have just started delving into Ruby. I’ve added several scripts including SU2Pov so I can render my projects and have also walked through the Box.rb example.
I would like to create a translator in Ruby to output to a Finite Element Analysis program… and possibly suck back in the data to display deflections and stresses. Basically, I would need to get to the geometry, materials and such… pretty much what SU2Pov.rb does. Unfortunately, SU2Pov seems to be encrypted.
Can anyone suggest a publically available script translating to anything. If there are multiple ones out there, maybe you could suggest one for its verbose comments… helping me to learn Ruby while I’m modifying it for my task.Thanks for your help.
-
I use Kerkythea, which happens to have a nice exporter (SU2KT). You can install the exporter (without needing Kerkythea) and then look at the code. Basically, it looks at all entities in your Sketchup model and exports them as an XML file.
One challenge I see is that Sketchup entities are edges and faces. I would assume that you need volumes to perform the FE analysis.
Once you are done with your analysis, to put elements back into SU, you might be able to use something like the Cloud V6 plugin, which represents data as x,y,z points.
There is also an STL format but I am less familiar with it.
Juan
Advertisement