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

    Posts

    Recent Best Controversial
    • Cross domain testing with ajax and JSONP

      I've been asked to start a new thread by the Extension Warehouse on an issue that several of us were trying to nail down back in February.

      It has to do with not being able to connect to a web service because of Cross Domain policy.
      We tried this on SU 7, SU 8, SU 2013 and SU 2014 with Windows 7 and it worked using XMLHttpRequest and Javascript.
      However it failed to connect with OSX Lion. Mavericks worked.

      The thread was: viewtopic.php?f=180&t=56262

      I am now testing JQuery, ajax and JSONP for cross domain connectivity.


      dialog_test_5.rb

      posted in Developers' Forum
      G
      Garry K
    • RE: WebDialog encoding bug found!

      Sorry - missed clicking the button for SU 7


      Capture1_.JPG

      posted in Developers' Forum
      G
      Garry K
    • RE: WebDialog encoding bug found!

      Here you go.
      I've got SU 7 Free, SU 8 Free, SU 2013 Trial, SU 2014 Trial


      Capture1_.JPG


      Capture2_.JPG


      Capture3_.JPG


      Capture4_.JPG

      posted in Developers' Forum
      G
      Garry K
    • RE: Get MAC Address

      Sorry - I see this only works in SU 2014

      posted in Developers' Forum
      G
      Garry K
    • RE: Get MAC Address

      For me it just returns an error.
      (eval):5:in `run': uninitialized constant JF::WebConsole::Encoding

      posted in Developers' Forum
      G
      Garry K
    • RE: Get MAC Address

      My mistake this does work.
      We got our versions crossed up.

      File.open(tempfile, 'r', :encoding => 'iso-8859-1') do |file|

      Thanks anyway Dan

      posted in Developers' Forum
      G
      Garry K
    • RE: Get MAC Address

      A fellow in Russian has been testing this and ends up with this error when running SU 2014.

      Error: #<ArgumentError: invalid byte sequence in UTF-8>
      The line of code that is fails on is

      lines = file.grep(regex)

      So the next thing we did was change the prior line to but had the same error.

      File.open(tempfile, 'r', :encoding => 'iso-8859-1') do |file|

      What is interesting and confusing is that when we ran this code from the web-console it worked

      
      mac_addr = []
      cmd = 'ipconfig /all'
      regex = Regexp.compile('(..[;-]){5}..')
      
      if (RUBY_VERSION[0..2] == '1.8')
        lines = %x[#{cmd}].split("\n").grep(regex)
        lines.each { |line| mac_addr << (line.strip[-17, 17]).upcase().gsub(/-/, ';') }
      else
        temp_path = File.expand_path(ENV['TMPDIR'] || ENV['TMP'] || ENV['TEMP'])
        tempfile = File.join(temp_path, 'temp.txt')
      
        `#{cmd} > #{tempfile}`
        File.open(tempfile, 'r', ;encoding => 'iso-8859-1') do |file|
           lines = file.grep(regex)
           lines.each { |line| mac_addr << (line.strip[-17, 17]).upcase().gsub(/-/, ';') }
        end
      
        File.unlink(tempfile)
      end
      
      mac_addr[1]
      
      
      posted in Developers' Forum
      G
      Garry K
    • RE: [Plugin] GKWare Door Maker

      Sorry - I knew that - it was a copy and paste error !!

      posted in Plugins
      G
      Garry K
    • RE: SKUI — A GUI Framework for SketchUp

      Can this be installed once - and then used by a number of different plugins by a number of different authors? Or do we have to include a copy of SKUI with each plugin installation?

      posted in Developers' Forum
      G
      Garry K
    • RE: SKUI — A GUI Framework for SketchUp

      I'm also going to try this. Where can I get the most up to date documentation and examples?

      Questions I have:

      1. How will language translation work?
      2. Do you support hints during hovering?
      3. How well do the components line up? I would like to line things up like this.

      Stair inputs imperial.JPG

      posted in Developers' Forum
      G
      Garry K
    • RE: Extrusion sometimes reverses all faces

      When it comes to push pull I understand that it does depend upon the winding (clockwise or counter clockwise) of the polygon. This is consistent and repeatable.

      However, with an extrusion that has a closed polyline as a path it is not repeatable. I can guarantee that the points for the face are always created exactly the same way - since they come out of a txt file. I store x and y points at 1/10000 decimal inches. The z values are set as 1/2 of the height of the door panel.

      I also calculate the path as x and y points which is a closed polyline. The Y values are 0.

      face = group.entities().add_face(face_pts)
      path = group.entities().add_curve(path_pts)
      face.followme(path)

      If I build the door at [0,0,0] look at it and then do a ctrl_z and repeat this process, I get a results where the the extrusion is sometimes reversed and sometimes not.

      It appears random - although the polyline and face are always created exactly the same way.

      When I create my curved stair stringers using fill_from_mesh I store each polygon's points with a clockwise winding. So far this has proved 100% predictable and repeatable.

      In the early days I used to do a lot of work with GIS and Windows GDI and create polypolygon this way. If you wanted to create a continent with a large lake that has an island that has a body of water you would have a series of 4 diminishing polygons each completely residing within each other. The outer most polygon would be clockwise (the continent) the large lake would be counter clockwise, the island would be clockwise and the body of water in the island would be counter clockwise.

      I found that the sketchup works essentially the same way with meshes.

      posted in Developers' Forum
      G
      Garry K
    • RE: Extrusion sometimes reverses all faces

      I figured out a solution that seems to work in my case.

      1. I always build the door in the same plane. The door is rotated and moved after fully built.
      2. All the faces are either consistently reversed or all are correct.
      3. The majority of the faces always face outward. I may have 1 or 2 faces that face inwards.

      I do the following:

      flip is 1 if the moulding is on the front of the door. flip is -1 if it is on the back of the door

      sum = 0.0
      grp.entities.each { |ent| sum += ent.normal.dot(Y_AXIS) if (ent.kind_of? Sketchup::Face) }
      grp.entities.each { |ent| ent.reverse!() if (ent.kind_of? Sketchup::Face) } if ( sum * flip > 0 )

      posted in Developers' Forum
      G
      Garry K
    • RE: Extrusion sometimes reverses all faces

      These doors are created with my door maker plugin. The profile of the moulding are points that create a face. I've looked at the orientation or winding of the face and it doesn't have a direct relation to whether the moulding has reversed or proper faces.

      The path is a series of points and form a connected polyline where the winding is clockwise.

      It appears that the face.followme(path) command sometimes extrudes reversed and sometimes extrudes properly.

      I'm wondering if anyone else has experienced this and if anyone has found a solution.

      posted in Developers' Forum
      G
      Garry K
    • Extrusion sometimes reverses all faces

      I am drawing mouldings for doors and sometimes the extrusion draws all faces in reverse. It appears to be random as I can draw the exact door and sometimes it is reverse and sometimes it is proper.

      Any suggestions?


      door_moulding.JPG

      posted in Developers' Forum
      G
      Garry K
    • RE: [Plugin] GKWare Door Maker

      Door Maker Pro lets you build passage doors. Just set the Stile Width to say 4-5 inches and set the Bottom Rail to 8-10 inches. You can set it to what ever you want.

      Some of these examples make use of the new "Glass Combo" choice where the Top Panel is glass and the other panel(s) are your door material.

      Also notice that doors that are >= 30 mm thick have the panel raise and moulding on both sides.


      Door Section


      Passage Doors

      posted in Plugins
      G
      Garry K
    • RE: [Plugin] GKWare Door Maker

      The pro version is in final testing. Here are some doors that can be made along with a sketchup file that I've used to create these profiles.

      Keep the geometry simple. Arcs are 3 to 5 segments. Straight lines are not divided.
      When you are happy with a profile just select the face and click the new "Add Profile" button. Select which profile group and give the new profile a name. We simply add a txt file into 1 of the 4 profile group folders.

      The next time you run Door Maker Pro - the profile will be in the drop down list.

      Here is the contents of gkware_doormaker/panel profiles/Ogee.txt

      0.000000,0.342090
      0.000000,0.000000
      1.181102,0.000000
      1.181102,0.078740
      1.069553,0.087210
      0.960561,0.112427
      0.856627,0.153812
      0.760133,0.210415
      0.663639,0.267019
      0.559705,0.308404
      0.450714,0.333620
      0.339164,0.342090


      New Doors Pro version


      Door Profiles


      Door Profiles sketchup file

      posted in Plugins
      G
      Garry K
    • RE: Component best practices

      Dave,

      Insertion point at the center is what I have been doing.

      After I verified that my plugin is correctly positioning the handle I removed the construction points.

      I'm also requiring the handles to be oriented as in the sample. The plugin will rotate them into a horizontal position for a few handle locations such as drawer fronts. The handle is inserted inside the Door component and therefore gets moved with the door / drawer front and or rotated around the Z_AXIS

      I'm providing 4 basic handles. If the user wants to drop additional handles into my handles folder then they will appear in the drop down list and will be used when adding doors / drawer fronts to the sketch.


      Handle

      posted in SketchUp Components
      G
      Garry K
    • RE: Storing Geometry

      Thankyou - this will be a good read!

      I currently test on SU 7, SU 8, SU 2013 and SU 2014. The work around is easy enough.

      posted in Developers' Forum
      G
      Garry K
    • RE: Storing Geometry

      It seems wrong but it appears to work better if I load the component definition outside of the start_operation / commit operation. Anyway - I will continue doing it this way until someone comes up with another idea to try.

      posted in Developers' Forum
      G
      Garry K
    • RE: Storing Geometry

      I've got this working now however there is one thing I'm wondering about.

      If I add 3 doors that use the same door handle, each within their own commit.
      I undo once and the last door disappears. I undo a second time and the same thing happens.
      So far so good!.

      But then I need to undo several times to remove the first door. It appears that loading the handle component within the start_operation / commit sequence breaks the sequence but just for the door where we go to disk. As long as the definition is already in the model then it behaves as expected.

      posted in Developers' Forum
      G
      Garry K
    • 1 / 1