Set Brep to natural orientation

Hi,

I found that offseting a brep face with a negative offsetDistance creates a solid with negative Volume. The Brep is orientated inward.

Rhino.Geometry.Brep.CreateFromOffsetFace(face, -1, tolerance, both_sides, create_solid)

How would I best go about makeng sure the Brep is pointing outward?
I can both:

  • test for negative distance and use Brep.Flip()

Or

  • test Brep.SolidOrientation and Brep.Filp() if needed

Is there a preference or best practice for either or even another method to make sure a brep is oriented ‘naturally’?

Thanks
-Willem

Hi Willem,

This shoudn’t be happening. Can you post your geometry so I can repeat here?

Thanks,

– Dale

Hi Dale,

I have found there is an issue with the edges of (some of ) these breps.
The offsets created are not solid:

An example file:bad_offset.3dm (127.0 KB)

and python script to be run in this file to get incorrect offset-from-face bad_offset.py (586 Bytes)

-Willem

Hi Willem,

I see two issues here:

1.) Brep.CreateFromOffsetFace isn’t getting the directions of the faces right, and
2.) Brep.CreateFromOffsetFace isn’t creating a solid from your geometry.

We’ve got YouTrack items for both:

http://mcneel.myjetbrains.com/youtrack/issue/RH-31899
http://mcneel.myjetbrains.com/youtrack/issue/RH-31895

This should all be resolved in V6. For now, if you are not adding Breps to the document, then check the solid orientation and flip if needed.

1 Like

Hi Willem,

You mentioned that you found problems with some edges, so you probably noticed that the shortest edge curve that is a line has 6 stacked control points. This is causing the failure in building walls. Did you make this in Rhino? If so, how? I’d like to make it so that doesn’t happen. I’m changing RH-31895 from a bug in the wall maker to an example for geometry validation testing.

Hi Chuck,

I indeed found later the geometry to be faulty.
I did not create the geometry, it’s probably made in Rhino but it’s from a client so I’m not able to tell you what steps led to this geometry. I do know they work partly with imported geometry to build on so it could be Rhino native or imported faultt geometry.

While at it:
I have found the command _RebuildEdges to clean up (some of) these edges. I also found the probably equivalent in Rhino.Geometry.BrepFace.RebuildEdges().

My question is, wheter or not many itterations of the EdgeRebuilding will degarde the edge’s features? In other words, is it like with rebuilding a curve, that tends to get ‘smoother’ with each itteration, or is RebuildEdges doing something else that is realted to getting the edge in tolerance with the underlying surface, more that smoothing it out?

Thanks
-Willem

Hi Willem,

RebuildEdges just constructs the 3D edge curves from the 2D parameter space curves, so, since the 2D curves do not change, you should get the same result each time you call it.

Hi Chuck,

Thanks for that insight. Good to know I’m save with my current setup.

-Willem