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.
FeatureScript: Obtaining surfaces curvature magnitude
Hi everyone,
For a current project, I need to analyse surface curvature in detail and compare different portions of such surface to determine if they are nearly identical. While curvature combs in OnShape provide a good visual representation of curvature, I need a way to quantify the curvature diffrences numerically for a precise comparison between surface sections spanning the same area.
In particular, I would like to extract and export (e.g. arrays of curvature values) the curvature magnitudes that are shown in the curvature combs for an external analysis in other software - I've attached an image that illustrates the curvature combs I'm working with, to clarify the task.
I have come across the evFacesCurvature
function in FeatureScript, which seems like it might be useful for this purpose, but as a beginner with FeatureScript, I haven't been able to implement a working solution
Another approach I'm considering is comparing positional differences at key points (say the boundary of such surfaces showed in the attached image), using a common reference such as the center point position.
Does anyone have suggestions on how to approach this? Specifically:
- How can I use FeatureScript to extract numerical curvature data (e.g., the magnitude of curvature combs)?
- Are there any other functions or strategies in FeatureScript I should explore for this task?
Any examples, scripts, or hints for a beginner would be greatly appreciated!
Thank you in advance for any suggestions or help.
Comments
A really rough example that might help get you started:
This custom feature takes a selected face and will sample in the U-V space as specified by the inputs. The max curvature is evaluated and written to an array. The array and the max value is displayed in the FeatureScript notices panel.
https://cad.onshape.com/documents/a1ed68b89c58f6b1581dece2/w/1f9036e0712e81a9bc379e23/e/1945c082a5b652db1b99d8fe
Thank you Greg, your script has been very useful for my purpose!