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: Add_face gives error duplicate point in array

      There are a few things we do when dealing with floating point, especially during reporting.

      For instance, you have a report that sums up a lot of floating point values all coming out of a data base. What I do is make sure that I round all data going into the database to x decimals. Consider this your tolerance. If it is money in US dollars that is being reported to 2 decimal places then I store to 3. Every time I perform a math operation on the data - I round it. This ensures that if you add up items individually in the report that they sum up properly.

      Essentially this is the same thing. SU must store the data after internally rounding it in 3D space.

      I've also worked with a lot of raw GPS device. We needed to apply logic to reduce wander while vehicles are stopped. Otherwise the vehicles would accumulate small amounts of movement over time. Sitting in traffic in urban canyons ( tall buildings ) has its own challenges.

      I digress. In this case I push Point3D values into an array - or collection. Essentially perform rounding by testing for equivalency. I also needed to work with Point3D values so that intersect_line_line etc. work properly.

      posted in Developers' Forum
      G
      Garry K
    • RE: Add_face gives error duplicate point in array

      You see where the stringer transitions and meets the floor. It just happens that the transition point is just about at the same place where the 2 faces meet.

      Most of the time it is more like the outside stringer on the second picture. Here I need the point.


      Where stringer meets the floor


      Other side

      posted in Developers' Forum
      G
      Garry K
    • RE: Add_face gives error duplicate point in array

      I don't really know - but there are about 130 faces for a basic curved stair and I only have to test this for 2 of those 130 faces. This seems to work really well now - unless I'm missing something.

      posted in Developers' Forum
      G
      Garry K
    • RE: Add_face gives error duplicate point in array

      Huh what do you know.

      I checked for equivalency and it appears that it is now working.
      == has a special meaning for Point3D

      This uses the standard SketchUp tolerance to determine if two points are the same.

      sec.clear
      sec << pt[0]
      sec << pt[1] if ( pt[0] != pt[1] )
      sec << pt[2]
      sec << pt[3]
      sec << pt[4]
      face = entities.add_face( sec )

      posted in Developers' Forum
      G
      Garry K
    • Add_face gives error duplicate point in array

      I have a script that performs math and creates side faces of curved stair case stringers.

      Some stringer radius's along with stringer widths give me a duplicate error. I can duplicate this error at will.

      However the points aren't truly duplicate - although they are very close.
      Is there a method or a generally accepted practice in detecting duplicates.
      I have identified a few conditions where I could test.
      I am running this in Sketchup 7

      (626.034052mm, 209.000876mm, 0mm)
      (626.025082mm, 209.024528mm, 0mm)
      (607.186433mm, 258.697963mm, 63.469778mm)
      (607.186433mm, 258.697963mm, 558.8mm)
      (626.034052mm, 209.000876mm, 495.3mm)
      Error: #<ArgumentError: Duplicate points in array>

      The second point is the culprit. Does anyone know how close 2 points can be without producing an error?

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

      You must be pretty fast. It was taking me the better part of a day to draw stairs. Perhaps because of the amount of detail that I was interested in.

      Did you view the You Tube video? What did you think of it? Do you have any suggestions or comments on what I have done so far? Have you been to my website?

      posted in Woodworking
      G
      Garry K
    • RE: Curved Staircases

      I have created a video on you tube
      http://www.youtube.com/watch?v=TQ94u6bpLq0

      posted in Woodworking
      G
      Garry K
    • RE: Curved Staircases

      Top nosing and extending housed stringers are now working.

      Here is a 180 degree housed, stair with open risers.

      To make the handrails I set both the Riser Thickness and Tread Thickness to 0. I then adjusted both stringer widths and stringer thicknesses to 90 mm. This tells the Stair Maker plugin to build handrails and have the tops of the rails at 800 mm above the nosings which is building code for indoor residential stairs.


      Stair and rail

      posted in Woodworking
      G
      Garry K
    • RE: Curved Staircases

      Here is what the stair_defaults.txt file looks like.


      stair_defaults.txt

      posted in Woodworking
      G
      Garry K
    • RE: Curved Staircases

      Plugin is at the next stage. Treads and Risers are finished. Notice that there are still some things to do. The Housed stringer at the bottom and at the top is not finished. I need to extend the housed stringer 2 X Nosing. Also the Nosing on the top riser is missing.

      I've added a floor thickness which currently makes the top riser board flush with the floor.

      Also added a stair_defaults.txt file which contains a few items that aren't controlled by the input box. Every entry in the input box has a metric and an imperial entry in the text file. So you will be able to set your own defaults like tread thickness and dado values etc.

      The Plugin does not bullnose (round over) the treads. I've use the Round Over 3D plugin to accomplish this task as it only takes a couple of minutes. For a sawtooth, housed stair with riser boards I first drew a vertical line on the back of tread 12.7mm from the inside curve.
      This is to control the extent of the round over. I then picked the edges that I wanted to round over and then performed the roundover. Notice that it does work properly where the riser board dado is. Just make sure that you pick the edges as in the picture.


      Curved Stair showing plugin input box


      Rounding over one tread component


      After rounding over

      posted in Woodworking
      G
      Garry K
    • RE: Curved Staircases

      Here is an unusual stair case. Anyone up for this challenge?


      1 unusual stair

      posted in Woodworking
      G
      Garry K
    • RE: Curved Staircases

      I had a bit of issue with some coding - but I believe that I am past that now.

      In the mean time. Here are 2 more stairs. The first one has a single center stringer that I set to 120 mm thick and 400 mm wide. The treads are 3 layers of 3/4 plywood glue laminated - so I set the tread thickness to 57 mm. I set the outside stringer to none so it wouldn't build it.

      Notice that I told the plugin 0 for riser thickness. I built the stair and then deleted the treads. I did add texture to the stringer and then when the treads were created I added texture to them and then I uses the round corners tool to ease all the treads to 1/2" bullnose.

      I ran the plugin a second time ( it remembered all my settings ) and changed the inside stringer to none as well as the inside. I then changed the inside radius to 2400 and built the stair without stringers on top of the first one.

      The second stair is an example of an outside concrete stair. In this case I set the outside stringer to none and turned of risers and treads by setting their corresponding thicknesses to 0.


      Center stringer


      Stair with 1 stringer


      Concrete stair

      posted in Woodworking
      G
      Garry K
    • RE: Rotate and Intersect a plane

      Sorry - I am not making myself clear. From a CAD point of view. What I have drawn are 2 lines that do not intersect.

      I initially assumed ( at 2:00 in the morning ) that the intersect_line_line method took 2 CAD lines as arguments.

      I now realize that the method wants 2 mathematical lines expressed as a ray and in this case will return a point because mathematically these CAD lines are simply 2 points on an infinite line and these 2 infinite lines do indeed intersect.

      All I was trying to do was find a method that would give me a point if the 2 lines that I drew cross each other.


      In CAD these are 2 lines

      posted in Developers' Forum
      G
      Garry K
    • RE: Rotate and Intersect a plane

      Thanks TIG.

      Ah - I see this could be handy if you have 2 lines and want to see where they would meet even if you have to extend one or both lines.

      Essentially if I want to determine if the point returned from intersect_line_line is on both lines - which answers the problem that I need to solve - then I have to perform an additional check to see if the resulting point is not nil and lies on the line.

      So I can rotate 2 points around the origin ( which is what I need to do ) and then convert the rotated edge to a vector.

      cos_theta = Math.cos( angle )
      sin_theta = Math.sin( angle )

      x3 = cos_theta * x1 - sin_theta * y1
      y3 = sin_theta * x1 + cos_theta * y1

      x4 = cos_theta * x2 - sin_theta * y2
      y4 = sin_theta * x2 + cos_theta * y2

      And since I want to rotate a vertical plane z stays as 0 and I simply pop in dx and dy of the edge for the vector and use the first point as is. Then I can use intersect_line_line

      posted in Developers' Forum
      G
      Garry K
    • RE: Rotate and Intersect a plane

      I should mention that I am planning on rotating the face. If there is a way to simply rotate a plane then that would even be better.

      posted in Developers' Forum
      G
      Garry K
    • Rotate and Intersect a plane

      I'm probably just too tired to see it - oh well.

      I first create a face which is parallel to the Y axis and offset 1/2"
      I then create a line and intersect the plane of the face.

      The line
      10.000000",0.000000",5.000000"
      10.000000",5.000000",5.000000"

      The plane
      -0.0
      1.0
      -0.0
      -0.5
      the result of the intersect
      (11", 0.5", 5.5")

      I was expecting ( 10", 0.5", 5" )
      It appears that the the plane may have its point at the origin.

      Here is the code

      y = 0.5.inch
      face = grp.entities.add_face( [[0,y,-10],[0,y,200],[200,y,200],[200,y,-10]] )

      p1 = [ 10.inch, 0.inch, 5.inch ]
      p2 = [ 10.inch, 5.inch, 5.inch ]
      line = [ p1, p2 ]
      p3 = Geom.intersect_line_plane( line, face.plane )

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

      Yes it sees what your setup is at startup and stays with that - metric or imperial.
      You are stuck with that choice until next startup.

      I've got the plugin working so there aren't any extra faces that need to be deleted.
      The soften tool shows that up in a hurry.

      I have the sawtooth working for open risers (set Riser Thickness to 0.inch or 0.mm). I need to adjust the sawtooth for risers that have thickness.

      The Stair width will be overall width of stair which includes the stringer thickness if housed and includes the tread overhang ( same amount as nosing ) if sawtooth.

      The only extra work that I have done so far is orient faces and apply the softening.
      Not a real big problem.

      I want to add in stringer feet and stringer heels which will represent a fair bit of work.

      So I'll probably go to treads next. I will create a curved tread as component and then copy rotate and move ( which I believe are transforms - I'll find out when I get there ).


      Curved Stair Plugin works in imperial.

      posted in Woodworking
      G
      Garry K
    • RE: Curved Staircases

      I have started to build the curved staircase plugin.

      Hopefully this shows you where I am going with it.
      The input box remembers your settings between uses while in the same session.
      I may include a text file of defaults that you can change so that your own defaults appear every time you start sketchup and run the Stair Maker.

      I plan to add an option so that your stair will straighten out for x treads at top and at bottom. The default will be 0 straight treads. You will also specify the run of the straight treads.

      Any feedback during this stage would be much appreciated.


      Curved Stair case plugin.

      posted in Woodworking
      G
      Garry K
    • RE: Curved Staircases

      I would call this stair a modified winder. As far as the Walk Line is concerned - you need to consider the outside edge of the handrail to a distance that is directly vertical between your legs. You also need to look at the speed of egress. This is considered to be moving quickly and moving down the stairs and thus out of the building. The slower that you walk the closer you are to the edge of the stair - the problem of safety is when you are moving quickly. You also have to consider larger people. These considerations dictated our walk line to be 20" from the outside edge.

      The trick is to build a safe stair - and one that is reasonably easy to build and also easy on the eyes.

      I would work out calculations to see if it was possible to have a consistent pitch at the inside stringer, the outside stringer and also at the walk line and all the while maintaining a safe stair. That is the challenge.

      posted in Woodworking
      G
      Garry K
    • RE: Curved Staircases

      As far as modeling goes - I was pretty impressed with the ease of use of IRender nxt.
      Here are a couple of models - a Kitchen and a couple of stairs.


      Drawn automatically with CabMaker32 and rendered with IRender nxt


      Rendered with IRender nxt


      Rendered with IRender nxt

      posted in Woodworking
      G
      Garry K
    • 1 / 1