Brep.CreateFromOffsetFace documentation (loose option)

Hi @dale,

there seems to be an error in Rhino.Geometry.Brep.CreateFromOffsetFace documentation:

Use 0.0 to make a loose offset. Otherwise, the document’s absolute tolerance is usually sufficient.

When i try to do above using 0.0 as tolerance, Rhino 6 SR34 and Rhino 7 SR6 (Windows) both hang. Rhino 6 never comes back, Rhino 7 after +90s. I’ve found that using Rhino.RhinoMath.UnsetValue instead works to create a loose result.

thanks,
c.

Hi @clement,

As usual, I need a sample model and some sample code that I can run here to repeat.

Thanks,

– Dale

Hi @dale, sorry please find both below.

BrepCreateFromOffsetFaceExample.py (835 Bytes)
BrepCreateFromOffsetFaceExample.3dm (48.6 KB)

_
c.

Hey @clement,

I didn’t try V6. But V7 doesn’t hang with a tolerance of 0.0, albeit a slow calculation (~15 seconds on my venerable Surface Book 2). Why not use the document tolerance?

– Dale

Hi @dale, the offset is done within a realtime GUI and the result is displayed in a conduit while the user changes the offset distance with a slider. I therefore need it as instant as possible. The fastest offset i got using Rhino.RhinoMath.UnsetValue, 0.4s compared to eg. a tolerance of 0.1 it is 4 times faster. With 0.0 (loose ?) i got same results as you so i asumed the documentation is not right. Why should a loose offset take 15s on a single simple surface?

_
c.

Thanks @clement.

Digging into the code, the offsetter is doing a loose offset. But the code that creates the edges isn’t. I’ll get this fixed.

https://mcneel.myjetbrains.com/youtrack/issue/RH-64535

Also, you shouldn’t use a tolerance of RhinoMath.UnsetValue, as the function will make up it’s own, large tolerance if you do.

– Dale

Hi @dale, since i have to support RH6 and RH7, what should i use then in RH6 if this is never fixed for RH6 ? Which tolerance value does the function make up on it’s own ?

_
c.

The method does something like this:

def test_offset_face(face, distance, tolerance):
    if not face: return
    
    d = distance
    if face.OrientationIsReversed:
        d = -d
    
    t = System.Math.Abs(tolerance)
    if t > System.Math.Abs(d * 0.5):
        t = System.Math.Abs(d * 0.5)
    
    print(tolerance)
    print(t)

– Dale

1 Like

thanks @dale!

_
c.

Hi @dale ,
I’d appreciate when creating a loose offset solid that the “extruded” surface would be perpendicular and normal to the surfaces. I’m aware that this needs some compromise, but maybe you can make it possible.
Jess

RH-64535 is fixed in the latest Rhino 7.8 Service Release Candidate

1 Like