ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Compound Transformation

    11
    0 Votes
    11 Posts
    697 Views
    C
    @thedro said: Sorry, I realize how unclear that was since wanting to separate isn't related to the same situation as combining them. How very true. In the math world this is generally called matrix decomposition, and there are various schemes to do so depending on what information you're looking to extract. Some information is really easy to find, others are very hard. Scaling isn't to bad however. If you use the transforms .to_a method you'll get a 16 number array. It's best to think of this array as a 4x4 grid, with each group of four entries being one column of the matrix. The reason for this is that you can then interpret each column meaningfully by looking at your axis will change with respect to the transformation. If you think of your coordinate system as an x, y and z-axis together with an origin, then the first column is your x-axis, the second your y-axis, and the third your z-axis and the last column the origin. The only trouble here is that all of the columns have four entries while each of those vectors should only have three. This is pretty easy to resolve however since the last entry of the first three columns will always be 0, and the last entry of the final column will almost always be 1. I say almost always because there is one important exception, which is that if you use use the Transformation.scaling method, then this entry will be the reciprocal of the scaling factor. So for example Geom::Transformation.scaling(2).to_a[-1] will return 0.5, which is 1/2. This somewhat complicates finding the scale factor in that you can't just look at the length of the x-axis in the transformation to find the x-axis scaling, but you can however divide by the this value to achieve the full scaling in that direction. In general you can always take a transformation's array and divide each entry by the value in that last column to "normalize" the last value to 1 without actually changing how the transformation works. I won't bore you with the logic behind why they use this scheme, just know that it simplifies the math behind a number of common operations in computer graphics so they aren't just trying to invoke your wrath.
  • Quick theoretical question

    12
    0 Votes
    12 Posts
    390 Views
    M
    Super helpful, as always. Thanks.
  • Help with toolbars

    6
    0 Votes
    6 Posts
    417 Views
    Dan RathbunD
    Hello Christain... you describe a Mac quirk. I believe that there is work-around for that, but I am not a Mac user. Can any Mac guys explain to him how to get new toolbars to save position ?
  • Have moved to Linux Mint 10. Sketchup in Linux?

    10
    0 Votes
    10 Posts
    2k Views
    A
    As far as I heard from a Googler, they would like to completely overhaul the UI, but don't have the time. If they cannot achieve this, then the chance of porting SketchUp to another toolkit is rather low. Although Google massively applies Linux in its company (Maps developers, streetview etc.), they consider for their products mainly the market share outside the company (whereas the Mac OS X share is mostly a US phenomenon). In the SketchUp Help Forum, there are rapidly increasing requests for a version for iPad, iPhone, but also Android and ChromeOS (?) users demand their rights. I think if Google will ever support another platform, then it would be the web.
  • How make a window like the components window

    5
    0 Votes
    5 Posts
    347 Views
    Dan RathbunD
    Reread my previous post. Then readup on Components and Dynamic Components (which are actually Components with special Attribute Dictionaries.) What you really need to do is create a Building Component Manager plugin. But the buildings themselves will have to be Components, and/or Dynamic Components (which will likely have a "Building" Attribute Dictionary attached to them, with keys and values that your manager will use to keep track of and organize them.) Now.. it IS possible that within your manager namespace, you can have a class Building, whose instances hold a reference (instance variable,) to a Component Instance that is actually in the model. The SKP file format has an embedded thumbnail image, which if you have that file in a link in the browser (I'm talking webdialog,) then the thumbnail should display just as if you had any other image filetype on a webpage. It may be possible to drag and drop from the webdialog into the Sketchup client area. (We know we can do this from a folder explorer window.) Do a search for other topics on "Warehouse" as others have discussed making a webdialog or website similar to Google's 3DWarehouse. You may pick up some ideas in those threads.
  • Akshell.com - web based javascript IDE

    3
    0 Votes
    3 Posts
    625 Views
    tbdT
    for writing server code I usually do it on heroku as I can use Ruby, but on akshell everything is in the browser, with no install needed.
  • State of Observers — 28 February 2010

    38
    0 Votes
    38 Posts
    16k Views
    thomthomT
    @dan rathbun said: Seems I remember that AppObserver::onNewModel does not get called when Sketchup starts up. Is this generally true.. or specific to PC or Mac ? Aye.
  • SU 8 Mac & strange content

    6
    0 Votes
    6 Posts
    798 Views
    Dan RathbunD
    Just a reminder (for anyone reading,) that we should not change entities when iterating the C++ entities collection. (Strange things can happen... items can be missed, or be processed more than once, etc.) If you need to change entities, then make an array copy to iterate: ents = Sketchup.active_model.entities**.to_a** ents.class Array Although an exporter usually should not be making changes to the model.
  • Save pages as jpg-files

    2
    0 Votes
    2 Posts
    730 Views
    TIGT
    Manually File Export 2D image select jpg etc and add a name OR get this http://www.smustard.com/script/SceneExporter [free] or this http://www.smustard.com/script/SceneExporterPro [$10] which exports all of the Scene tab views as jpg image files named after the tab...
  • Modules - are they needed if ...

    5
    0 Votes
    5 Posts
    347 Views
    chrisglasierC
    @thomthom said: Javascript namespacing: http://www.dustindiaz.com/namespace-your-javascript/ http://www.crockford.com/javascript/private.html Thanks for that TT - all good stuff which I have implemented in part - still really trying to get to grips with it though. But my current concern relates to this Diaz comment: @unknownuser said: ... avoid conflicts with external application code, playing nice with the "other JavaScript kids," ... I don't think relying on playing nice is realistic in a global environment but making sure same named objects and functions overwrite existing by loading or reloading immediately prior to use may be. I'm just not sure if there are other implications. Thanks
  • Face.classify_point - compare results?

    25
    0 Votes
    25 Posts
    1k Views
    T
    Alright so I posted my results on the api but is it possible to edit it in case there is a mistake?(not that I've found one) Oh and it's posted as anonymous.... whatever.
  • Get Current Units

    5
    0 Votes
    5 Posts
    1k Views
    thomthomT
    If you convert a string number into a Length ( .to_l ) and the string contains no unit indication it assumes the units is the current model unit. "50".to_l Returns a Length: 1.96850393700787 (assuming the model units where mm) "50m".to_l Returns a Length: 1968.50393700787 regardless of what the model units are because the unit is specified.
  • Taking content from arrays to open a .3ds file

    2
    0 Votes
    2 Posts
    218 Views
    TIGT
    Your machine = "a[0].3ds" Is simply a string - with no reference to array 'a' at all. machine = a[0].to_s+".3ds" Takes the value of the first item in the array 'a' and adds .3ds onto the end of that all as a string... If you are sure the first item in the array 'a' is a string you don't need the .to_s part a[0]+".3ds" will do...
  • [code] Load Instructor v1.0.1

    6
    0 Votes
    6 Posts
    2k Views
    B
    Just updated the code with a very quick fix. In the previous version on PC, there was an error produced in the ruby console along the lines of "Directory Not Empty". In early beta versions the temporary folder name was created from a unique string using a timestamp. In the current version, consistent temporary folder names was implemented, so any previous directories needed to be deleted.. I've expanded the delete method in the script to search the subdirectories of the temporary folder if it exists and clear them out before deletion. This stops the error. Also, when the temporary location was more than one folder deep (ie. my_script/instructor), the folder 'my_script' was not being created. V 1.0.1 searches each folder in your custom temporary path and creates the folder if it doesn't exist, removing this error. This update is essential for proper implementation of Load Instructor.
  • Virtual entities or model

    3
    0 Votes
    3 Posts
    251 Views
    T
    Sweet. Thanks a lot TIG, that should work.
  • Alternate directory for Plugins

    9
    0 Votes
    9 Posts
    2k Views
    Dan RathbunD
    For users, I think putting the option under the Windows menu, may be confusing. Sketchup should have a "Settings" or "Options" menu, but well... my 2nd choice would be under a "Options" submenu of the "Plugins" menu. Is it useful ?? Well yes... I am putting 3 folder open buttons on my Console Toolbar ("Shared", "User" and "Custom",) that can be configured to open certain folders much the same way you have done for specifying them. But the UI.inputbox just cannot do the job. See image: http://forums.sketchucation.com/download/file.php?id=65052
  • All faces with their backs facing the camera.

    9
    0 Votes
    9 Posts
    415 Views
    M
    i now my idea sounds insane but it could be a good way for those who model building as boxes with no details inside them. But really thank you for all the great help
  • Instructor content

    84
    0 Votes
    84 Posts
    8k Views
    Dan RathbunD
    Here's a version cleaned up and made into a Mixin module. Added Class Variables declarations: # CLASS VARIABLES @@relative_instructor_path = '' @@temp_instructor_folder = false @@tool_filepath = '' # must be redefined in the Tool class for rbs files Added method definitions: public def relative_instructor_path return @@relative_instructor_path end def temp_instructor_folder return @@temp_instructor_folder end private # initialize() # # Likely to be redefined in the Tool class definition. # We define it here just in case the Tool author does not. # def initialize help_setup() end # help_setup( instructor_folder=false, temp_folder=false ) # # Sets up and inits some instance variables used for # the tool's Instructor help system. # # ** Must be called by the Tool's initialize() method. ** # def help_setup(instructor_folder=false, temp_folder=false) # if @@tool_filepath.empty? if __FILE__ != '(eval)' && File.exist?(File.expand_path(__FILE__)) @@tool_filepath = __FILE__ else raise(ScriptError,"#{self.class.name}; @@tool_filepath class variable error. @@tool_filepath must be declared for rbs files!") end else unless File.exist?(File.expand_path(@@tool_filepath)) raise(ScriptError,"#{self.class.name}; @@tool_filepath class variable error. File '#{@@tool_filepath}' does not exist!") end end # if instructor_folder @instructor_folder = instructor_folder else @instructor_folder = getDefaultInstructorFolder() end if temp_folder @temp_folder = temp_folder elsif RUBY_PLATFORM =~ /darwin/i # on a Mac @temp_folder = @instructor_folder else @temp_folder = getDefaultTempFolder() end # @@relative_instructor_path = returnRelativePath() # end #def help_setup() and: # getInstructorContentDirectory() # # Callback for tool to give Sketchup the relative path # to the tool's help directory. # def getInstructorContentDirectory unless @@temp_instructor_folder # copy help files copyInstructor() @@temp_instructor_folder = returnTempInstructorFolderName() end return @@relative_instructor_path end #def I did not make any changes to the "engine" methods, except: getDefaultInstructorFolder() changed all __FILE__ to @@tool_filepath returnTempInstructorFolderName() inserted a 'short circuit' as the first line, for Macs return @temp_folder if @temp_folder == @instructor_folder File Removed - Get the latest version in Niall's [ code ] topic: [ code ] Load Instructor I also wonder if there should be an AppObserver instance that deletes the temp/instructor file at the end of the session ??
  • Rename the names of the materials

    4
    0 Votes
    4 Posts
    286 Views
    bagateloB
    TIG I'm so grateful for your help. But if I like to complete clean old names, and serialize by numbers? Thanks again. This is great to me.
  • Orient Faces

    3
    0 Votes
    3 Posts
    3k Views
    M
    Great, it does the job for me. Thanks again

Advertisement