sketchucation logo sketchucation
    • Login
    ⚠️ Attention | Having issues with Sketchucation Tools 5? Report Here

    Is there a way to judge a edge is through face or not?

    Scheduled Pinned Locked Moved Newbie Forum
    sketchup
    12 Posts 6 Posters 488 Views 6 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.
    • Dave RD Offline
      Dave R
      last edited by

      What is it you really want to know about it? You should be able to orbit around and see that the edge passes through the face.

      Why would you need a plugin to see this?

      Etaoin Shrdlu

      %

      (THERE'S NO PLACE LIKE)

      G28 X0.0 Y0.0 Z0.0

      M30

      %

      1 Reply Last reply Reply Quote 0
      • Y Offline
        YoungOSG
        last edited by

        @dave r said:

        What is it you really want to know about it? You should be able to orbit around and see that the edge passes through the face.

        I mean have any plugins to do it?

        1 Reply Last reply Reply Quote 0
        • Dave RD Offline
          Dave R
          last edited by

          As I already asked, why do you need a plugin to see if the edge passes through the face?

          Maybe you could explain what you really need to do.

          Etaoin Shrdlu

          %

          (THERE'S NO PLACE LIKE)

          G28 X0.0 Y0.0 Z0.0

          M30

          %

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

            @youngosg said:

            I mean have any plugins to do it?

            Probably not but would be easy enough to create one. How would want it to work?

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

            http://sdmitch.blogspot.com/

            1 Reply Last reply Reply Quote 0
            • Y Offline
              YoungOSG
              last edited by

              @sdmitch said:

              @youngosg said:

              I mean have any plugins to do it?

              Probably not but would be easy enough to create one. How would want it to work?

              i have a cube . and i konw the center of the cube ,and a point outside the cube. connect this two point , i want to konw which face will be through?

              1 Reply Last reply Reply Quote 0
              • Y Offline
                YoungOSG
                last edited by

                @dave r said:

                As I already asked, why do you need a plugin to see if the edge passes through the face?

                Maybe you could explain what you really need to do.

                i have a cube . and i konw the center of the cube ,and a point outside the cube. connect this two point , i want to konw which face will be through?

                1 Reply Last reply Reply Quote 0
                • TIGT Offline
                  TIG Moderator
                  last edited by

                  Simple way. πŸ€“
                  Get the ' vector' from the center-point [ point1] to the other external-point [ point2].
                  vector = point1.vector_to(point2)
                  Now do a ' raytest': using...
                  raytest = Sketchup.active_model.raytest([point1, vector])
                  The ' raytest' will be nil if nothing is hit, BUT since you say there is always geometry surrounding point1 that should never occur.
                  So it succeeds and returns an array with two elements: raytest[0] is the point of intersection and the second element, raytest[1] is an array: that array contains the 'hits' in nested order - with any geometry listed last.
                  So the last item raytest[1][-1] is a reference to the 'face' that is intersected.
                  Note that it might be an 'edge' if the points and geometry are such that the 'ray' passes through the intersection of two or more faces.
                  Other elements in that array [if any] represent the 'container' references - like group or component if applicable - these are in nested order...

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • Y Offline
                    YoungOSG
                    last edited by

                    @tig said:

                    Simple way. πŸ€“
                    Get the ' vector' from the center-point [ point1] to the other external-point [ point2].
                    vector = point1.vector_to(point2)
                    Now do a ' raytest': using...
                    raytest = Sketchup.active_model.raytest([point1, vector])
                    The ' raytest' will be nil if nothing is hit, BUT since you say there is always geometry surrounding point1 that should never occur.
                    So it succeeds and returns an array with two elements: raytest[0] is the point of intersection and the second element, raytest[1] is an array: that array contains the 'hits' in nested order - with any geometry listed last.
                    So the last item raytest[1][-1] is a reference to the 'face' that is intersected.
                    Note that it might be an 'edge' if the points and geometry are such that the 'ray' passes through the intersection of two or more faces.
                    Other elements in that array [if any] represent the 'container' references - like group or component if applicable - these are in nested order...

                    thanks.it works.

                    1 Reply Last reply Reply Quote 0
                    • cottyC Offline
                      cotty
                      last edited by

                      @tig said:

                      Simple way. πŸ€“
                      ...

                      Simple beginner questions need a simple answer πŸ˜†

                      my SketchUp gallery

                      1 Reply Last reply Reply Quote 0
                      • F Offline
                        fluffy82
                        last edited by

                        I would just draw a guideline through both points, no need for complicated scripts or plugins ^^

                        1 Reply Last reply Reply Quote 0
                        • TIGT Offline
                          TIG Moderator
                          last edited by

                          @fluffy82 said:

                          I would just draw a guideline through both points, no need for complicated scripts or plugins ^^
                          The OP did ask for a Plugin that did this...
                          But yes, there are many ways to judge this 'visually'...

                          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