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
    • RE: Curved Staircases

      I've been busy working on handrail and deciding how to handle it.

      I'm thinking of having a drop down list for handrail styles. So just pick one.

      Additionally - I'm thinking to add a new handrail profile to the list - you provide the model with a handrail profile and set the top center of the handrail at the origin and select it before running the stair builder plugin. The plugin would then ask you to give a name for the new handrail profile ( you could cancel at that time ). If you provide a name then I would save the profile to disk using the name as part of the file name. Next startup I will read in the file names and add it to the list.


      Curved stair with handrails

      posted in Woodworking
      G
      Garry K
    • RE: Co planar test

      oops - I didn't mean to upload the same image twice.


      twisted 2.JPG

      posted in Developers' Forum
      G
      Garry K
    • RE: Co planar test

      Thanks Jolran,

      Believe it or not I have it working. But it is slower than I would like.
      The times includes coding the softening edges.

      What is interesting is that if I use this it takes 24 seconds
      model.start_operation "curved rail"
      ...
      model.commit_operation

      If I omit the start_operation and commit_operation then it takes 8 seconds.

      This handrail has 39 sections through 270 degrees and a total rise of 2660 mm

      BTW - I changed my approach and the reversed face issue went away. I was happily surprised

      I will start playing around with the mesh stuff


      curved and twisted rail


      curved rail zoomed in

      posted in Developers' Forum
      G
      Garry K
    • RE: Co planar test

      Jolran, I am not going to do a push pull on the handrail. The reason is the handrail is going to be curving and twisting and may change pitch. Then there would be way too much cleanup.

      It might be possible to create a section of handrail, copy it, move it, rotate it and try to scale it - but me poor brain gets stretched just thinking about it.

      Thomas, when you say "direction of the face normal depends on the order", are you talking about clockwise / counter clockwise for the faces outer loop? We use to refer to this as the "winding". This goes back to GIS rendering using Windows GDI etc.

      I am curious about using a mesh. So far I haven't got that to work. I have searched the internet but haven't found any real good information explaining the do's, don'ts and why's. I'd love a simple example explaining what to do.

      As far as managing normal's of each face. If you have 2 faces that have a common edge - is there some relationship between the 2 faces that one could use to determine reverse or not reverse? Perhaps I need to understand what exactly is a normal. is it a vector that is perpendicular to the plane of the face?

      posted in Developers' Forum
      G
      Garry K
    • RE: Co planar test

      That code works well. I can now create the proper face polygons - either triangle or quad.

      My next challenge is that some faces are reversed. I haven't found anything to add into the script to orient faces.

      Here's a picture of the handrail segment thus far. Note that the 2 end's of the handrail are at different heights and at different angles.


      Handrail

      posted in Developers' Forum
      G
      Garry K
    • RE: Co planar test

      Thanks - this is exactly what I was looking for.

      posted in Developers' Forum
      G
      Garry K
    • Co planar test

      Is there a test that I can do on 4 points to determine if they are coplanar or not?

      What I want to do is fill in faces where 4 points may or may not be coplanar.

      If coplanar then just add_face

      If not coplanar then add_line between the points separating the area into 2 triangles.
      Then I can call add_face for each new triangle ( or maybe just call find_faces for the edge that is common between the 2 triangles).

      Are there any other ways to do this?

      posted in Developers' Forum
      G
      Garry K
    • RE: Combining Edges

      The next thing I need to do is take a handrail profile such as the image on the left which is a cross section of a handrail for level handrail.

      Then I want to create a sorted array of the edges used to describe the level handrail profile. - I'm thinking the outer_loop should work.

      Then I stretch the profile based on the slope of the handrail - just store the vertices in an array. After that I rotate the vertices the appropriate amount for the next section of handrail. Create edges that go from the first adjusted profile to the next section of profile.

      The catch is that these handrails may not have a consistent slope. There may be a small section of handrail that transitions from one slope to another. For instance there could be a tight radius for the inside stringer that has a steep slope and then over a couple of feet at the top of the stair the handrail levels out for level balcony handrail. This means that I have to adjust the profile for the handrail for each small section.

      I'm thinking of using the top center of the handrail for registration purposes. This makes sense to me as building codes talk about the height of the handrail for level rail and for stair rail. Residential codes are usually 36" for level handrail and 32" for stair rail - measured vertically up from the edge of the tread nosing. Commercial codes are usually 42" and 36" respectively. The top center is consistent regardless of the height of the rail profile.


      Handrail profile

      posted in Plugins
      G
      Garry K
    • RE: Combining Edges

      I've benchmarked with ordered and unordered edges.

      With unordered I'm getting NN with combine.rb and 2N*N with weld.rb.
      Most of what I want to do will be with mostly ordered edges.

      I wanted to test some of the underlying array operations and see if what I am familiar with in C/C++ has any similarity.

      I've worked with TList objects in C++ containing millions of pointers. Dropping an element from the middle of the list is fairly efficient. The array pointers are in contiguous memory so all that is needed is to perfrom a single memcpy and to decrement the count.

      Anyway - this works for me - I just wanted to share an alternative solution.

      posted in Plugins
      G
      Garry K
    • Combining Edges

      I wanted a routine that I can use in my stair maker that will convert individual connected edges into a polyline.

      I looked at weld.rb and I thought there is another way to weld things together more efficiently.

      I have a small benchmark file that I can upload if requested. It has 308 edges.

      running my combine.rb against it took this time.
      0.036
      0.037

      running weld.rb against it took this time.
      0.187
      0.197

      Please do note that I am currently not interested in a closed polyline. Nor am I interested in filling in faces.

      require 'sketchup.rb'

      def combine_edges()
      model = Sketchup.active_model
      entities = model.active_entities
      selection = model.selection

      edges = []	# array of user selected edges
      right = []	# right hand chain
      left = []       # left hand chain
      
      t = Time.now
      
      selection.each { |val| edges << val if ( val.typename == "Edge" ) }
      

      check to make sure user has selected at least 2 edges

      return UI.messagebox( "Please select at least 2 edges" ) if ( edges.length < 2 )
      

      remove first edge and split into both chains

      edge = edges.shift
      right << edge.end
      left << edge.start
      
      found = false
      

      loop through the edges and add to right or left chain

      while ( edges.length > 0 )
      	found = false
      
      	edges.each_with_index do |edge, idx|
      		if ( right.last == edge.start )
      			right << edge.end
      		elsif ( right.last == edge.end )
      			right << edge.start
      		elsif ( left.last == edge.start )
      			left << edge.end
      		elsif ( left.last == edge.end )
      			left << edge.start
      		else
      			next
      		end
      
      		found = true
      		edges[idx] = nil
      		break
      	end
      
      	edges.compact! if ( found )
      	return UI.messagebox( "Polyline requires all edges to connect. Please try again!" ) if ( ! found )
      end
      

      concatenate chains - since we pushed vertices on the left chain they are in reverse and need to be fixed

      left.reverse!
      left += right
      
      puts Time.now - t
      

      create the new polyline "curve", explode the container group and clear the selection

      model.start_operation "polyline"
      group = ( container = entities.add_group ).entities
      group.add_curve( left )
      container.explode
      model.commit_operation
      
      selection.clear
      

      end

      #-----------------------------------------------------------------------------
      if ( not file_loaded?( "combine.rb" ) )
      add_separator_to_menu( "Plugins" )
      UI.menu( "Plugins" ).add_item( "Combine Edges" ) { combine_edges() }
      file_loaded( "combine.rb" )
      end
      #-----------------------------------------------------------------------------

      posted in Plugins
      G
      Garry K
    • RE: [Plugin Library] LibFredo6 - v15.4d - 14 Aug 25

      Fredo,

      I've been playing around with the settings to see if I can get the rounding of a curved and twisted handrail to work a bit better. I am looking for a 6 facet 1/2" corner round.

      I'm running 2.5a Round Corner along with 5.2a library - on Sketchup 7 and 8

      It appears that a very tiny triangle isn't being turned into a face during the round Corner operation ( just a guess )

      I can pick the three edges and use Utility Make Face and it does turn it into a face.

      Any suggestions? any settings that I need to change?


      Curved and twisted handrail


      Holes in Rail


      A few edited holes

      posted in Plugins
      G
      Garry K
    • RE: Add_face gives error duplicate point in array

      In this example I increased the width of the stringer which results in a small triangle that you can see. Width is 304 mm.

      Where the sketchup error occurs the stringer width was 300 mm and the small triangle would not be visible at this zoom.

      What I have done for now, which works in these type of situations, is simply use a rescue block. I would normally consider this bad form as it can hide errors. This code only works on the last section when the stair has a heel and when we should have a triangle. The sketchup error was misleading and cost me a bit of time trying to track this down.

      begin
      # try to add the face
      ent.add_face( pts )
      rescue
      puts( pts ) if ( debug_level > 0 )
      end

      Any thoughts on this?


      Illustrates Collinear issue

      posted in Developers' Forum
      G
      Garry K
    • RE: Curved Staircases

      I have one type of flare working. I call this the continuous flare where every tread is flared by the same amount. Set Flare treads equal to the number of treads on the stair and Set the Flare amount to what you are interested in.


      Continuous Flare

      posted in Woodworking
      G
      Garry K
    • RE: Add_face gives error duplicate point in array

      OK - the first situation with duplicate point in array error has been handled.

      Now I get something a bit different

      Adding these points to a face I get

      (-96.638256mm, 2398.053596mm, 2351.973324mm)
      (-96.678788mm, 2398.051144mm, 2352mm)
      (-96.638256mm, 2398.053596mm, 2352mm)

      Error: #<ArgumentError: Points are not planar>

      I have read some old threads some time in 2008 where someone got the same error and it was suggested that this error should actually say something like : Points are collinear.

      Does anyone know what the tolerance for collinearity is:

      Doing the math - none of these three points would be considered as duplicate as the distance between each exceeds the 1/1000 of an inch.

      Also - if it is suggested to use a PolygonMesh - I have tried - but haven't got it to work. A working example would be appreciated !!

      posted in Developers' Forum
      G
      Garry K
    • RE: Curved Staircases

      Calvin,

      Did you by any chance go to my web site? CabMaker32.com.

      I am a big advocate on the 32 mmm construction system. You can build very good looking cabinets using these guidelines.

      I can also give you many reasons why you will become very efficient. This system is scaleable. So if you are a one man operation or a much larger company you would have to make some tooling choices.

      Anyway - if you are interested - we can continue this. We can also take it off line if you wish.

      posted in Woodworking
      G
      Garry K
    • RE: Curved Staircases

      I call the top of the stringer that continues under the floor the heel. There is now an option for "has heel". I've also added in tread bullnose.

      I've added building code information into the defaults.txt file. Minimum Rise, Maximum Rise, Minimum Run, Maximum Run, Minimum Stair Width etc. The defaults are currently set to Canadian National Building code but can be modified for your own area.

      The stair maker plugin uses these values to adjust things like number of Risers so that the stair will still meet code.

      I've also added in more 0 value settings. If one of the following 3 values is set to 0 then it will be calculated. So you only need 2 of these: 1) degrees, radius, Run at walk line.

      I've also added in a setting in the defaults.txt file to finish off housed stringer(s) at a certain height above the floor. I set it to 12.7mm in the picture.

      You can run the Stair Maker a second time set as if you are creating a handrail (0 riser and tread thickness, housed inside stringer and no outside stringer ). Adjust the radius by the thickness of your stairs inside stringer. Adjust the thickness of the inside stringer (handrail) to the width of the stair minus the thickness of both stair stringers. This creates a square tube that can be edited and pulled straight downwards ( on blue axis ) to form a finished stair bottom.


      Stair Input Box


      Stair heel


      Finished bottom

      posted in Woodworking
      G
      Garry K
    • RE: Creating revenue from plugins

      As far as relying on donations. I've in agreement with you that very few people will actually donate - hopefully I am wrong - at least as it pertains to all those authors relying on that model.

      I can say this - I have my own web site which has cabinet making software under trial. I have a 1 second nag screen when the software starts up and it works with a 30 day trial. So far I have it set up that each update resets the trial back to 30 days. I can track downloads by IP address ( although I don't know who they are since I have not asked anyone to register ).

      What is really interesting is the number of people who have gone back to the site to download a new version. I see download audit trail for IP address like 0 days, 31 days, 61 days, 91 days etc. These people continue using the trial version and haven't bothered to contact me or pay.

      As far as intellectual property rights go - big subject. All through my career I have made a point of developing tools / routines myself. This is to avoid a number of problems including version issues, upgrade issues, compatibility issues with other 3rd party tools etc. Some vendors cap off their software and do not provide solutions when you move to a newer compiler. Having said that - I have licensed current versions of my compiler but still continue to use an older one.

      OK - who owns what. We could go on to say that since a lot of us went to school - the prof taught us solutions to many problems. Are they going to sue us? Many forums have very knowledgeable people who do act like teachers. This all gets blurry. There is also the issue where we learn things on other platforms and bring that knowledge here. Does that mean that ESRI owns ideas such as TIN ( Triangulated Irregular Networks ) as they have been at this a long long time. Or what about Dr Franklin or Paul Rourke - they both brought a lot of interesting concepts and solutions to 3D spatial geometry.

      And ...

      posted in Developers' Forum
      G
      Garry K
    • RE: Creating revenue from plugins

      For the rbs files - download the utility and run it. I created a simple windows batch file to simplify the process. I placed the SketchUpRubyScramblerWindows.exe in a location and scramble a couple of the scripts for my DoorMaker.

      All this does is prevent users from reading the script. Beyond that, the script behaves exactly as if it were readable text.

      This does not prevent people from running the script without paying for it.

      c:\src\SketchUpRubyScramblerWindows.exe c:\src\cabmaker\cabmakerlib.rb
      c:\src\SketchUpRubyScramblerWindows.exe c:\src\cabmaker\cabmaker.rb

      xcopy "c:\src\cabmaker\cabmakerlib.rbs" "C:\Program Files (x86)\Google\Google SketchUp 7\Plugins\GKWare\CabMaker" /Y
      xcopy "c:\src\cabmaker\cabmaker.rbs" "C:\Program Files (x86)\Google\Google SketchUp 7\Plugins\GKWare\CabMaker" /Y
      xcopy "c:\src\cabmaker\cabmaker_loader.rb" "C:\Program Files (x86)\Google\Google SketchUp 7\Plugins\GKWare\CabMaker" /Y
      xcopy "c:\src\cabmaker\gkware_cabmaker_ext.rb" "C:\Program Files (x86)\Google\Google SketchUp 7\Plugins" /Y

      I like some of your ideas - the free and pro version idea should help a bit in the marketing area. Of course running 2 versions will complicate maintaining the code.

      The plugin store model might work for the pro version - It certainly works for the free version complete with donations.

      There are some articles on the Apple Store model which is similiar - and has 2 sales models - one for commercial use and one for private use.

      posted in Developers' Forum
      G
      Garry K
    • RE: Curved Staircases

      I've got the cleanup working to simulate stringer routing for housed stringers.
      I'm going to add a configuration variable so that you can adjust the height of the housed stringer. There may be times when you want the housed stringer higher - so more of the stringer would be visible above the treads.

      Next step is to see what I can do about bullnosing the treads. I'll add the bullnose radius to the input box.

      After that I'm going to look at flaring the treads. I'm thinking that a progressive flair of a flair amount like 1/2" might work well. Say you want to flare the bottom 6 treads - you would end up with the bottom tread flared out by 3", the one before at 2 1/2" etc.

      Then add straightening of the outside stringer at top, bottom or both and optional straightening of the inside stringer.

      There is also the idea of what I call a notch - this is where the stair starts out between 1 or 2 walls and part way down the stair one or both walls are now only below the stair - allowing for spindle railing. In this case the stair gets wider by the appropriate amount based on the thickness of the wall and the type of stringer.

      Any comments?


      cleanup of routed stringer

      posted in Woodworking
      G
      Garry K
    • Creating revenue from plugins

      To protect my plugin I am distributing the sketchup ruby script as an *.rbs

      My question here is how well has the plugin store worked for people as far as receiving some money for the efforts. A lot of plugins are free and developers rely on donations. Does that actually work?

      Is there a generally accepted way of setting up a plugin with a time trial?

      I imagine that there are a lot of mixed thoughts on this.

      posted in Developers' Forum
      G
      Garry K
    • 1
    • 2
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 46 / 49