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.
3D Spline with tangency and weighting control
philip_thomas
Member, Moderator, Onshape Employees, Developers Posts: 1,381
Ok, i am an aeronautical engineer by training and i really wanted 3D splines for lofting wing, propellor and parachute shapes.
Here is a custom feature that does a lot of what i was looking for. The original work was done by Mark Barr and the tangency capability was added by Ilya Baran after i promised to leave him alone if he exposed the functionality. All i did was make it work the way i wanted it to!
So, how does it work?
For an open spline, you can now optionally select any edge or sketch entity to define the tangent vector (and optionally flip the tangency direction).
The end of the spline does not have to touch the end of the edge/entity defining the tangent direction.
You can use the same edge/entity for both start and end tangency if you wish.
The weighting of the tangency is proportional to the length of the edge/entity nominated.
There is a variable 'TangencyWeightingFactor' that you may want to change for very large or very small parts.
Best practice?
Use sketch entities to define the tangency/weighting
In this public document, edit the 'Tangency/Weighting' sketch and be sure to select the 'Final' option.
https://cad.onshape.com/documents/b234dd7c0b23405dfebd551c/w/2c022de196b503c1ae096790/e/58a4e2de4c6963f95e46deaa
Have fun - Philip . . .
Here is a custom feature that does a lot of what i was looking for. The original work was done by Mark Barr and the tangency capability was added by Ilya Baran after i promised to leave him alone if he exposed the functionality. All i did was make it work the way i wanted it to!
So, how does it work?
For an open spline, you can now optionally select any edge or sketch entity to define the tangent vector (and optionally flip the tangency direction).
The end of the spline does not have to touch the end of the edge/entity defining the tangent direction.
You can use the same edge/entity for both start and end tangency if you wish.
The weighting of the tangency is proportional to the length of the edge/entity nominated.
There is a variable 'TangencyWeightingFactor' that you may want to change for very large or very small parts.
Best practice?
Use sketch entities to define the tangency/weighting
In this public document, edit the 'Tangency/Weighting' sketch and be sure to select the 'Final' option.
https://cad.onshape.com/documents/b234dd7c0b23405dfebd551c/w/2c022de196b503c1ae096790/e/58a4e2de4c6963f95e46deaa
Have fun - Philip . . .
Philip Thomas - Onshape
Tagged:
3
Comments
Just to be clear, the weighting is controlled by the length of the tangent entity. For that reason, i have suggested that it be a sketch entity, perhaps even sitting on top of an edge (thereby decoupling the direction from the magnitude). If you specifically wanted a numeric weighting, you could do that but you would not be able to set an upper bound as you would need to allow larger numbers for larger parts (or use a scaling factor as i have done here). If you wanted to modify this custom feature to accept numbers (instead of using the length of the edge), you should be able to do so fairly easily.
As for curvature continuous guide curves, you'll have to wait just a little longer for those!
Have fun - Philip
dynamic while editing. Not sure I like having to edit a parent sketch, then waiting to see
the effect after a rebuild.
I suppose one could add vectors to the end of the spline and with a manipulator function, make this really dynamic. I suppose I should do this next and give 3D_Spline a lift up in functionality.
I can help you - anytime a feature is not the last feature in the feature list, you get a 'Final button'.
Simply add a dummy feature (anything) after the 3D spline feature and you will get a 'Final' button - press it and now when you edit any of the values in the custom feature, you will see the results.
Pease keep working on this to make it better!
So I can edit the "Tangency/Weighting" click on final and it shows me the spline updating. Also, I can rollback model and it shows me the "final" state up to rollback position. This is what I expected:
I'm guessing I'm a little critical of "Final" and not understanding it's full functionality. This is my problem. In this example, it shows nicely and I'm seeing it's power.
It's kinda convoluted and not intuitive, I mean I want to edit the 3D_Spline yet I have to edit a parent control sketch "Tangency/Weighting".
It's not impossible to train an old dog new tricks.....
So, if I add vectors to the 3D_spline and make it behave like a 2D sketch spline, are you going to clobber my code and write a better version? Not you in general, but the guys with the source code.
Also, on a side note, let's take 3D_spline for instance. If I made your version better, do I make it public and now there's a philip 3D_spline & a billy 3D_spline?
How are community driven features going to be controlled?
Well done for figuring out 'Final' - yes its very powerful and helps with any type of feature that may reference anything created in a previous feature - this is a huge problem with other cad systems and we are very proud to offer it in Onshape.
You're right, we don't have a dedicated mechanism for curating/disseminating custom features, but we will!
Today just making them public and posting a link in this thread (or elsewhere on the FeatureScript forum) is a good start.
The good news is that once someone links to a document you have made public, they are notified of newer versions when they become available AND it doesn't matter if at some later date you unshare it - anyone that used it still has it (so their documents will always regenerate).
As for us writing a better one - maybe! But again, it doesn't matter - custom features are first class citizens. If they work now, they will always work in the future. Someone may in a single part studio use your spline and my spline and an Onshape 3D spline - all will work now and in the future.
- Philip . . .
Philip is trying to show me something new. It does work. I think it has to be taught though, it's not
obvious to a user, at least a SW & Pro/E user. I'm not opposed to learning new things, I'm just a little stubborn.
I loaded Ilya Baran's 3D Spline 2 and it does not seem to have any weighting for tangency. Trying to create this elbow loft and think the 3D Spline will be answer to getting the top to be correct.
The loft is not accepting both of the 3D splines as guides; that might be cuz they are connected at one end. I am going to play with it.