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.

Find minimum radius of curve with FeatureScript?

Evan_ReeseEvan_Reese Member Posts: 1,374 PRO
edited April 29 in FeatureScript
I looked through the documentation for a function that would return the minimum radius of a curve and didn't see anything that would. I'm looking for the same minimum radius value that's given by the show curvature dialogue. Am I missing an existing function for this, or do I need to do some kind of iterative sampling to check the curve at a bunch of places and return the min radius I find?
Evan Reese / Principal and Industrial Designer with Ovyl
Website: ovyl.io

Comments

  • Jacob_CorderJacob_Corder Member Posts: 63 PRO
    @Evan_Reese
    Nope. no built in function.
    Solidworks has one, which likely means parasolid does also and onshape is holding out on us (joking guys) 

    I am just guessing here, but this might give you a start.

    extract the b spline curve using evApproximateBSplineCurve  then read this crazyness and see if section 2.1 Smoothness measure section will help.
    I have been meaning to do this myself but just haven't gotten to it.
    https://www.diva-portal.org/smash/get/diva2:996026/FULLTEXT01

    The reason you would want to use the b spline curve is because then you are not guessing at how much to approximate the curve which could take a huge amount of time and also you would never find that minimum curvature point when guessing. you could get very very close but never totally get it. 




  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 4,238
    edited April 29
    Sample the curve using evEdgeCurvatures and radius at each point is 1 / curvature
    Director, Technical Services, EMEAI
  • Evan_ReeseEvan_Reese Member Posts: 1,374 PRO
    @NeilCooke and @Jacob_Corder

    Thanks. That's what I was afraid of. I hoped that since the Show Curvature tool does it well there might already be a function for it. If I go the sample route, I may even do it in two phases: one coarse pass on the whole curve to find the area that's likely to have the most curvature, then a second set of samples right around that area to refine the result, but it's definitely less simple that just typing evMinimumRadius().
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • Jacob_CorderJacob_Corder Member Posts: 63 PRO
    edited May 2
    @Evan_Reese
    I tried to see if it was a hidden call somewhere in the @darkSide of onshape, but i couldn't get a match with many tries.(@evMinimumRadius, @evMinimumCurvature .....).
     evMinimumRadius would be great. 

    Also, Evan, if you are going to be calling evEdgeCurvatures, it is significantly faster to call @evEdgeCurvatures because building the frames and data and storing them into maps of types is actually a lot more time consuming that you would imagine. using the raw numbers is faster to get, faster to evaluate because ValueWithUnits is removed and vector removed. I have seen it cut the time by half in a thickness analysis feature I wrote, and at least cut in half for an edge tangency checking feature that I wrote. I couldn't believe how long it took to convert from normal numbers to the structures we use (vector, line,plane,....).  
Sign In or Register to comment.