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.
Is it possiible to verify a point is inside a body (via API is better)?
Hello, everyone,
I am a graduate student working on robotics research. My research is about robot learning to make manipulators work on various objects. The learning part is conducted on Ubuntu, while the modelling of the objects is performed on Autodesk Inventor on Windows. I always got frustrated with switching the OSes (I do not like to use WSL…). The reason why I have used Inventor is this API function (https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=SurfaceBody_IsPointInside), verifying whether a point is inside an object's sub-body or not. I have to want to read the object's data point-wise. The Inventor was the only app that provided such functionality among major CAD software when I googled them.
I have found this app, OnShape, and am considering migrating to it since it looks like it is working nicely on Ubuntu. However, I am not sure that the aforementioned functionality is equipped with this app, as I glanced at the documentation. Does anybody know there is a way to check the point containment? Performing it via the API is better but not limited to it.
Thanks a lot in advance!
Atsushi
Comments
@atsushi_kuno075 - I'd imagine that there are excellent API endpoints that can do this. Not having worked with the OS API. I can't confirm that. There are two two possible ways I can think of going about a SIMILAR calculation using Featurescript - though they both may lack the accuracy/elegance you're looking for.
I hope that helps!
-j
If you are using featurescript, all you need is qContainsPoint(queryToFilter, point)
If you give it a single body, and then check if this query is empty afterwards (isQueryEmpty), you know if the body does or does not contain the point.
Custom FeatureScript and Onshape Integrated Applications