Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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?
EvanAReese
Member, Mentor Posts: 2,077 1337
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
Website: ovyl.io
0
Comments
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.
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().
Website: ovyl.io
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,....).