# Polybevel, how to round to an actual circle arc ?

## Recommended Posts

Using Polybevel, the resulting shape of a rounded corner is not really documented

In 2d, do you know how to add a round bevel to a corner of a polygon that would actually be a circle arc ?

Edited by AntoineSfx

##### Share on other sites

shape round, crank up divisions...what are you smoking ?

##### Share on other sites
25 minutes ago, Noobini said:

shape round, crank up divisions...what are you smoking ?

Indian hemp. It's a vegetable. Anyway..

The reason I need a proper circle arc is because I'm using Houdini to model pieces that will be 3d printed and need to fit another piece that is an actual circle arc of a known radius. Not sure if I want to file an RFE for this, as Polybevel is already very unstable as soon as the input is a bit complex.

I guess I can build it myself for a one off shape, as I don't see an easy way to fix it in the general case, as it would require to compute the center of curvature and whatnot.

So if you don't know, now you know.

##### Share on other sites

fair enough...RFE away.

##### Share on other sites

Try to extrude your 2d shape first, then bevel corner edges. The shape of bevels is close enough to a circle.

• 1

##### Share on other sites
1 hour ago, vicvvsh said:

Try to extrude your 2d shape first, then bevel corner edges. The shape of bevels is close enough to a circle.

Interesting.

Polybevel is using a different algorithm to bevel those edges, and it results in actual circle arcs.

##### Share on other sites

Hi,

if interested, here is an older example (a bit modified) where I've tried to create a circular bevel for polylines. It is experimental so it will probably fail in some situation, but you can use custom radii and numbers of division.

Polyline_Circular_Bevel.hipnc

• 1

##### Share on other sites

https://www.orbolt.com/asset/ynkr::polylinebevel

• 1

##### Share on other sites

This is now a Houini Curve feature in H19

Example:

I don't think it's production ready, as the UI is a bit weird to use but:

1/ Create a Bezier curve. It has to be, If you start with a Polygon Curve, it doesn't work. This is a feature of Bezier Curves only, as this is setting the Bezier handles behind the scenes.

2/ Select the points where you want to have a rounded corner;

3/ Invoke the radial menu (C key) and go to Change point type / create rounded corner

4/ Profit

You can even round corner from a straight segment to a curved segment..

It creates an additional manipulator point that takes care of setting the handles as they should.

Note that this is not technically a circle arc, as Bezier curves can't model circles exactly, but it's close enough for  (0.027 %  maximum deviation according to one quick test)

##### Share on other sites

My suggestion for older versions would be to use NURBS curves
if you start from a right angled shape, with control points (vertices) at the marked blue locations and convert it to a NURBS order 3, I believe you get what you would want:

edit: if you are using an open curve instead of a closed one, you must add at least one more vertex in the middle of any straight segment, and make sure the curve starts there

Edited by acey195

##### Share on other sites
4 hours ago, acey195 said:

My suggestion for older versions would be to use NURBS curves
if you start from a right angled shape, with control points (vertices) at the marked blue locations and convert it to a NURBS order 3, I believe you get what you would want:

edit: if you are using an open curve instead of a closed one, you must add at least one more vertex in the middle of any straight segment, and make sure the curve starts there

No. It does not subdivide to actual circle arcs.

It's more complex than that. In your example, it would approximate to (fake) arc circles that are actually half the radius, i.e the tangent point would fall between the corners and the control point. Making it hard to use.

If you choose the approximate way, you might as well stick with the solution I used in the question, as it gives you more control over the apparent radius.

You can also use the current tool to create a rounded corner and bake it, then look at the result and see if it can be replicated using some simple logic (it's not that simple..)

##### Share on other sites

My current most flexible way for 2D shapes involves measuring distances from an underlying grid.
You can throw multiple intersecting polylines, closed polygons and meshes all at once at it.
Just make sure to not undermine the grids resolution. Blurring distances is another option.

round_corners.hiplc

##### Share on other sites
3 hours ago, AntoineSfx said:

No. It does not subdivide to actual circle arcs.

It's more complex than that. In your example, it would approximate to (fake) arc circles that are actually half the radius, i.e the tangent point would fall between the corners and the control point. Making it hard to use.

ok you are right, its a bit more finicky than I realized

##### Share on other sites

One idea... Extract contour with for example silhouette. Poyexpand, copy to corner point a circle with radius to match your bevel radius

Intersection analysis to cut the original piece with the circles, where they meet, tangent point...

Rebuilt the curve with the joined pieces.

Im sure some people here could give you a proper academic mathematical solution

________________________________________________________________

Vincent Thomas   (VFX and Art since 1998)
Senior Env and Lighting  artist & Houdini generalist & Creative Concepts

Edited by vinyvince

##### Share on other sites

For convex shapes just add the minimal position on the inset curve to the direction vector between both positions.

```vector pos = minpos(1, v@P);
vector dir = normalize(v@P - pos);
v@P = pos + dir * radius;```

Edited by konstantin magnus

##### Share on other sites

I did the math to find a generalized solution to this, and it's working nicely.

The underlying problem is: where do I insert the control points so that a order 3 Bézier curve approximates to a circle arc.

I won't go into the math too much; it' s a generalization of the method described on the Bezier wiki: https://en.wikipedia.org/wiki/Composite_Bézier_curve

It's important to note that this formula can only work with third order Bézier Curves, i.e a Bézier curve build using a polygon with three segments, with U Order set to 4 in Convert SOP

You can certainly constrain a higher order Bézier curve to approximate a circle arc; all you need to do is evaluate the Bezier curve at some points and set some values to describe the kind of approximation you're looking for.

Here, the idea is: starts and ends coincide; midpoints coincide; curve is symmetrical (in u space); there is one degree of freedom left, named k

Hull is A-A'-B'-B

This is the formula for an approximation of unit circle arc in the first quadrant, the angle is a

( Notation is V = [ x ; y ] )

A=[ 1 ; 0 ]

A'= [ 1  ; k]

B' = [  cos(a)  + k * sin(a)   ;  sin(a)  - k*cos(a)  ]

B = [ cos(a)  ; sin(a) ]

(some basic trig here, similar to the one shown wiki)

This gives a value for k:

k =  ( - 4 / 3 ( 1 + cos(a) ) + 8 / 3 cos ( a / 2 )  )  /  sin( a )

In practice, this k value gives you the distance to corner if you want to " cut" the corner by inserting points on the adjacent segments.

It approximates nicely up to a = 120 degrees.

Edited by AntoineSfx

## Create an account

Register a new account