Find flat/smooth area

Looking for strategy help here:

I need to build an automated way of identifying areas of a brep that are smooth (no surface features) within some radius of the sample point. The idea is to add a casting sprue to an area that is easy to blend afterwards. For example - “find a 4mm area of smooth surface on this brep…”

I was thinking of placing a 4mm sphere at all mesh vertices, getting mesh face centers within that sphere, averaging their normals, and then comparing all individual normals to the average, but I expect that is very inefficient.

@laurent_delrieu - can Nautilus do this more efficiently?

Thanks in advance,

dh

brep or mesh?

Part is brep, but I anticipate a meshing step for the purpose of this analysis.

As usual, it might help to share a file with some geometry…

Here’s an idea for one way to approach this -
Mesh your shape
Weld all the edges
Unweld edges above some angle A
ExplodeAtUnweldedEdges (a 1 line script, or it looks like Laurent has a component for it in Nautilus)
Sort the resulting list of meshes by face count and take the largest
Find the point of this mesh which is furthest from its boundary

Hello

not sure it is the best idea, but you can measure the curvature. There are many curvature tool, there is one a bit hidden in Nautilus, just made using AI to test somethings. It uses a radius, then points and then curvature evaluation using Rhinocommon tools.

here the tool on a simple shape with a 2 radius sphere. Zones in pink have a curvature less than 0.001 (radius = 1000)

curvature flat zones.gh (16.0 KB)

Mesh Curvature Radius


Evaluate the Mean, Gaussian, Kappa1, Kappa2 curvature on each point of a mesh using a radius, if radius is too low, near vertexes will be choosen, Grok references, Rhinocommon- Surface Curvature Calculation , Rhino - Calculate Surface Curvature , Extracting Curvature/Radius Values of Surface from Curvature Analysis Tool - #3 by 17thummer


Input parameters:

M (Mesh)

Mesh

Radius (Number)

Radius used to get points around the vertex, if option is activated (less than 10 times the length of bounding box diagonal)

NPoints (Integer)

Minimum number of points to calculate curvature >6

UseRadius (Boolean)

if true use radius to find points, if false use the number of points, points number is always > 6

Yes I have 2, one is the one you mention ! Not a great addition, the other output also a material (an index indeed), so I can use Multimaterial smoothing

set a inital face. (with its normal and center point).
use MeshTopologyEdgeList to find possible neighbours.
→ filter by distance
→ filter by face normal (angle against reference normal) to filter by orientation.

you still can create a mesh region with a hole…

splitting by edge angle might include to many faces:
90 small neighbours each doing a 1 degree step will result in 90 degree angle between first and last face normal…

maybe - as martin wrote - a more precise usecase / geometry will help a lot.

happy modelling - cheers -tom