Jump to content
Developer Wiki and Function Reference Links ×

Planar Boolean (Subtraction) in a wrapped script does not delete the orgininal components


Recommended Posts

Hi,

 

I have a problem using Planar Boolean (Subtraction) in a wrapped script in which the original components are not deleted.

I've seen this same topic in the forum but, because I cannot find the file attachments I cannot access to the solution.

I have attached the file with the script (Marionette object).

 

The subtraction operation happens in the Matboard wrapped script and it's supposed to generate a hole in the matboard through which the picture is supposed to be visible.

 

I will appreciate if somebody can provide the solution.

 

--Carlos

 

picture.vwx

Edited by gorrunyo
Link to comment

@gorrunyoHi, Basically what you have done is have all extrude from the same centre (I think) and the picture is in the middle of the backing board. So I raised the Z value a bit so it was above in the wrapper. One way to fix it is to raise the image up as i have done. The image has no thickness as far as I can see.

 

OK there must be an issue with the planer Boolean in this situation so I swapped it out and extruded the 2 sections first then use the Solid Boolean and this worked.

 

Boy a lot of work done here, I am impressed. :)

HTH

You might look at this post also.

 

 

Capture.JPG

Orig Image Location.JPG

Raised Image.JPG

Capture.JPG

Capture 001.JPG

picture_AW_001_v2016.vwx

Edited by Alan Woodwell
  • Like 1
Link to comment
  • Marionette Maven

@gorrunyo

 

The Planar Boolean subtract mode works just like the Modify -> Clip Surface command, which doesn't delete the original items.

The reason your 'delete' node isn't working when you attach it to the original rectangles is because those objects are no longer there. The Planar Boolean node itself is creating the new objects.

 

There are two simple ways you can do this differently to avoid this.

1) Instead of planar boolean, you can use the solid boolean node. In this option, you would want to extrude your rectangles individually first and then subtract one from the other.

2) You can index from the output of the planar boolean node to delete the 'hole' object. 

 

I've attached both examples.

 

 

picture_MFarrellEdit.vwx

SolidBoolean.PNGPlanarIndex.PNG

  • Like 1
Link to comment

Thanks Alan and Marissa, this is a good solution.

I wonder though what's the problem with the Planar Boolean. If you look at the python code:

#Subtract
elif self.Params.op.value == 1:
newObj = vs.ClipSurfaceN(blank, tool) # blank and tool won't be deleted after this operation
if newObj != vs.Handle(0) and newObj != None and newObj != tool:
	vs.Marionette_DisposeObj(blank)
	vs.Marionette_DisposeObj(tool)
	blank = newObj


I understand that vs.Marionette_DisposeObj() is supposed to delete the precursor objects at the end of the script execution (perhaps not).

 

P.S. Alan, the use of a 2D symbol as profile for the frame is a great addition. Thanks a lot.

 

Cheers

--Carlos

 

Edited by gorrunyo
Link to comment
  • Marionette Maven

The disposeobj in this scenario is deleting the source objects, pretty much the same as when you had the original rectangles attached to the delete node. (In a sense, you doing that marked them to be deleted twice)

 

The problem you were facing was that you wanted to delete one of the new objects generated by the planar boolean subtract node. The clipsurface function creates handles to two new objects, or more depending on how many objects you've attached to it, so in actuality the objects coming out of that node are the ones you need to pay attention to. That's what my planar boolean indexing example shows. 

Link to comment

@gorrunyoHi, take note of the rectangle node with its origin at its centre. This is not in the VW rollout. (Pretty sure as it came out mid 2016) the normal ones origin is the bottom left and its a bit of a pain if you want to have a few rectangles starting from the centre. Hang on to this one. Its in the picture frame_001 in the other post.

 

Capture.JPG

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...