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.

Curve Deviation has become Curve Analyzer

josh_targojosh_targo Member Posts: 198 EDU

I heavily edited Curve Deviation into Curve Analyzer which can display both deviation and / or curvature or radius, in normal or log scale.

Both analysis graphs can be turned on or off, visibility can be set, scaling, and density as well.

I also fixed the code so it will work if the curves overlap each other as can be seen in the example image.

https://cad.onshape.com/documents/cc4e811a68209246c3d6a244/w/99faf8c3a688d2acb43db83e/e/0fa560367196954eef29b28e?renderMode=1&uiState=6712baea6e97cd48ba71faed

Comments

  • josh_targojosh_targo Member Posts: 198 EDU

    Added much needed Scaling controls to get the curvature hairs to be understandable.

    Scale is a length multiplier

    Scale Sensitivity multiplies the Scale by powers of 10, from 10^-5 to 10^5

    Log takes the Natural Log of the length

    Log Factor adds meters to all hairs before taking the Nat Log, this has the effect of reducing their relative differences.

    I am trying to think of ways to automate these settings to make the default hair lengths "about right" without a lot of fiddling.

    The curve on the right is a scan of a printout of a honda ridgeline door handle trim outline.

    the curve on the left is an onshape version made in a similar way, using a spline. the problem is that there isn't an easy way to nudge the spline points very small distances, they can only be dragged with the mouse, and that gets messy fast.

    I'm sure many of you will say to use a nurbs curve / b-spline, but those are also difficult to control because each CP influences a large portion of the curve, and so very localized curve adjustments are hard to do.

    https://cad.onshape.com/documents/cc4e811a68209246c3d6a244/w/99faf8c3a688d2acb43db83e/e/cfe8b598709f0d9ba609ffde

  • S1monS1mon Member Posts: 2,924 PRO

    I'm really happy to see some more specialized features like this. I also noticed that @GregBrown is working on something related.

    It would be nice if curves/edges which are more than one piece could be selected for both the reference and analyzed curves.

    Somehow when the deviation is large enough to be obvious, it seems weird that the graph at 1:1 doesn't go from the reference to the analyzed curve. I kind of understand why for really detailed analysis and if you want to leave the analysis on for multiple analyzed curves, you want the graph to be based from the analyzed curve, but it's not fully making sense to me.

    Also, there's something weird about the radius/curvature display. I've played around with the scale and sensitivity settings and I can't get it to match the built in curvature combs. It almost matches, but not quite.


    I'm really curious how you like to use this feature for radius/curvature analysis over the built in. I can see some interesting things with reversing the direction and showing radius only. I tried it using a control point curve that is approximating a circle. It's interesting to see how it makes the deviation from a true circle more obvious, but the settings required for the scale and sensitivity are a bit weird. To get something that is almost 1:1 with the real radius I need a scale of ~3 and sensitivity of 4.

    Here's the CP curve (degree 4) which is clearly not a good circle:


    Here's the same thing, but I used a degree 6 control point curve approximation - which seems like it might be exact.

  • josh_targojosh_targo Member Posts: 198 EDU
    edited October 23

    I'm glad you're trying it out. I'm 100% sure my curvature algorithm differs from the built in, but it's probably close enough to get a feel for the curve.

    My main reasons for making it, besides just to learn how, were:

    1. Display radius, rather than curvature

    2. have better control over not just scale, but the relative scale of the tallest to the shortest hairs (by doing NATLOG, and being able to adjust that sensitivity as well),

    3. being able to control number of hairs

    4. being able to flip the direction

    the stock analysis is unusable for how I wanted to smooth curves

  • josh_targojosh_targo Member Posts: 198 EDU
    edited October 23

    I can also take another look at making the hair length equal to the actual radius when the scale is set to 1 shouldn't be tough. not sure why I didn't make it like that, but I'll look. For what I was wanting to do, having the hair length relate to the actual radius was unnecessary, I'm just looking at the shape of the radius curve (the endpoints of the hairs).

    another example of my plot vs the official one on a smoothed version of that curve:

  • S1monS1mon Member Posts: 2,924 PRO

    I'm 100% sure my curvature algorithm differs from the built in, but it's probably close enough to get a feel for the curve.

    It looks like you're using evEdgeCurvature, and other than how you're scaling things, I'm not sure what you mean.

    There's probably some value in optionally color coding the hairs based on some min/max radii. The built in tool shows the minimum radius, but not max, and it doesn't tell you if there are multiple parts of a curve which are above or below a limit. Take a look at how the built-in dihedral analysis does the "enable threshold display".

  • josh_targojosh_targo Member Posts: 198 EDU

    I think the built-in curve analysis runs a lot more efficiently than mine. The lag makes it tricky when I'm smoothing a curve and viewing the analysis feature via FINAL.

    the color coding could be added to my tool, sure. Just need some free days to get back to the code. thx again.

  • josh_targojosh_targo Member Posts: 198 EDU

    @S1mon I haven't added the color coding yet, but I reworked the code quite a bit for scaling options. Take a look at radius or curvature. deviation isn't working yet in this build.

    Plot has three options for scaling:

    Actual x Multiplier
    Max and Min plot height
    Max and Ratio (my preferred).

    https://cad.onshape.com/documents/cc4e811a68209246c3d6a244/w/99faf8c3a688d2acb43db83e/e/c3a544ee41dee1a0377f2301?renderMode=0&uiState=6721a5777ed0a175e5033ce6

  • S1monS1mon Member Posts: 2,924 PRO

    Great to see all this work. I'll definitely be using this more and more.

    I would really like to invert the Deviation plot. At 1:1 it would essentially show you the distances between the two curves while overlapping one curve, but at a larger scale, it would help me, at least, understand the deviation much better.

    For all the types, I would like to be able to select more than one curve.

    The composite feature is useful, but I would prefer that it created a closed composite to make it easier to hide a set of analyses. My parts list is already too confusing with too many curves.

    I'm not sure why the deviation analysis has a curve through the ends of the combs, but curvature/radius doesn't. For me, curvature analysis without the curve plot is very frustrating.

  • josh_targojosh_targo Member Posts: 198 EDU

    The curve plots fail a lot and the error they throw is no help. Also, deviation is broken for closed curves (and maybe others) because I find the points to compare by making planes along one curve and looking at where those planes intersect the other. But if they intersect in multiple places, evDistance only ever returns one point. I'll keep trying things though.

    And multiple curve selection is needed, I know.

  • josh_targojosh_targo Member Posts: 198 EDU

    @S1mon radius spline curve is working (so far).

    https://cad.onshape.com/documents/cc4e811a68209246c3d6a244/w/99faf8c3a688d2acb43db83e/e/cfe8b598709f0d9ba609ffde

    Doing multiple curves is a whole new world for me, so It'll take some time to figure out what's involved.

  • josh_targojosh_targo Member Posts: 198 EDU
    edited October 31

Sign In or Register to comment.