sketchucation logo sketchucation
    • Login
    1. Home
    2. bomastudio
    3. Posts
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 29
    • Posts 109
    • Groups 2

    Posts

    Recent Best Controversial
    • RE: Sorting algorithm

      The file is a *.dxf one, so extracting datas gives me an array like the following:

      
      % assuming a 2D drawing, so only x- and y- coords...
      %
      % drawing a triangle (with edges not well sorted)
      % first line from (0,0) to (3,0)
      % second line from (0,4) to (0,0)
      % third line from (3,0) to (0,4)
      
      lines=[0,0,3,0,0,4,0,0,3,0,0,4]
      
      % the array lines, of course, will have lots of couples of vertex (a line goes from a point (x1,y1) to the second (x2,y2) )
      %
      % Moreover I can't be sure if between these vertex could be other vertex that belongs other polygon..
      
      % I need to understand which of these vertex build a polygon, so I need to understand which lines form a continuous loop, a path....
      
      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Custom importer preview?

      @dan rathbun said:

      @voltaicsca said:

      If so, how does one access this functionality?

      This is an operating system feature.

      Previews will display if a thumbnail image has been saved INSIDE the file. (Which SketchUp can do with models.)

      But this works only if a picture is available.... so thinking about SU only if I'm writing an exporter (in the case I've got the SU model and its thumbnail). But what about the opposite situation (an importer, say a DWG/DXF/OBJ etc)?

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Custom importer preview?

      the task is no simple.
      What type of drawing you have? 2D or 3D? raster or vectorial?
      BTW you can not use the SU file selector, but a webdialog or other GUI interface.... you need a CANVAS to draw on.

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • Sorting algorithm

      Hi guys! I need some help, not directly on SU. I'm am able to read a *.dxf file, looking for lines entities. I want to find lines that belongs to a closed loop but I can't be sure that vertex are sorted as I expect. Have you some suggestion? ❓

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Nested groups

      😍 😍 THANXXXXXXXXX!!!! it works!!!!!!

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Nested groups

      @tig said:

      As Dan says... an empty group won't last for long.
      Add something like this:
      @sublevel1.entities.add_cpoint(ORIGIN)
      immediately after making the group [you need to do it for every 'empty' nested group]...
      You won't need to do it where you add a group into a group etc, as then that means the container-group is no longer empty as it contains a nested group!
      Then to tidy up later, after there is some geometry inside the group, use something like:
      group.entities.erase_entities(group.entities.grep(Sketchup::ConstructionPoint))
      to delete the cpoint [substitute the 'reference' needed, where I have used 'group']

      Thanks TIG!! Now all the world is clear as a sunny day!!! β˜€
      I'm going to correct my code..... πŸ‘

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Nested groups

      @dan rathbun said:

      As soon as you make an empty group.. you must ADD something to it in the next statement or two.
      A cpoint is often used.

      If you don't,.. SketchUp will delete the empty group automatically.

      Thank you Dan!!! πŸ˜„

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • Nested groups

      Hi all, I need some help in understanding nested groups.I have to build something like as follows:

      LEVEL_0 (a group)
      |_____ OBJECTS_TYPE_1 (a group)
      |_________ OBJ_1a (a group)
      |_________ OBJ_2a (a group)
      |_________ ...
      |_________ OBJ_na (a group)
      |_____ OBJECTS_TYPE_2 (a group)
      |_________ OBJ_1b (a group)
      |_________ OBJ_2b (a group)
      |_________ ...
      |_________ OBJ_mb (a group)

      So I used:

      
      @level[0] = SkecthUp.active_model.active_entities.add_group()
      @level[0].name="LEVEL_0"
      
      @sublevel1 = @level[0].entities.add_group
      @sublevel1.name = "OBJECTS_TYPE_1"
      
      @sublevel2 = @level[0].entities.add_group
      @sublevel2.name = "OBJECTS_TYPE_2"
      
      
      
      # loop code for geometry generation
      i=0
      n=5
      
      @type1=[] # I waant to store OBJECTS_TYPE_1 into an array for further processing
      @type2=[] # same ...
      n1=0 # incremental number of OBJECTS_TYPE_1
      n2=0 # incremental number of OBJECTS_TYPE_2
      
      while i < n
          pts << [xj,yj,zj]  # xj, yj, zy getted from other part of my script
          if (layer=="TYPE_1")
              @OBJ_1a = @sublevel1.entities.add_group
              ent1=@OBJ_1a.entities
              @type1[n1] = ent1.add_face(pts)
              @type1[n1].pushpull(hpil,false)
              if n1<9
      		@OBJ_1a.name= "OBJ_0" + (n1+1).to_s + "a"
      	else
      		@OBJ_1a.name= "OBJ_" + (n1+1).to_s + "a"
      	end
      	n1 += 1
          elsif (layer=="TYPE_2")
              @OBJ_2a = @sublevel2.entities.add_group
              ent2=@OBJ_2a.entities
              @type2[n2] = ent2.add_face(pts)
              @type2[n2].pushpull(hpil,false)
              if n2<9
      		@OBJ_2a.name= "OBJ_0" + (n1+1).to_s + "b"
      	else
      		@OBJ_2a.name= "OBJ_" + (n1+1).to_s + "b"
      	end
      	n2 += 1
          end
      end
      
      
      

      Running my code I get an error

      Error: #<TypeError: reference to deleted Group>

      The error is on line

       @OBJ_1a = @sublevel1.entities.add_group 
      

      of the code above. What is wrong?

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: [Plugin] OBJexporter v3.0 20130131

      TIG, you are definitively the best source of info about SU!!!! thanx, how would I do without you? πŸ˜„ πŸ˜„

      posted in Plugins
      bomastudioB
      bomastudio
    • RE: [Plugin] OBJexporter v3.0 20130131

      Well I need to bypass the Octane exporter (as I use Ubuntu/Lubuntu+wine+SkecthUp) and the webdialogs doesn't work no more (with SU6 webdialog worked....). So exporting in OBJ format I can solve model+texture troubles, but I need to export also the scenes (cameras).

      posted in Plugins
      bomastudioB
      bomastudio
    • RE: [Plugin] OBJexporter v3.0 20130131

      TIG: thank you for all the plugin you share with all of us!!!! 😍

      A question: this plugin (well, OBJ format) can export cameras positions?
      Thanx.

      posted in Plugins
      bomastudioB
      bomastudio
    • RE: GMSH exporter

      Ok. Now I'm working with the mesh. But the problem of the ordering, as GMSH needs, the edges of the mesh is still pending..... can you suggest how to solve? 😳 😳

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: GMSH exporter

      Hi Dan, thank you for all the suggestion!!! πŸ˜„ Very, very usefull!! I'll made all the corrections as soon as possibile.
      What about the loop? Any solution? πŸ˜„

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • GMSH exporter

      Hi all, I'm writing a SketchUp to GMSH exporter. GMSH, if someone doesn't know what is, is an open source Finite Element Mesh generator http://geuz.org/gmsh/. I would like to "embed" GMSH inside SU (opaque to the user, of course) and draw/mesh/visualize the model all inside SU.In order to do this I wnat to use the *.geo file format. So now the task is to "convert" the SU geometry in the *.geo format. I'm able to export vertex, edges, but not the faces one as GMSH has a "strange" way of defining these:

      1. define a lineloop
      2. define a face for each lineloop.

      But the lineloop has to be defined in such way:

      Line Loop ( expression ) = { expression-list };
          Creates an oriented line loop. The expression inside the parentheses is the line loop's identification number; 
      the expression-list on the right hand side should contain the identification numbers of all the elementary lines that constitute the line loop. 
      A line loop must be a closed loop, and the elementary lines should be ordered and oriented (using negative identification numbers to specify reverse orientation). 
      If the orientation is correct, but the ordering is wrong, Gmsh will actually reorder the list internally to create a consistent loop.
       Although Gmsh supports it, it is not recommended to specify multiple line loops (or subloops) in a single Line Loop command. 
      (Line loops are used to create surfaces; see Surfaces.) 
      

      I've attached the plugin if someone wants to read it. Thank to all can help!


      su2gmsh.rb

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: [Plugin] Finite Element Analysis (FEA) - Spring-mass model

      Update: I found (thanks to Google!!) this project

      Link Preview Image
      Frame3DD - Static and Dynamic Structural Analysis of 2D and 3D Frames

      Free software for static and dynamic analysis of 3D moment-resisting elastic frames and trusses. Written in ANSI C. Source code includes: frame analysis with elastic and geometric stiffness, LDL' decomposition, LU decomposition, Newton-Raphson iteration, sub-space iteration, Stodola iteration, static condensation, Guyan reduction, dynamic condensation, Matlab support and spreadsheet support. Graphical output and mode shape animation via Gnuplot.

      favicon

      (frame3dd.sourceforge.net)

      released under GPL for Linux (wow!!!), Mac and Windows.
      It seems very good...... now I'm asking to the author if Frame3DD supports rigid link to model unaligned elements (colums and beams as in the following image

      https://dl.dropbox.com/u/18236667/Schermata del 2012-07-02 10%3A31%3A55.png

      https://dl.dropbox.com/u/18236667/rigid_offsets.gif

      posted in Plugins
      bomastudioB
      bomastudio
    • RE: Webdialog: set_url and write html in a file? how?

      I've just used the wget.exe tool. And it works!! But I had some trouble with the system command.... πŸ˜•

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Webdialog: set_url and write html in a file? how?

      @brett mcallister said:

      Add this piece of javascript to your html
      Should trigger when the dialog is fully loaded

      window.onload = function() { 
      > window.location.href ='skp;start@';
      > }
      

      Please excuse me as I'm not precise in my posts..... 😳 😳 I have to use a web service: I must use a URL and the server send me a xml file (I used my btrrowser so I don't recognize that the web page was, in reality, a XML code..... forgive me..... 🀣 🀣

      So now the question is: do you think is better to download that file in anyway or to process it in a webdialog (like I was trying....)?

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Webdialog: set_url and write html in a file? how?

      (Re)looking in the documentation of SU API I found theget_element_value method, used to get a value, with a given element_id, from the web dialog's DOM. So I think I can access to the html of the page......

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Webdialog: set_url and write html in a file? how?

      any ideas?
      maybe javascript can help me?

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • Webdialog: set_url and write html in a file? how?

      Hi all, I', not able to write the html loaded in a webdialog after I set its url:
      dlg = UI::WebDialog.new("mionome", false, "altro")
      url = "http://www.miosito.com"
      dlg.set_url(url)

      now I want to copy the html of the dlg in a file.txt without show the dialog??

      any help??

      Thanx!!

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 4 / 6