⚠️ Update | Sketchucation Tools 5.0.8 released with licensing improvements and bugfixes Download

Subcategories

  • No decscription available

    20 Topics
    462 Posts
    HornOxxH
    @pilou said: More appetizing in chocolate! Eggs are good as well - but only very fragile when falling down in SketchyPhysics
  • [C\C++] SketchUp window handle

    12
    0 Votes
    12 Posts
    1k Views
    thomthomT
    Here's a way that doesn't iterate every windows there is. It enumerates the windows of the calling thread. Cuts down the searching and ensure that you don't get the wrong window. win32_sketchup_window.rb
  • Colors and values

    10
    0 Votes
    10 Posts
    818 Views
    thomthomT
    @chris fullmer said: Thom gave a great example with some if loops I think that let you blend the entire rainbow smoothly from red to pink to purple to blue to cyan to green to yellow then orange and back to red. I'd have to search a ways back to think where that was posted though. I couldn't find the example I posted earlier either, so here it is again: <span class="syntaxdefault"><br /></span><span class="syntaxcomment"># Soft Selection Colour Map<br /># Colours to translate to. First is max, last is bottom.<br /></span><span class="syntaxkeyword">@</span><span class="syntaxdefault">clr </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">[]<br />@</span><span class="syntaxdefault">clr </span><span class="syntaxkeyword"><<</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Color</span><span class="syntaxkeyword">.new(</span><span class="syntaxdefault">255</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">  0</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">  0</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxcomment"># 100%<br /></span><span class="syntaxkeyword">@</span><span class="syntaxdefault">clr </span><span class="syntaxkeyword"><<</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Color</span><span class="syntaxkeyword">.new(</span><span class="syntaxdefault">255</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">255</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">  0</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxcomment">#  75%<br /></span><span class="syntaxkeyword">@</span><span class="syntaxdefault">clr </span><span class="syntaxkeyword"><<</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Color</span><span class="syntaxkeyword">.new(</span><span class="syntaxdefault">  0</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">255</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">  0</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxcomment">#  50%<br /></span><span class="syntaxkeyword">@</span><span class="syntaxdefault">clr </span><span class="syntaxkeyword"><<</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Color</span><span class="syntaxkeyword">.new(</span><span class="syntaxdefault">  0</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">255</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">255</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxcomment">#  25%<br /></span><span class="syntaxkeyword">@</span><span class="syntaxdefault">clr </span><span class="syntaxkeyword"><<</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Color</span><span class="syntaxkeyword">.new(</span><span class="syntaxdefault">  0</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">  0</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">255</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxcomment">#   0%<br /></span><span class="syntaxdefault">def self</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">clr</span><span class="syntaxkeyword">;</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">@</span><span class="syntaxdefault">clr</span><span class="syntaxkeyword">;</span><span class="syntaxdefault"> end </span><span class="syntaxcomment"># Accessor<br /># (?) Should this be done by CExt?<br /></span><span class="syntaxdefault">def self</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">value_to_color</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">value </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> 0</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> max </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> 100</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> min </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> 0</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> clr </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">@</span><span class="syntaxdefault">clr</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># Cap value to range.<br /></span><span class="syntaxdefault">  value </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">[</span><span class="syntaxdefault">min</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> value</span><span class="syntaxkeyword">].</span><span class="syntaxdefault">max<br />  value </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">[</span><span class="syntaxdefault">max</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> value</span><span class="syntaxkeyword">].</span><span class="syntaxdefault">min<br />  </span><span class="syntaxcomment"># Calculate what colours to blend between and the blending ratio.<br /></span><span class="syntaxdefault">  n </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">value</span><span class="syntaxkeyword">-</span><span class="syntaxdefault">min</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">/</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">max</span><span class="syntaxkeyword">-</span><span class="syntaxdefault">min</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">/</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">clr</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">length</span><span class="syntaxkeyword">-</span><span class="syntaxdefault">1.0</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">  index1 </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> n</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">to_i<br />  index2 </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">[</span><span class="syntaxdefault">index1</span><span class="syntaxkeyword">+</span><span class="syntaxdefault">1</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> clr</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">length</span><span class="syntaxkeyword">-</span><span class="syntaxdefault">1</span><span class="syntaxkeyword">].</span><span class="syntaxdefault">min<br />  ratio </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> n </span><span class="syntaxkeyword">-</span><span class="syntaxdefault"> index1<br />  return clr</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">index2</span><span class="syntaxkeyword">].</span><span class="syntaxdefault">blend</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">clr</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">index1</span><span class="syntaxkeyword">],</span><span class="syntaxdefault"> ratio</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">end<br /></span> That's the method I use in Vertex Tools to colour the soft selection: [image: clr.png]
  • Javascript problem

    8
    0 Votes
    8 Posts
    673 Views
    T
    Thanks for you responses! And yes you are right, I need to organize my scripts better, you've been of great advice!
  • Ruby Code Generator

    5
    0 Votes
    5 Posts
    802 Views
    Dan RathbunD
    And I see you just joined SCF, so I'll assume your new to Ruby... see: Ruby Newbie's Guide to Getting Started Get the CHM Ruby Reference, as instructed in the Guide... Get the full Ruby installer: Ruby (v1.8.6-p287) Windows One-Click Installer Get the !loadpaths.rb script (so you can access standard Ruby lib files): [Code] Ruby LOAD PATHs script (Win32) (Dan Rathbun / Jim Foltz)
  • JQuery 1.7 Released

    4
    0 Votes
    4 Posts
    386 Views
    jolranJ
    Yes, I understand. I've seen your praising for it. That made me want to try to learn it in addition to standard JS. Can say.. Haven't been using Jquery for long(or JS for that matter), but only the selectors themself is worth the use of it.
  • C Extension project - Async HTTP transfer - CURL?

    10
    0 Votes
    10 Posts
    2k Views
    T
    @adamb said: Ruby has "green threads" which is simply the Ruby interpreter locally slicing & dicing its own execution thread. But since the Ruby intepreter itself is being scheduled from the runloop of SketchUp, its of little use for asyncronous work. In other words, if I have a progress bar inside a C extension, it will suffer same 'halt' as whole SU user interface, when Ruby is doing heavy lifting, right? Does it mean that I have to start an independent thread with the progress bar to have it updated in same conditions?
  • Temporary drawing elements vs. invisible objects

    2
    0 Votes
    2 Posts
    343 Views
    thomthomT
    Creating entities in SketchUp is slow! Very slow and it gets slower the more entities you have in the context. It also triggers all kinds of observers etc. If possible, avoid any kind of calculations without temp geometry. ( Some times you have to, like when you want to trigger SU's merge feature to make sure things heal up properly. Or if you need to get the current user axis - then you need to create two dummy groups.) And yes, using the built in methods of SU for calculations is much faster than trying to do it in Ruby. Make use of the Geom module for all it's worth. For Vertex Tools I even ported the method that calculated soft selection to a C extension because in Ruby it was slow as a sleeping snail. Any calculation, even simple 2 + 2 operations eat time in Ruby - which you notice quickly when you do it in a look. But the biggest bottleneck is adding entities in SU, and that's not much you can work around other than trying to use the bulk methods whenever possible.
  • Mac ruby editor

    5
    0 Votes
    5 Posts
    643 Views
    gillesG
    there is one that is a SU plugin http://forums.sketchucation.com/viewtopic.php?t=25800#p222075
  • Unified Info for Noobies? Wiki?

    5
    0 Votes
    5 Posts
    466 Views
    thomthomT
    That sounds good. Though, might be good to start simple, just so that it doesn't get so complex it'll never finish. (I've been there soooo many times... )
  • Parameter passing across two files

    3
    0 Votes
    3 Posts
    274 Views
    C
    Great! Thank you Dan.
  • Installers for plugins.

    11
    0 Votes
    11 Posts
    2k Views
    D
    A lightweight solution for plugin installers is to use self-extracting zips: http://www.izarc.org/tutorials.html#sfx izarc gives you a few basic options as well. You'll have to make separate installers for 32/64bit Windows (since 64-bit systems use C:\Program Files (x86)).
  • Copyright icons.

    6
    0 Votes
    6 Posts
    378 Views
    jolranJ
    Asking is probably wise. I'll see what I'll do later on. It's also not that hard creating new icons Thanks for the advice, both of you!
  • It's that time again - mind is goo

    5
    0 Votes
    5 Posts
    442 Views
    TIGT
    (2 * 3).m
  • Webpage pin

    4
    0 Votes
    4 Posts
    312 Views
    A
    1001 Thanks Chris ! it's exactly what I was looking for. You can't imagine how many time I search.
  • [plugin] Ruby Raytracer

    17
    0 Votes
    17 Posts
    5k Views
    N
    @unknownuser said: Thanks for the sample code and the explanation. I wasn't aware that a Raytracer can be written in such a small piece of code!! Quite tiny indeed... there are others too, like http://tog.acm.org/resources/GraphicsGems/gemsiv/minray/
  • Download files with a SketchUp plugin

    47
    0 Votes
    47 Posts
    10k Views
    R
    Is there a Windows build in sight?
  • Map texture onto non-planar "quad"

    10
    0 Votes
    10 Posts
    763 Views
    Chris FullmerC
    @adamb said: Also tried Chris Fullmer's shape blender but it ignores UVs Yeah, sorry Adam. I don't actually do a lot of rendering or texturing, so I'm not really a UV person yet. In theory I'll be re-writing shapebender someday to account for UV's. I'm sure you guys are excited thinking about that headache - everyday 20 new noob questions from me about textures
  • .SKP File Structure

    3
    0 Votes
    3 Posts
    922 Views
    tbdT
    which is not support that much anymore. and needs MS COM mumbo jumbo to work
  • UI.start_timer() is the new while

    3
    0 Votes
    3 Posts
    465 Views
    J
    I've experimented with using start_timer, and changing the time and/or partition size on the fly. It just gets far too slow to be worthwhile. http://forums.sketchucation.com/viewtopic.php?f=180&t=27092&p=234026#p234026 Using an Animation class instead of a timer may be easier to code, but I'd guess the result would be similar.
  • Componant axes

    7
    0 Votes
    7 Posts
    563 Views
    C
    Thanks a lot for your answer, Mayby i'm wrong, but i believe, you misunderstand me. so i show you what i've programmed: ` driller= Sketchup.active_model.definitions.load("\driller.skp") pos_driller = Geom::Point3d.new 47,32,25 set_driller= Geom::Transformation.new pos_driller instance1 = entities.add_instance driller, set_driller cuboid_wood = Sketchup.active_model.definitions.load("\Cuboid_wood.skp") pos_cuboid = Geom::Point3d.new 0,0,0 set_cuboid = Geom::Transformation.new pos_cuboid instance2 = entities.add_instance cuboid_wood, set_cuboid` but this is hardcoded and i want that the computer places the objects correctly together automatically,by calculating the best position, but i can't calculate the size of these objects, because i don't know how. (i would have to measure the size with the measure-tool in SU with the mouse, but it should retrieve the values with a method) I have the task to do that with many components, that's why i wouldn't say the detailed coordinates for every components, which i load. the programm should be able to load componentes, put it together correctly and dynamically, take some photos in different perspectives, save these pictures, clear it all and start at the beginning with other components ... everthing is quite clear to me, with the exception of the hardcoded coordinates of these objects P.S. i have wrote this problem in a new topic too

Advertisement