• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

No pushpull when touching ????

Scheduled Pinned Locked Moved Developers' Forum
15 Posts 3 Posters 185 Views
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.
  • K Offline
    ksor
    last edited by 13 Feb 2012, 10:46

    @tig said:

    PS: I'm not clear why you need to use diameter.to_f/2 when making the circle, because you can [should] initially set/get/pass ' diameter' as a length so then there's no need to mess on with it later, since halving it as a length will work without changing its class:?

    I get a DIAMETER from the inputbox, but the circle method needs a RADIUS - that's why ...

    but maybe I should call the argument 'radius' and make the calculation in the call instead.

    Best regards
    KSor, Denmark
    Skype: keldsor

    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 13 Feb 2012, 11:12

      NO, you miss my point.
      I understand the input in the dialog is a 'diameter' BUT because it's already a ' length' as you set it to say 100.mm initially you don't need to do the .to_f step...
      Dividing a 'length' by 2 is fine - it returns a new 'length' half as big.

      TIG

      1 Reply Last reply Reply Quote 0
      • K Offline
        ksor
        last edited by 13 Feb 2012, 12:55

        OK - now I can make those two parts of the pulley - the wheel and the cylinder - as two separate groups !

        Now I want to drill a hole through BOTH of them for the shaft - but I can't because they are different groups !

        I think I'll have to make a third group for the hole because of the pushpull won't work if the "beginning circle" is made on the buttom of the cylinder (like my problems makeing the cylinder under the pulley !) and that's making it all even worse !

        It can't be true it is SO sofisticated to do such trivial things !

        I thing I need a sample code for:

        1. making a hole in a cylinder for a shaft
        2. sort of moving all entities from one group X into another group Y - maybe as a sub-group in group Y or just "entities" in group Y

        I cant find samples out there - do you have any links ?

        Best regards
        KSor, Denmark
        Skype: keldsor

        1 Reply Last reply Reply Quote 0
        • T Offline
          TIG Moderator
          last edited by 13 Feb 2012, 14:19

          Why not spend a few minutes to work out the cross-section of the pulley+axle+hole as a profile face... then do a FollowMme around [any] circle ?
          That way it's all done in one go...
          Sometime you need to break down what you are doing into separate steps, other times doing it all in one go proves to be the best...
          Like you might do 'by hand', which will prove better than making all of the separate parts and combining them later...Capture.PNG

          TIG

          1 Reply Last reply Reply Quote 0
          • K Offline
            ksor
            last edited by 13 Feb 2012, 14:44

            Of cause I do !

            But then I DON'T find out - how to build up a group bit by bit and it could be nice too.

            But I'll finish my pulley script with your idea !

            Best regards
            KSor, Denmark
            Skype: keldsor

            1 Reply Last reply Reply Quote 0
            • T Offline
              TIG Moderator
              last edited by 13 Feb 2012, 15:49

              If you want to build it up in parts you can.
              I suggest you make a container group that holds all of the sub-groups.
              Then when you explode sub-groups the geometry still stays inside the 'container'.
              IF you have a reference to a face or can get a reference to it later [perhaps from face.classify_point()] then creating a circle on the face and pushpulling it through to the other side of the object [you know the 'thickness ?] is quite possible and should then leave the 'hole'...

              Why not do a simple 'practice' on a dead simple box with a smaller square drawn on it, that is then extruded through the box by exactly the box's thickness to leave a hole...

              TIG

              1 Reply Last reply Reply Quote 0
              • K Offline
                ksor
                last edited by 13 Feb 2012, 15:52

                @tig said:

                If you want to build it up in parts you can.
                I suggest you make a container group that holds all of the sub-groups.
                Then when you explode sub-groups the geometry still stays inside the 'container'.
                IF you have a reference to a face or can get a reference to it later [perhaps from face.classify_point()] then creating a circle on the face and pushpulling it through to the other side of the object [you know the 'thickness ?] is quite possible and should then leave the 'hole'...

                Why not do a simple 'practice' on a dead simple box with a smaller square drawn on it, that is then extruded through the box by exactly the box's thickness to leave a hole...

                Yeah,I'll give it a try - thx

                Best regards
                KSor, Denmark
                Skype: keldsor

                1 Reply Last reply Reply Quote 0
                • D Offline
                  Dan Rathbun
                  last edited by 13 Feb 2012, 17:11

                  @tig said:

                  PS: I'm not clear why you need to use diameter.to_f/2 when making the circle, because you can [should] initially set/get/pass ' diameter' ***** as a length ***** so then there's no need to mess on with it later, since halving it ***** as a length ***** will work without changing its class:?

                  @TIG.. you're confusing him.

                  It's class **Length** ... and the method to use is diameter.to_l .. so rephrase as:

                  @unknownuser said:

                  PS: I'm not clear why you need to use diameter.to_f/2 when making the circle, because you can [should] initially set/get/pass ' diameter' as a Length class object,
                  diameter = diameter.to_l
                  ... so then there's no need to mess on with it later, since halving it as a Length instance, will work without changing its class. (FYI: Length is a subclass of Float class.)

                  @Keld: see the API's entry for the Length and Numeric classes.

                  I'm not here much anymore.

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    TIG Moderator
                    last edited by 13 Feb 2012, 18:34

                    No Dan... you need the 'back-story'... in his dialog the default value for diameter is already predetermined to be a 'length' [say 100.mm ] - or it ought to be!
                    So any new value he types in stays a 'length' e.g. 150.mm
                    Therefore to find half of it to use as a radius he divides it by 2.
                    He does not need to convert the diameter into a 'float' [.to_f] OR to a 'length' [.to_l] or into anything else for that matter - it's already 'the right type' [a 'length'] and he can use it directly in his methods...
                    What I said stands.

                    TIG

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      Dan Rathbun
                      last edited by 13 Feb 2012, 20:10

                      So does what I said.. the class name begins with a capital, as ALL class identifiers do.

                      HE was not understanding that you meant the Ruby Length class... he thought it was the plain old English word length. (Re-read his responce.)

                      I know he doesn't need to use .to_f ...
                      That's why at the end, I said that "FYI: Length is a subclass of Float class."

                      But.. excuse for chiming in ... he's confused enuff already.. I will bow out. Sorry, if I got yur dander up, there TIG.

                      I'm not here much anymore.

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        TIG Moderator
                        last edited by 13 Feb 2012, 20:18

                        I did put it in Ruby red to stress it was somehow 'special' without going into the added confusion of 'classes' - with an example to explain it too...
                        OK it maybe ought to have a 'capital-letter', but we all say float not **F**loat quite a lot too without much of an issue !
                        But no dander is up [yet]... 😉

                        TIG

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

                        Advertisement