Resolving a fillet that would eliminate center curve

Hello all. I have a bunch of curves generated by a voronoi component. I am then offsetting & filleting those curves. The intent here is for all curves to have an interior radius of 0.125, as I will be CNC cutting them with a 0.250" cutter.

Sometimes the pattern generated results in a very short segment after the offset. Too short to apply a .125 fillet. The result I am looking for is to eliminate the center curve, and apply the fillet between the two adjacent curves. How can I resolve this correctly?

image

zoomed in on this radius:

image
Voronoi Rev3.gh (10.0 KB)

could you please post your GH file with internalized geometries?

I hope I did that right. I attached to first post.

1 Like

this uses Planar region… maybe it’s an overkill, but it’s the very first idea that came to my mind

with this slider you set the length under which segments are deleted

Voronoi Rev3_Re.gh (15.4 KB)

Thats kind of what came to my mind (cull the short segments), but I didn’t know how to execute, thanks.

In theory the segment length below which to cull should be a function of the fillet radius, however the angle between the two adjacent curves is going to have a large impact on that. With the above solution I could just drag the slider and look for any errors, but I was hoping to find an idiot proof way if possible :slight_smile:

For example, in the image above, the top curve on the RH edge of the surface still has the problem.

I used Clipper PolyOffset ‘H’ (Holes) but the Python offset works just as well.


Voronoi_2021May17a.gh (16.0 KB)

1 Like

you are 200% right
and I have never noticed the Fillet component actually fillets sharp corners of a curve up to the provided diameter… sometime giving results that does not look reasonable to me (like this case on the right: there is no reason to me why this fillet should not have radius 0.25)

maybe the Fillet component is not the right way to go


[edit] this is the most obvious solution I didn’t see… as easy as it might look:
offset inwards by 0.25 (all short edges gets reduced) then offset outwards back 0.25:


Voronoi Rev3_Re_Re.gh (15.9 KB)

still, the Fillet component does some weird radii

Using the same slider for both values works well in my model, up to a value of 0.513. More than that causes the filleted offset curves to jump the boundary of their surrounding Voronoi cells.

this should be monkeyproof in these terms: given that the offset component still has some weird behavior for some closed curves, whenever the offset component will not fail, this should also not fail


Voronoi Rev3_Re_Re_Re.gh (17.1 KB)

p.s. for instance: using seed#50 the offset fails, and it’s also playing mind games on me…

Code musings…

  • use Python ‘OffsetCurve’ instead of Clipper PolyOffset ‘H’.
  • avoid Area ‘C’ (Centroid) by using Populate 2D points instead.
  • show culled segments in piped yellow, used segments in blue.
  • use filleted curves to cut holes in surface.


Voronoi_2021May18a.gh (27.3 KB)

Version B: Holes are the same distance from surface edges as they are from each other.


Voronoi_2021May18b.gh (28.0 KB)

Version C: Fully filleted with FilEdge (white group)


Voronoi_2021May18c.gh (37.1 KB)

Version D: white ‘pre-fillet’ lines


Voronoi_2021May18d.gh (38.1 KB)

1 Like

I like the offset in, then back out solution. Could those both be done in a single step in a python script?

I tried changing mine to this, but I get a runtime error. I’m not experienced with Python within Grasshopper, so I’m not sure what I did wrong.

x = rs.OffsetCurve(crv,dir,2*dis) a = rs.OffsetCurve(x,-1*dir,dis)

Runtime error (TypeErrorException): unsupported operand type(s) for *: ‘int’ and ‘Guid’

Traceback:
line 13, in script

(13 is the second line)

something like this might work?

import rhinoscriptsyntax as rs
a = rs.OffsetCurve((rs.OffsetCurve(crv,(0,0,0),-dis)),(0,0,0),2*dis)