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.
Projection of an edge onto a sketch
prajwal_shankar
Member, Developers Posts: 11 ✭
considering I have an edge selected(input) and would like to project that edge onto a sketch from a feature script, using the 'skConstraint' command in the feature script is the solution but i am unable to figure out the syntax for using the 'Projected' constraint type in this situations. any suggestions????
0
Comments
1) The external geometry is projected into the sketch.
2) Up to three projected constraints are made, one for the curve and one for each end point if the curve is open.
To perform step 1 manually, put a curve into the sketch that will have the same geometry type as the projected edge: spline, circle, ellipse, line.
Step 2 is a little more complicated, the important parameters are:
"projectionType" which should be SketchProjectionType.USE for an edge and SketchProjectionType.USE_END for a vertex.
"localFirst" this is a query for the sketch entity that the constraint is being applied to.
"externalSecond" this is a query for the edge being projected. It should be a coedge query, but I don't believe that is strictly required.
For a vertex, "externalSecond" is replaced with "externalVertex" and "externalVertexEdge" which are vertex and coedge queries respectively.
You can put in a request for a featurescript function that will do all of this for you. For now, I suggest attempting this as a solid modeling operation. An extrude or sweep followed by a split face is much simpler and covers most of the same use cases.
how do i ask OnShape to help me create this Custom FS?
I can't seem to get the projection constraint to do anything. When I call skConstraint with the following arguments (where entities[0] is a vertex), the original sketch point does not move.
However, when I call it with these arguments, it works:
Is there more information on how to use projection constraints? I'm having a difficult time following the procedure you laid out above, especially since there is no use of projection constraints in the standard library.
There also seems to be no obvious way to "project" spline curves (or other non-line/point/arc types of geometry found in external references).
Max