AntoineSfx Posted July 28, 2020 Share Posted July 28, 2020 (edited) 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 July 28, 2020 by AntoineSfx Quote Link to comment Share on other sites More sharing options...
Noobini Posted July 28, 2020 Share Posted July 28, 2020 shape round, crank up divisions...what are you smoking ? Quote Link to comment Share on other sites More sharing options...
AntoineSfx Posted July 28, 2020 Author Share Posted July 28, 2020 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. Quote Link to comment Share on other sites More sharing options...
Noobini Posted July 28, 2020 Share Posted July 28, 2020 fair enough...RFE away. Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted July 29, 2020 Share Posted July 29, 2020 Try to extrude your 2d shape first, then bevel corner edges. The shape of bevels is close enough to a circle. 1 Quote Link to comment Share on other sites More sharing options...
AntoineSfx Posted July 29, 2020 Author Share Posted July 29, 2020 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. Quote Link to comment Share on other sites More sharing options...
Aizatulin Posted July 29, 2020 Share Posted July 29, 2020 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 Quote Link to comment Share on other sites More sharing options...
satoru Posted July 29, 2020 Share Posted July 29, 2020 This is the link of HDA I made in the past, how about this? https://www.orbolt.com/asset/ynkr::polylinebevel 1 Quote Link to comment Share on other sites More sharing options...
AntoineSfx Posted November 12, 2021 Author Share Posted November 12, 2021 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) https://www.sidefx.com/products/whats-new-19/ Quote Link to comment Share on other sites More sharing options...
acey195 Posted November 27, 2021 Share Posted November 27, 2021 (edited) 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 November 27, 2021 by acey195 Quote Link to comment Share on other sites More sharing options...
AntoineSfx Posted November 27, 2021 Author Share Posted November 27, 2021 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..) Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted November 27, 2021 Share Posted November 27, 2021 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 Quote Link to comment Share on other sites More sharing options...
acey195 Posted November 28, 2021 Share Posted November 28, 2021 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 Quote Link to comment Share on other sites More sharing options...
vinyvince Posted November 28, 2021 Share Posted November 28, 2021 (edited) 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 http://fr.linkedin.com/in/vincentthomas Edited November 28, 2021 by vinyvince Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted November 28, 2021 Share Posted November 28, 2021 (edited) 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; curve_arcs.hiplc Edited November 28, 2021 by konstantin magnus Quote Link to comment Share on other sites More sharing options...
AntoineSfx Posted November 30, 2021 Author Share Posted November 30, 2021 (edited) 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 November 30, 2021 by AntoineSfx Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.