Subtraction with Intersect Method

Subtraction with Intersect Method

Postby medeek » Wed Mar 08, 2017 12:07 am

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

http://ruby.sketchup.com/Sketchup/Compo ... nce_method

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.
0
Nathaniel P. Wilkerson PE
Medeek Engineering Inc
design.medeek.com
User avatar
medeek 
PluginStore Author
PluginStore Author
 

Re: Subtraction with Intersect Method

Postby Dan Rathbun » Wed Mar 08, 2017 9:05 pm

All Solid Tools boolean API methods are Pro only. (This used to be indicated in the docs.)
0
    I'm not here much anymore. But a PM will fire email notifications.
    User avatar
    Dan Rathbun 
    PluginStore Author
    PluginStore Author
     

    Re: Subtraction with Intersect Method

    Postby medeek » Fri Mar 10, 2017 2:54 am

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


    Code: Select all
    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:

    Code: Select all
    Error: #<NoMethodError: undefined method `intersect_with' for #<Sketchup::Group:0x0000000dd92350>>
    <main>:in `<main>'
    SketchUp:1:in `eval'
    0
    Nathaniel P. Wilkerson PE
    Medeek Engineering Inc
    design.medeek.com
    User avatar
    medeek 
    PluginStore Author
    PluginStore Author
     

    Re: Subtraction with Intersect Method

    Postby sdmitch » Fri Mar 10, 2017 1:54 pm

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


    Code: Select all
    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:

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


    .intersect_with needs the group.entities

    Code: Select all
    group1.entities.intersect_with(false, trans1, group1.entities, trans1, false, group2)
    0
    Nothing is worthless, it can always be used as a bad example.

    http://sdmitch.blogspot.com/
    User avatar
    sdmitch 
    PluginStore Author
    PluginStore Author
     

    Re: Subtraction with Intersect Method

    Postby medeek » Fri Mar 10, 2017 4:13 pm

    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.
    0
    Nathaniel P. Wilkerson PE
    Medeek Engineering Inc
    design.medeek.com
    User avatar
    medeek 
    PluginStore Author
    PluginStore Author
     

    SketchUcation One-Liner Adverts

    by Ad Machine » 5 minutes ago



    Ad Machine 
    Robot
     



     

    Return to Developers' Forum

    Who is online

    Users browsing this forum: Bing [Bot] and 7 guests

    Visit our sponsors: