Subtraction with Intersect Method
-
Has anyone ever tried using the intersect method to perform boolean subtraction of two solids?
http://ruby.sketchup.com/Sketchup/ComponentInstance.html#intersect-instance_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.
-
All Solid Tools boolean API methods are Pro only. (This used to be indicated in the docs.)
-
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'
-
@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)
-
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.
Advertisement