Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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.

Options

New Feature: Tween Curve (WIP)

Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 119 PRO

This is a bit of work in progress at the moment but it's semi functional and I need to work on other tools that this tool is the backbone of. Posting now for public comment. Introducing Tween Curve

image.png

Simply select input curve A and input curve B and input a tween value between 0 and 1 and this tool outputs an approximate medial curve AB that is that percentage morphed between the two inputs.

image.png

Currently it's limited to single edges for each of the inputs because I'm still working out how to make piecewise segments work for continuous path geometry. This tool by itself is already useful for some workflows but the larger goal is to use this feature as a starting point for other features I've got planned like a frame unrolling script that can unfold frame geometry with a k factor specified by the tween, or other shape deformation scripts that I've got in the works.

Comments

  • EvanReeseEvanReese Member, Mentor Posts: 2,443 ✭✭✭✭✭

    Let's goooo!

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • MichaelPascoeMichaelPascoe Member Posts: 2,401 PRO
    edited July 7

    Noice! This is going to be sweet.

    I need a web extension to auto post on anything @EvanReese does. That way I won't need to log on =P. I never seem to beat you to it.


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴
  • Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 119 PRO

    Be warned: it's a little buggy. I'm currently reworking the orientation checks between input curves to handle orientation flipping between paths. Sometimes I'll still come across a zero-crossing case with one curve to another and haven't found a universally robust way to find path direction.

  • EvanReeseEvanReese Member, Mentor Posts: 2,443 ✭✭✭✭✭

    See I feel like you're always the fastest gun in the west 🤠🌵

    @Derek_Van_Allen_BD Can you just do your best and add a flip button for those cases? You may not really be able to cover them all. Maybe not though since you're using these functions as a backbone of other features.

    As an aside, I could imagine cases for another mode to create a certain number of tween curves. Instead of a "tween fraction" the input is "steps".

    image.png
    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 119 PRO

    I did have the flip button implemented at one point in time but as you say this is intended to be the framework for much more advanced features. If I don't have a robust method of alignment checking worked into the base level function I'm just going to be needing to tackle that same problem later at higher levels of abstraction, and in more places at once. If you dig back into the history of the 3d arc utilities functions underneath this I dealt with a similar problem with making tangent 3d circular arcs. There are 2 ways to solve for a tangent circular arc and I had a hard time guaranteeing that the one chosen would be the correct one for a given application for a minute there, so I was just drawing both and keeping the less nonsensical one. I later found a better way to guarantee that things draw correctly but I don't think that same end evaluation technique works in this case, though I admit I haven't tried it yet.

  • EvanReeseEvanReese Member, Mentor Posts: 2,443 ✭✭✭✭✭

    Might it work to use evDistance() on the end points and choosing the one that minimizes the total distance? I'm sure you could find exceptions.

    image.png
    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 119 PRO

    That… is much more intelligent than what I've tried so far. I started with the current implementation attempting to find tangent vectors because that's how the arc utilities had to function (and also is how frames function) but there are extra factors at play in both of those implementations that don't necessarily apply here. Won't cover the periodic curve cases, but there's already a whole subroutine there for those.

  • EvanReeseEvanReese Member, Mentor Posts: 2,443 ✭✭✭✭✭

    nice! you may already be measuring the distance between all verts on both curves anyway, in which case there's no need to limit it to the endpoints. You could use 'em all.

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • romeograhamromeograham Member, csevp Posts: 710 PRO

    Thanks for putting this out there @Derek_Van_Allen_BD . I'll give it a try too and give feedback.

Sign In or Register to comment.