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

Alkategóriák

  • No decscription available

    20 Témakörök
    462 Hozzászólások
    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 Szavazatok
    12 Hozzászólások
    1k Megtekintések
    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 Szavazatok
    10 Hozzászólások
    818 Megtekintések
    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 Szavazatok
    8 Hozzászólások
    673 Megtekintések
    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 Szavazatok
    5 Hozzászólások
    802 Megtekintések
    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 Szavazatok
    4 Hozzászólások
    386 Megtekintések
    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 Szavazatok
    10 Hozzászólások
    2k Megtekintések
    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 Szavazatok
    2 Hozzászólások
    343 Megtekintések
    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 Szavazatok
    5 Hozzászólások
    643 Megtekintések
    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 Szavazatok
    5 Hozzászólások
    466 Megtekintések
    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 Szavazatok
    3 Hozzászólások
    274 Megtekintések
    C
    Great! Thank you Dan.
  • Installers for plugins.

    11
    0 Szavazatok
    11 Hozzászólások
    2k Megtekintések
    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 Szavazatok
    6 Hozzászólások
    378 Megtekintések
    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 Szavazatok
    5 Hozzászólások
    442 Megtekintések
    TIGT
    (2 * 3).m
  • Webpage pin

    4
    0 Szavazatok
    4 Hozzászólások
    312 Megtekintések
    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 Szavazatok
    17 Hozzászólások
    5k Megtekintések
    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 Szavazatok
    47 Hozzászólások
    10k Megtekintések
    R
    Is there a Windows build in sight?
  • Map texture onto non-planar "quad"

    10
    0 Szavazatok
    10 Hozzászólások
    763 Megtekintések
    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 Szavazatok
    3 Hozzászólások
    922 Megtekintések
    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 Szavazatok
    3 Hozzászólások
    465 Megtekintések
    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 Szavazatok
    7 Hozzászólások
    563 Megtekintések
    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