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

    Subtraction with Intersect Method

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 3 Posters 1.7k 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.
    • medeekM Offline
      medeek
      last edited by

      Has anyone ever tried using the intersect method to perform boolean subtraction of two solids?

      Link Preview Image
      Class: Sketchup::ComponentInstance

      The Sketchup::ComponentInstance class is used to represent component instances of a component definition or components that have been dragged from the Component Browser and placed (thus, instanced) within the Model.

      favicon

      SketchUp Ruby API Documentation (ruby.sketchup.com)

      I really need to do boolean subtraction on some new modules I'm working on but I want to make sure I'm compatible with SketchUp Make and not force the user to go to Pro if I don't have to.

      Nathaniel P. Wilkerson PE
      Medeek Engineering Inc
      design.medeek.com

      1 Reply Last reply Reply Quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        All Solid Tools boolean API methods are Pro only. (This used to be indicated in the docs.)

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • medeekM Offline
          medeek
          last edited by

          I have to intersecting cubes in my model. I then run this ruby code:

          group1 = entities[0]
          group2 = entities[1]
          trans1 = group1.transformation
          trans2 = group2.transformation
          group1.intersect_with(false, trans2, group1, trans1, false, group2)
          

          Which then gives the following error:

          
          Error; #<NoMethodError; undefined method `intersect_with' for #<Sketchup;;Group;0x0000000dd92350>>
          <main>;in `<main>'
          SketchUp;1;in `eval'
          

          Nathaniel P. Wilkerson PE
          Medeek Engineering Inc
          design.medeek.com

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

            @medeek said:

            I have to intersecting cubes in my model. I then run this ruby code:

            group1 = entities[0]
            > group2 = entities[1]
            > trans1 = group1.transformation
            > trans2 = group2.transformation
            > group1.intersect_with(false, trans2, group1, trans1, false, group2)
            

            Which then gives the following error:

            
            > Error; #<NoMethodError; undefined method `intersect_with' for #<Sketchup;;Group;0x0000000dd92350>>
            > <main>;in `<main>'
            > SketchUp;1;in `eval'
            

            .intersect_with needs the group.entities

            group1.entities.intersect_with(false, trans1, group1.entities, trans1, false, group2)
            

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

            http://sdmitch.blogspot.com/

            1 Reply Last reply Reply Quote 0
            • medeekM Offline
              medeek
              last edited by

              Got it. Thank-you Sdmitch. As always your guidance with the syntax is impeccable. Even after a year I'm still feel like a bull in a china shop

              I'm still a bit of a ways away from a boolean subtraction but at least I have something to work with now.

              Nathaniel P. Wilkerson PE
              Medeek Engineering Inc
              design.medeek.com

              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