sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    How to check if two ComponentInstances are in contact?

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 250 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.
    • R Offline
      rahulnejanawar
      last edited by

      Hi,
      Is it possible to know if a given ComponentInstance is in contact (touching) with another Component Instance? If yes, which Face is in contact?
      (Given that my ComponentInstance is an rectangle box as shown in the attached image)

      Consider the attached image. B is in contact with A. The bottom Face of B is the Face that is in contact. If these two ComponentInstances (A & B) are ‘selected’ can I programmatically get the bottom Face object of B? And top Face object of A?
      d1.jpg
      I tried the glued_to method on the ComponentInstance but that seems to mean(do) something different from what I want to achieve.

      Your help is appreciated.

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

        In a simple example like two boxes stacked up you could look at their 'bounds'.
        There are several 'points' that can be retrieved and compared in a bounding-box...

        Also, as there are 6 faces in one container get the normal and plane of each in turn and compare them with normal/plane of the other 6 faces inside the other container.
        You need to get the containers' transformations and apply those to each normal/plane i.e. a [point,vector] in case they do not share a common transformation [which is very likely!]...

        Then if the plane is the same, or the same with a reversed normal vector you know one face in each of the containers is 'coplanar' with the other...

        TIG

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

          Thank you sir.

          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