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.
Trying to translate loft() to opLoft() in FeatureScript
brian_guan
Member Posts: 13 ✭✭
Hi featurescript experts,
I am trying to loft 2 organic shapes together using Featurescript opLoft() but I am just unable to get it to work, though I am able to achieve the result I want using the user interface which generates code using loft() instead of opLoft().
Here's the link to my test model https://cad.onshape.com/documents/4e48bb736c8527acdb63fb73/w/7d1ce53ca3a862a186b9bfdc/e/b642fb834c7a068eccafa01c
This is the desired outcome achieved with UI which calls loft().
But I just can't get it to look all smooth using opLoft(), which looks like this (notice the sharp edges):
I think I need to use derivativeInfo in opLoft() somehow to specify the End conditions but I am not sure how. The documentation on opLoft() parameters is quite lacking to say the least.
Can someone help point me in the right direction? (Even better show me working code?)
Another minor annoyance is that the new solid is not merged with the 2 parts to be lofted, and I can't figure out whether opLoft() can do it or I have to explicitly Boolean Union them myself.
Many thanks in advance,
Brian.
I am trying to loft 2 organic shapes together using Featurescript opLoft() but I am just unable to get it to work, though I am able to achieve the result I want using the user interface which generates code using loft() instead of opLoft().
Here's the link to my test model https://cad.onshape.com/documents/4e48bb736c8527acdb63fb73/w/7d1ce53ca3a862a186b9bfdc/e/b642fb834c7a068eccafa01c
This is the desired outcome achieved with UI which calls loft().
But I just can't get it to look all smooth using opLoft(), which looks like this (notice the sharp edges):
I think I need to use derivativeInfo in opLoft() somehow to specify the End conditions but I am not sure how. The documentation on opLoft() parameters is quite lacking to say the least.
Can someone help point me in the right direction? (Even better show me working code?)
Another minor annoyance is that the new solid is not merged with the 2 parts to be lofted, and I can't figure out whether opLoft() can do it or I have to explicitly Boolean Union them myself.
Many thanks in advance,
Brian.
Tagged:
0
Comments
First thing you need to do is read the loft feature code and see how onshape converts loft to opLoft. then you should be able to backwards figure it out.
Instead, just call loft(context,id,definition) and change your opLoft code to loft.
for opLoft derivatives, hopefully this can be used to help
Trying your 2nd suggestion by cutting and pasting from Part Studio Show Code and changing my feature script code to use loft() instead of opLoft() gives me an error "Function loft() with 3 arguments not found." Seems like loft() cannot be called inside my custom feature script? This seems like a NOOB issue that I have never had to solve, please point me to the right direction if possible.
Trying your 3rd suggestion by using your code to programmatically specify the derivativeInfo I was unable to get far as I frankly don't understand what the code is trying to do. For example it is referencing "guideSubqueries" but I didn't need to specify in my manual loft. So I am unsure what to put there.
(As for the opLoft() not doing merge, luckily that is something I know how to do via featurescript, so not a problem, just wanted to make sure it is not already implemented, thats all.)
Thank you in advance for your help.