• Login
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.
  • M Offline
    medeek
    last edited by 7 Mar 2017, 23:07

    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
    • D Offline
      Dan Rathbun
      last edited by 8 Mar 2017, 20:05

      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
      • M Offline
        medeek
        last edited by 10 Mar 2017, 01:54

        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
        • S Offline
          sdmitch
          last edited by 10 Mar 2017, 12:54

          @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
          • M Offline
            medeek
            last edited by 10 Mar 2017, 15:13

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

            Advertisement