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.
evRaycast not reporting all face intersections
Cappie_Pomeroy
Member Posts: 14 ✭
I'm trying to use evRaycast to get all points where a ray intersects the face of a body. It mostly seems to be working however I have run into a strange issue. A single point is missing from what I would expect to be an intersection. I've included a screenshot where I have circled the "expected point" in black and a link to a document with a simplified version of my script that has the same issue. Anyone have any insight into this? Possible workarounds perhaps? It appears that I can get the point as an EntityType.EDGE intersection. I want to filter by FACE because otherwise I end up with a lot of very close duplicate points in the RaycastResult of EDGE as expected. I would like to avoid filtering in a more computationally intensive way because eventually I will be iterating over thousands of rays.
Document Link:
Thanks!
Cappie
Tagged:
0
Comments
I also noticed that for edges, it only gives the first intersection with each edge, so if the edge crosses the line twice, it only returns one intersection
IR for AS/NZS 1100
It looks like it may potentially be a tolerance issue. I wiggled your z value by .000001 and got your expected results.
Best,
Mike
I was trying evRayCast with a spline that intersected the line twice, but it only gave the closest result, even when 'closest' was set to false
IR for AS/NZS 1100
Hey! It looks like I can get all correct intersections if I cast rays on just faces instead of the entire part, i.e., using instead of definition.part. Then you won't have to filter, either.
@Konstantin_Sh I just found it odd that it was inconsistent in the multiple intersection points that it did find. That one just doesn't seem particularly special in any way.
@mthiesmeyer I noticed that also, but I am interested in tolerances on the order of 1um so I was hesitant to use that workaround and was hopeful of another way.
@Anton_Bovin That's a great work around! It works exactly as expected.
Update for everyone Onshape has flagged this as a bug and are working on it. I'll try to remember to post back to this forum when it's fixed.