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.
Improvements to skConstraint in feature script
darren_13
Member, Developers Posts: 119 PRO
I have been struggling to use sketch constraints in feature script and since nobody has been able to help me on the forums I guess nobody knows!! Therefore I would like this to be made simpler. If when creating a manual sketch the set initial guess is done automatically, maybe the feature script equivalent should be the same, removing the need to define this manually.
My most needed constraints are coincident, tangent and measurement (both length and angle).
Cheers,
Darren
My most needed constraints are coincident, tangent and measurement (both length and angle).
Cheers,
Darren
Tagged:
0
Comments
https://forum.onshape.com/discussion/5265/sksetinitialquess#latest
Sorry we've put off answering this for so long.
We did make a conscious decision to not go down the rabbit hole of externally documenting everything about sketch constraints and initial guesses, and there are a few reasons for that:
Even seemingly simple things like a flip direction or a parameter along a curve are hard to determine without a lot of manual calculation (since naively, you have no real way of knowing what this direction is being measured with respect to). That calculation is made harder by the fact that you can't use our evaluate functions on entities you "added" to the sketch, since those entities aren't added to the context until the sketch is solved, at which point it's too late.
Now, to some extent, there's leeway in getting these constants wrong. After all, it's only the "initial guess" before we arrive at the real answer. But from the solver's perspective, the solution space for sketches explodes very quickly, and so our solver needs to make heavy use of these initial guess inputs to determine the user's intent. The result of getting the initial guess wrong is quite often a sketch that fails to solve, or only solves in a small set of cases.
It may sound like I'm just spewing bad news here, but there's a happy ending:
We know sketches work best when they can be designed interactively with Onshape's sketch tools. So, in an ideal world, we want you to be able to use that power when making sketches for custom features too. Specifically, we want you to be able to design a beautifully constrained sketch in a Part Studio (with, say, some dimensions exposed), and then use that sketch in a custom feature with different values for those dimensions.
The missing link for that ideal world is the ability to build a Part Studio differently based on different input parameters. This isn't possible yet without configurations, but rest assured configurations are something being actively worked on and we hope you'll appreciate their myriad uses it once they arrive!
Kevin
Kind regards,
Darren