Boolean difference - unable to perform between cylinder and corner of block

The attached model shows a cylinder (drill) and a block. I’m trying to use the cylinder to create a hole in the block. I select \Solid\Difference, then select the block, then select the cylinder. Rhino responds, “Unable to perform boolean difference.”

However, if I first offset the cylinder 0.001 in both the X and Y directions, then the boolean difference works correctly. However, the resulting hole is now offset 0.001 in both the X and Y directions which interferes with other requirements.

I thought this might be due to some tolerance setting in Document Properties. If so, I couldn’t figure it out.

The cylinder and block both have all outward pointing normals.

The following didn’t help –
Exploding the cylinder and then rejoining.
Offsetting the entire model from the Z axis.

The following checks didn’t report any problems with any objects –
Edge Tools\Show Naked Edges
Diagnostics\Select Bad Objects
Diagnostics\Show Broken Edges

IMPORTANT – This is Rhino 2. Perhaps this is a bug that was resolved in later versions?

Thanks,
Don C.

Boolean_difference_debug_10dx.3dm (79.1 KB)

Yes… works in the latest. You’ll probably just need to explode, trim join

-Pascal

I have tried exploding the cylinder and then joining. After I explode, I don’t see anything that I need to trim. Can you explain?

Hi Don - you may not need to explode - just trim the two objects to each other and then Join. I do not have v2 loaded it looks like, but that is what I’d try - it may also be that the
cap on the cutter can be replaced with a plane rather than a revolved surface and the boolean may work as well.
ExtractSrf, delete the small surface at the tip, and then run the Cap command.

-Pascal

The ExtractSrf approach worked. The problem is that the cutter is generated as part of a script by revolving a polyline. After the cutter has been generated I’m not sure how the script could automatically select the tip of the cutter for ExtractSrf (perhaps there is a clever way to identify and name this surface). Of course I could do this manually but I’d prefer not to.

I don’t understand “just trim the two objects to each other”. When I select \Edit\Trim it says “Select cutting objects”, whereby I select the cutter. It then says “Select object to trim” whereby I select the block. It then says “Splitting … press Esc to cancel”, then comes back with “Select object to trim”. It doesn’t appear to allow me to select the block. In any case, nothing happens as a result of these actions.

Are you using a different trim than I am?

Hi Don, I am using a different Rhino than you are - apparently trim works better through singularities. For your script - have it revolve the polyline except the last segment, if that is flat, then have it cap the result.

-Pascal

Pascal –

Your revolve suggestion works well.

A couple of related Rhino 2 script questions –

  1. After executing the revolve command, a dialog box pops up (see image). Is there a way for the script to set the “End angle” without having the dialog popup box so that the script runs without user intervention?

  2. Where it might be needed, can the script add a prompt – e.g., “Enter the length of the slot.”

  3. Is there a way to pause the script to observe the output. I want to do this after each of the following at the end of the script (for diagnostics).
    Volume
    ShowNakedEdges
    SelectBadObjects

Rhino__Revolve_options

Hi Don - this seems like a command macro - can you post what you have?

Any command that you prepend with ‘-’ runs without the dialog

-Revolve

for example.

-Pascal

Pascal –

Here is the part of a much longer script that relates to creating the stud drill –

“---------- Make stud drill ----------”
! selnone selname studdrillcrv invert lock
" Lock everything but studdrillcrv. Prevents accidental renaming of sellast (body)."
! setlayer layer=studdrill
selnone selname studdrillcrv
“Enter a revolve angle (360 degrees) …”
revolve w0,0,0 w0,0,1 enter enter
" User must manually enter the revolve angle (360 degrees)."
selnone sellast setobjectname studdrill
selnone selname studdrillcrv delete
setobjectname studdrill
! selnone selname studdrill
cap
" cap must be on separate line than selname in case selname falls through."
selnone selpolysrf setobjectname studdrill
! setlayer layer=construction
! unlock
“----------------------------------------------------------------------------------------”

The following line from above calls the Revolve Options dialog –

revolve w0,0,0 w0,0,1 enter enter

I want to call “revolve” for a 360 degree revolve without actually opening the Revolve Options dialog. The following didn’t work –

revolve w0,0,0 w0,0,1 360 enter enter

Hi Don - if the curve is preselected, try

-revolve w0,0,0 w0,0,1 360 enter enter

but… some actual RhinoScript, - as distinct from command macros - would make your life so much easier…

-Pascal

When I paste this into Rhino’s command line it says, “Unknown command:-revolve”

The Rhino 2 upgrade manual (p. 25) shows the following example for ArrayCrv –
ArrayCrv [Number=n | Distance=n] Style=[Roadlike | Freeform]
The manual says, "You could pass either Number=n or Distance=n to choose the first radio button. The Style radio buttons are selected with the other option.

I thought perhaps there might be similar parameters available for the revolve command. (BTW, this isn’t a major issue for me. I just thought I would inquire while discussing how to generate the cutter.)

My understanding of Rhino 2 is that the lines that I have listed above under “---------- Make stud drill ----------” are scripting lines. (There is a brief description in the Rhino 2 manual under “Command Scripting”, p. 25) I have created these in a text file (saved for later use). I then copy to the clipboard and paste into Rhino’s command line. Are these what you are calling “command macros”?