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 point(s) of intersection between spline and body
ray_heasman
Member Posts: 6 ✭
( I accidentally asked this in the Community Support forum, at first. Sorry. :/ )
Hi,
I'm trying to write a tool to help me add cables, wires, tubes, etc. to a current project.
This is my first featurescript so I am also using this problem to learn about featurescript.
I am trying to find the point at which a spline enters a body. I construct the spline, and then use evCollision to find collisions. evCollision successfully finds the collision and reports the face being collided with, and my spline.
For simplicity for now, let's assume that the intersection is always a face. I want to extract the 3D coordinates of the collision.
I was hoping to do the following:
Anyway, the problem right now, is that skContraint is not documented. There is some token documentation, but it doesn't tell you what fields to set to get the results you want. Looking at the standard library only shows how to use a subset of the constraints.
So, I can't figure out how to set a PIERCE constraint.
Can someone tell me how to set a PIERCE constraint, or perhaps show a better way to extract the intersection point(s) I am looking for?
Thanks.
Hi,
I'm trying to write a tool to help me add cables, wires, tubes, etc. to a current project.
This is my first featurescript so I am also using this problem to learn about featurescript.
I am trying to find the point at which a spline enters a body. I construct the spline, and then use evCollision to find collisions. evCollision successfully finds the collision and reports the face being collided with, and my spline.
For simplicity for now, let's assume that the intersection is always a face. I want to extract the 3D coordinates of the collision.
I was hoping to do the following:
 Create a sketch on the face.
 Add a point to the sketch.
 Set a ConstraintType.PIERCE between the spline and the point on the sketch.
 Solve the sketch.
 Extract the coordinates of the point on the sketch and map them to world space.
 Destroy the sketch.
 Use the coordinates I extracted.
Anyway, the problem right now, is that skContraint is not documented. There is some token documentation, but it doesn't tell you what fields to set to get the results you want. Looking at the standard library only shows how to use a subset of the constraints.
So, I can't figure out how to set a PIERCE constraint.
Can someone tell me how to set a PIERCE constraint, or perhaps show a better way to extract the intersection point(s) I am looking for?
Thanks.
0
Best Answer

ray_heasman Posts: 6 ✭NeilCooke said:evDistance().sides[0].point should do it
0
Answers
The idea is that I load in a complete assembly with lots of parts (over 700), as a step file. Then I create a part studio in context, and model a new part that that is all the wiring and tubing etc, then export it later so other people I am working with can include it as a dumb part into their assembly, and it will have static geometry in that part that represents all the tubing and wiring.
Thanks for your help so far. I much appreciate it.
Now I know about extract, perhaps I can find a better way...
Interestingly, if I add a query parameter to select a face, selecting that face makes it possible for the evCollision to see it, even if I do nothing else (no extractSurface or whatever).
It's starting to look like a chosen behaviour, but it's still not one useful to me.
I'll figure out how to post a bug report.