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.

point inside volume

billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,068 PRO
Is there a quick way to check if a point is inside a volume?

Looking at evCollision, not sure it'll work with a point. Not sure if it's even close to what I want.



In the case above, this would be true.

Comments

  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,211
    I don't know if evCollision will work (it should in principle, but I haven't tested it and it's 50-50 whether it actually does).  One possibility is if q is a query for a body, then
    evaluateQuery(context, qContainsPoint(q, point)) != []
    will evaluate to true if the point is inside (or on the boundary of) the body.

    Another way is checking if evDistance between the point and the body returns a distance of zero.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,068 PRO
    wow, thanks for quick response.

    Tried evDistance, seems to return distance to closest face inside or outside body. evDistance seems to work with faces, not bodies. Correct me if I'm wrong.

    Will try evaluateQuery.
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,068 PRO
    man you're good, thanks

  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,211
    Just tested evDistance -- looks like it's computing the distance to the body boundary.  There is potential usefulness there (though only coupled with the knowledge that we're inside) -- logged a bug to figure out how to best expose it.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
Sign In or Register to comment.