sketchucation logo sketchucation
    • Login
    1. Home
    2. abakobo
    3. Topics
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    A
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 8
    • Posts 22
    • Groups 1

    Topics

    • A

      Solved: how to get the ruby version?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      2
      0 Votes
      2 Posts
      748 Views
      A
      Found it... it's the RUBY_VERSION const! cheers
    • A

      Prevent quit without saving in webdialog window

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      1
      0 Votes
      1 Posts
      265 Views
      No one has replied
    • A

      References not behaving the same with string vs My_object

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      302 Views
      Dan RathbunD
      b='hop' is the same as: b=String::new('hop') The Ruby interpreter "reads" the literal string 'hop' and passes it to String::new "behind the curtain". = is the reference assignment operator. a="hip" means "the variable a shall reference the string object 'hip'." a=b means "the variable a shall reference the object that b is referencing."
    • A

      Saving all instance variables of an object

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      14
      0 Votes
      14 Posts
      1k Views
      A
      Bug posted in the GitHub Issues field!
    • A

      Puts inconsistency & machine epsilon management

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      20
      0 Votes
      20 Posts
      1k Views
      Dan RathbunD
      There are some class level constant settings for the Float class. List them: Float.constants Example: Float::DIG 15
    • A

      Inputbox width, some text hidding

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      258 Views
      dukejazzD
      @unknownuser said: I have started a plugin with several inputbox following each other and i realised the width of the input box varies mainly with the first line but not really... Easy fix; I think you can move the right inputbox drop down margin by a tab and (n) spaces on the right of largest number in list example 1) 1 tab 6 space lists = ["3.0|0.333333333333333333333330 tab sp sp sp sp sp sp|44.0"] box will now show 0.333333333333333333333330 to the zero place
    • A

      Angles to vector

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      273 Views
      TIGT
      There is no inbuilt method... but this will do it [flattened to Z-plane] def flat_angle(vector) vec=Geom;;Vector3d.new(vector.x, vector.y, 0) if vec.y < 0 return (2*Math;;PI)-(vec.angle_between(X_AXIS)) elsif vec.y > 0 return vec.angle_between(X_AXIS) elsif vec.y == 0 if vec.samedirection?(X_AXIS) return 0 else return Math;;PI end end end it's easy to make methods for X & Y planes - just adjust vec= to suit those other planes and adjust the tests from vec.y & _AXIS etc...
    • A

      What's the :: symbol on Geom::....

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      315 Views
      Dan RathbunD
      @abakobo said: what's behind the :: symbol in Geom ? It is called the scope operator. :: with nothing to the left of it means the top level scope (aka TOPLEVEL_BINDING,) which is "a particular instance of Object called 'main'". But it's use that way is optional. Ruby always checks the current scope first, then the top level scope if it needs to. But this is also why you should always be executing YOUR code inside a toplevel module, with some unique name that you invent. like module Abakobo So Geom::Point3d is referring to the Point3d class, within the Geom module scope. @abakobo said: and when do we use :: and/or . to call a method It's style, but many people only use the . for ALL methods. Some people use :: for calling module functions and class methods (which the new constructor is,) and then use . to call only instance methods. (Some of the older examples, from the days when SketchUp was owned by Google or @Last Software, use this latter convention. I guess they wanted to emphasize the calling of class methods or module functions.)
    • 1 / 1