sketchucation logo sketchucation
    • Login
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download

    No pushpull when touching ????

    Scheduled Pinned Locked Moved Developers' Forum
    15 Posts 3 Posters 265 Views 3 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.
    • TIGT Offline
      TIG Moderator
      last edited by

      You are quite right! Another stupid typo from my copy/paste πŸ˜’ I must take more care... I only have a few seconds allocated to answer each post [that's my excuse πŸ˜‰ ]...
      OR to be exact, the code could be

      krvFlade = gents.add_face(gents.add_circle([0,0,0], [0,0,-1], diameter.to_f/2, 48))
      

      because we've made a reference to grp1 entities named ' gents' πŸ˜„

      At least you understand the concept behind what I was [trying to] show !
      That is - make the connected geometry [all off it 😳 ] inside a group to avoid it interfering with layer creations that can be inside their own groups...

      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

      1 Reply Last reply Reply Quote 0
      • K Offline
        ksor
        last edited by

        @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
        • TIGT Offline
          TIG Moderator
          last edited by

          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

            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
            • TIGT Offline
              TIG Moderator
              last edited by

              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

                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
                • TIGT Offline
                  TIG Moderator
                  last edited by

                  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

                    @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
                    • Dan RathbunD Offline
                      Dan Rathbun
                      last edited by

                      @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
                      • TIGT Offline
                        TIG Moderator
                        last edited by

                        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
                        • Dan RathbunD Offline
                          Dan Rathbun
                          last edited by

                          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
                          • TIGT Offline
                            TIG Moderator
                            last edited by

                            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
                            • First post
                              Last post
                            Buy SketchPlus
                            Buy SUbD
                            Buy WrapR
                            Buy eBook
                            Buy Modelur
                            Buy Vertex Tools
                            Buy SketchCuisine
                            Buy FormFonts

                            Advertisement