sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Staircase builder - strange scaling behaviour - Help!

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 2 Posters 1.1k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      Deanby7
      last edited by

      I'm trying to debug my staircase builder. When constructing a staircase with winders I've opted to apply a transformation scaling on the whole staircase group in the XY plane to size the staircase to the user input stair width. This produces unexpected scaling results with some elements scaling too little and others too much! I apply the same technique to change to righthand staircase. The script builds a lefthand staircase and the transformation changes it to a righthand one. This works fine!

      I've looked at this for a few days now and can't see how to put this right.

      Stairbug.gif illustrates the problem.
      stairhand.gif illustrates a build of a righthand staircase with success.

      The script is attached, if anyone fancies a challenge! πŸ˜„

      Here's hoping!!!


      db1stairbuilder.rb


      Stairbug.gif


      stairhand.gif

      1 Reply Last reply Reply Quote 0
      • sdmitchS Offline
        sdmitch
        last edited by

                          #scale up/down all parameters if specifying a non 900mm wide staircase with winders.
                          if (@turns == "Winders") && (@wid !=900.mm)
                            scf = 900.mm / @wid;
                            iscf = @wid / 900.mm;
                            @ris = @ris * scf
                            @nos = @nos * scf
                            @stg = @stg * scf
                            @wid = 900.mm
                            @width = @wid - (@stg * 2) #<----- The only change needed
                            goscale = true
                          end
        
        

        StairBuilder.gif

        Nothing is worthless, it can always be used as a bad example.

        http://sdmitch.blogspot.com/

        1 Reply Last reply Reply Quote 0
        • D Offline
          Deanby7
          last edited by

          Thanks for input. I've decided to rewrite the code as the tread "goings" get distorted a bit when scaling the staircase. I should've realised using the transformation scaling was too easy a solution!!

          1 Reply Last reply Reply Quote 0
          • D Offline
            Deanby7
            last edited by

            Staircase builder fixed!


            Fixed!

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement