Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Options

spline/bezier-like with a bias towards circularity

kyle_altendorfkyle_altendorf Member Posts: 58
image.png

several times i have wanted to make an egg'ish shape, or a plane fuselage, or similar. a revolve is the first thing to reach for, but that can't handle varying profiles in different directions. creating profiles then splines between them and lofting across those comes pretty close. but… from what i've seen all the 'smooth' tools like the various surfacing, splines, and beziers have a tendency to try to have straight lines between the specified boundaries. not literally straight, but even when a spline is routed through four points in a square it will have higher curvature near the points and lower curvature halfway to the next point. i'm interested in creating lines and surfaces that rather minimize curvature variation. when routed through the corners of a square it would create a circle, but when routed through non-regular points it would still provide continuous curvature.

in the screenshot there's a circle on the inside, then a spline in the middle, and a bezier on the outside. yes, the squares are different sizes but it still shows the lack of circularity with the spline and bezier each having a lower radius midway between the points.

image.png

here's an example where i sketched the black curves and would like to be able to tweak each for different applications where some cases may be symmetric and others asymmetric. if they are consistent i would like it to settle the surface to be as if it was a revolve yet still allow for the asymmetric cases to smoothly diverge from circularity.

hopefully that's enough words to get my intent across. is there any existing, or featurescript, tooling for such lines and surfaces? if not and i were to find the math for the curve or surface control i want, any suggestions how to implement that via featurescript? i did a bit of a search through the featurescript stuff and maybe i just looked over some more generic tooling than spline etc calls. thanks.

Comments

  • eric_pestyeric_pesty Member Posts: 2,275 PRO

    For fitting to rectangle/squares my first thought would be an ellipse… Might not be generic enough though for more complex shapes.

  • eric_pestyeric_pesty Member Posts: 2,275 PRO

    I tried using the edit curve to approximate a square with a very large tolerance and I did get a circle:

    image.png

    You can also get a bridging curve or a bezier to approximate a circle but I guess you need to control the magnitudes in some "non-obvious" way but I think this has to be the way to go… Maybe someone who knows more about the underlying math involved might be able to help?

    image.png
  • GregBrownGregBrown Member, Onshape Employees, csevp, pcbaevp Posts: 329

    A good way to do this is with a proper NURBS curve, which you can make with the Control point curve custom feature.

    This document has two examples. In each case the Weight of a particular control point is adjusted to be something other than 1 (thereby making it rational.) The effect it has on the curve is obvious, it "attracts" the curve towards it, and increases the curvature value. You can use it to approximate a circle, or tend towards a square, or something in-between.

    In the first Part studio Periodic (closed)I have used a single degree 8 Control point spline (NURBS curve) and the corner Control points all have weighting of 2.

    image.png

    The curvature combs are pristine for this…

    image.png

    There is another part studio with one corner created from a Control point spline (degree 2, with the middle CP set to weighting of 2). This is then mirrored twice.

    In both cases just play with the Weight parameter to get the desired effect.

  • kyle_altendorfkyle_altendorf Member Posts: 58

    thank you both for the detailed responses. i looked over them and fiddled a bit, but i'm going to need to come back and take another pass to get it all internalized. thanks!

Sign In or Register to comment.