⚠️ 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
  • Bug in Vector angle_between

    6
    0 Votes
    6 Posts
    681 Views
    Dan RathbunD
    @dan rathbun said: @unknownuser said: Note that the result is correct is the vector length is.. The cutoff appears to be (works at or above): vec.length = 0.03162316231623162**...** inches Actually, I think the cutoff is more like the rounded value, of the square root of Sketchup's internal tolerance (0.001) ie: (0.001)**(1/2.0) >> 0.0316227766016838 [table=bg1 table1:34jvzu3e][thead:34jvzu3e][tr=:34jvzu3e][th=1:34jvzu3e]So the general rule is:[/th:34jvzu3e][/tr:34jvzu3e][/thead:34jvzu3e][tbody:34jvzu3e][tr=bg2:34jvzu3e][td=1,:34jvzu3e]If the product of the lengths of the two vectors, is less than that of Sketchup's internal tolerance (0.001"), the angle returned by angle_between is Math::PI/2 [ (Math::PI/2).radians.round= 90 deg,] instead of Math::PI [ (Math::PI).radians.round**= 180 degrees.]**[/td:34jvzu3e][/tr:34jvzu3e][/tbody:34jvzu3e][/table:34jvzu3e] viz: v1.length = 0.03162278 v2.length = 0.03162278 v1.angle_between(v2) >> 3.14159265358979 v1.angle_between(v2).radians >> 180 %(#000000)[# degrees] @unknownuser said: I would imagine that SU would normalize the vectors first before computing the angle, so that it's independent of the size. AGREED !! At first i could not imagine why the length would have anything to do with it, but then seeing how a square root is involved, they are likely using pythagorean trigonometry. @unknownuser said: And why return PI / 2 and not 0? That's funny also, PI/2 radians is 90 degrees. Perhaps they choose a known 'reference' vector (say the X-axis) and find the angle between it an v1. Then choose another 'reference' vector 90 degrees from the first (the Y-axis), and compute the angle between it and v2. If there's a bug in there (say half of the algorithm craps out,) that may be why you wind up with 90. now your inline fix, in code is: v1.normalize.angle_between(v2.normalize) or v1.normalize.angle_between([array].normalize)
  • Using an observer to delete a screen note

    31
    0 Votes
    31 Posts
    6k Views
    P
    Hello, I experimented a little with modules now and I think (hope) I now understand the use of them. Despite all your great help it took me several hours till I found this: @unknownuser said: Like class methods, whenever you define a method in a module, you specify the module name followed by a dot and then the method name. Before that I used the method name without the module name in front and nothing worked... Matthias
  • How to input a time ?

    15
    0 Votes
    15 Posts
    2k Views
    P
    @dan rathbun said: @pvbuero said: Where to find the variable with the time ? def get_shadow_time > model = Sketchup.active_model > shadowinfo = model.shadow_info > shadtime = shadowinfo['ShadowTime'] > # shadtime is a Time class object > end > Ruby Time class from the 'Pick-Axe' book. Time class in Ruby Core Docs. I didn't mean in SU. I meant "variable with the time" in the javascript file ... But I think that's to much new stuff at once.
  • WebDialog and utf-8 Problem

    5
    0 Votes
    5 Posts
    546 Views
    B
    thanks for your advice, I will try your suggested methods.
  • Posting tables of data in the forum

    11
    0 Votes
    11 Posts
    2k Views
    Dan RathbunD
    @thomthom said: No Ruby fun - only PHP... I posted a Ruby Hilited test example(s) at the phpBBStyles forum, ie: Code Test - Ruby EDIT: corrected URL as topic was moved by phpbbstyles moderator. .. in order to see how well the phpBB Syntax Highlighter MOD works/looks. Adds a BBCode 'syntax' which allows you to post programs / scripts in upto 132 languages and have the post Syntax Highlighted using GeSHi.General description: http://www.phpbb.com/customise/db/mod/syntax_highlighter More info (install notes, etc.): http://www.phpbb.com/community/viewtopic.php?t=1697035#p10232505 Extra info: http://www.phpbbstyles.co.uk/info/viewtopic.php?f=6&t=39&p=83 Supported coding Syntaxes: [ emphasis on some by me ] @unknownuser said: Syntax Highlighter - 1.0.8](http://www.phpbbstyles.co.uk/info/viewtopic.php?f)":sk3p0i6l] now supports 138 languages. Supported Syntaxes: abap, actionscript, actionscript3, ada, apache, applescript, apt_sources, asm, asp, autoit, avisynth, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_mac, caddcl, cadlisp, cfdg, cfm, cil, cmake, cobol, cpp, cpp-qt, csharp, css, d, dcs, delphi, diff, div, dos, dot, eiffel, email, erlang, fo, fortran, freebasic, genero, gettext, glsl, gml, gnuplot, groovy, haskell, hq9plus, html4strict, idl, ini, inno, intercal, io, java, java5, javascript, kixtart, klonec, klonecpp, latex, lisp, locobasic, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, make, matlab, mirc, modula3, mpasm, mxml, mysql, nsis, oberon2, objc, ocaml, ocaml-brief, oobas, oracle11, oracle8, pascal, per, perl, php, php-brief, phpbb, pic16, pixelbender, plsql, povray, powershell, progress, prolog, properties, providex, python, qbasic, rails, rebol, reg, robots, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, tcl, teraterm, text, thinbasic, tsql, typoscript, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xhtml, xml, xorg_conf, xpp, z80 Using GeSHi version: 1.0.8.4
  • Export images: how to?

    14
    0 Votes
    14 Posts
    1k Views
    Didier BurD
    @thomthom: correct, I need the names for another purpose, along with the associated definition. (su2pov) @Dan: - I didn't even know that an image could have no name... How can this occur (each image has a path (with a file name at the end) image.path=nil occured only one time with an old model and I cannot reproduce this, so I think I made an error whan typing code in the console or something like that... - tw exports at the original format.
  • Find the global position of a Vertex in a Group/Component

    25
    0 Votes
    25 Posts
    6k Views
    K
    one small correction to the code posted by Glenn: after calling createVerticesArray on line 14, add the line: trans_h.pop otherwise, if there are multiple sub-components in the entities collection, you will take into account the transformation of any entity that came before. Otherwise, great code, very useful. Thanks! -- Karen
  • Auto add numbers in Ruby?

    12
    0 Votes
    12 Posts
    986 Views
    J
    @dan rathbun said: also.. printf "%04d%s\n" % [i, name] is adding an extra operation eval that's not needed. Note to self: % is a method of Strings. Thanks.
  • How to avoid generating line between joint?

    19
    0 Votes
    19 Posts
    2k Views
    S
    Hi TIG, Finally made it and got my mesh. To cut through, need to cut from the opposite direction. To cut in (make a shell), need to cut from outside to inside. No need to do all the |e|e.erase! ... check. Thanks [image: mesh.gif]
  • Remove In Model from Components

    4
    0 Votes
    4 Posts
    534 Views
    TIGT
    IF there are any components placed in a SKP model when Sketchup opens you can't purge them. Unused components can be purged... and then they are only accessible from the Components folder again... So, unless you want to somehow explode all component instances at startup and then purge unused [=ALL], you must always have some components in the browser of any previously-used SKP, where you have placed some components ???
  • If Toolbar is true make it false

    54
    0 Votes
    54 Posts
    6k Views
    Dan RathbunD
    @simonstaton said: I dont suppose you know what the toolbar name would be for the large toolset do you? It does NOT have a string identifer that works with UI.toolbar_names or UI.set_toolbar_visible, etc. This is a bug in the API; we have asked that it be fixed. Misspelled argument: 'Principle' for the Principal toolbar. The missing arguments: %(#000000)[**identifier]%(#F0F0F0)[____]%(#000000)[tb_ID]%(#F0F0F0)[_]%(#000000)[send_action int "LargeToolSet"]%(#F0F0F0)[_]%(#000000)[(211)]%(#F0F0F0)[__]%(#000000)[23056 "Layers"]%(#F0F0F0)[_______]%(#000000)[(220)]%(#F0F0F0)[__]%(#000000)[21132 "Shadows"]%(#F0F0F0)[______]%(#000000)[(103)]%(#F0F0F0)[__]%(#000000)[10546**] NOTE: %(#000000)[**"Dynamic Components"]%(#F0F0F0)[_]%(#000000)[(59648)]** is a ruby toolbar (not a native toolbar.) You must use UI.toolbar('Dynamic Components') with the .visible?, .restore, .hide and .show methods.
  • Dynamic Components and Glue To

    6
    0 Votes
    6 Posts
    831 Views
    K
    A DC tech reference would be pretty awesome. Thanks! -- Karen
  • Sun elevation and azimut

    11
    0 Votes
    11 Posts
    3k Views
    P
    Adam, I tried it. It is very close to what I need. I give you a PM with further details. Matthias
  • Debug Traces in Sandbox From Contours

    7
    0 Votes
    7 Posts
    695 Views
    Dan RathbunD
    @unknownuser said: The others [warnings] with LibTraductor are inevitable, because, for compatibility reasons, I load twice LibTraductor code (the old file LibTraductor.rb for JoinPushPull and then the one from LibFredo6). When you next update the LibFredo6.. you can suppress the warnings when you know that your about to redefine old methods. Save $VERBOSE to a reference, then set $VERBOSE to nil (silent mode,) when done overriding methods, reset $VERBOSE back to what it was. MAKE SURE YOU SET IT BACK !! (or some peeps may get angry.)
  • View.line_width limited to 10px?

    3
    0 Votes
    3 Posts
    359 Views
    thomthomT
    Yea - I noticed that drawing lines doesn't miter - but I'd rather that the line width wasn't limited. Using a thick linewidth was a quick and easy way to draw squares by only using two points. To workaround this one has to create all the points which then requires more calculations in Ruby which makes things slow.
  • Understanding repeating code In Ruby?

    5
    0 Votes
    5 Posts
    552 Views
    J
    With this, you can use any combination of ABCD. blocks = UI.inputbox(["Blocks [ABCD]?"])[0] populateA() if blocks[/A/] populateB() if blocks[/B/] populateC() if blocks[/C/] populateD() if blocks[/D/] Or even.. blocks = UI.inputbox(["Blocks [ABCD]?"])[0] letters = blocks.split(//) letters.each do |letter| populate(letter, etc) end
  • Inche fraction in ruby script

    7
    0 Votes
    7 Posts
    1k Views
    N
    wow thank you guys its really appreciated
  • Implementing Todds' Progress Bar?

    12
    0 Votes
    12 Posts
    1k Views
    T
    Thanks guys, without your input, I would have been watching the Bachelor .............I'm kidding! I will post this Ruby when I get it in STILL better shape.
  • Snapto in Sketchup 6

    14
    0 Votes
    14 Posts
    1k Views
    Dan RathbunD
    Updated code example again to handle downloaded component paths pointing to the Temp folder. Is ther any current Component Tool plugin that has something similar to this "Save All" feature?
  • BoundingBox.intersect

    10
    0 Votes
    10 Posts
    2k Views
    P
    I'm seeing the same problem, tested on both Mac and PC with SU 7.1.6 this is clearly a bug as the function does not do what it's name represents. although this would be renamed and used to find if 2 bounding boxes are within the same projected space. I recently posted pretty much the same post here: http://forums.sketchucation.com/viewtopic.php?f=180&t=29156

Advertisement