Subtraction with Intersect Method
-
Has anyone ever tried using the intersect method to perform boolean subtraction of two solids?
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.
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.
-
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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement