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.

Projected Curve in 2D? (average of two splines)

NAENAE Member Posts: 7 ✭✭
Hello,

I am trying to get an average of 2 splines on the same sketch. Ideally, it could be a single, or multiple splines between the two splines.

Single line between:



Multiple lines between:


Any ideas?

Comments

  • Alex_KempenAlex_Kempen Member Posts: 248 EDU
    You can average two straight (non-spline) lines by creatively using a symmetric constraint - make the two lines you want to average symmetric about another line which goes down the middle. You’ll still need to do some work constraining the ends, but it should be pretty close to what you want.

    As to 2D splines, I’m not sure there’s an easy way to do so in sketches since their shape is quite custom. You also can’t use custom features in sketches, so there’s not a lot that can be done outside of the standard toolset provided by Onshape.

    if you explain why you need averaged splines and/or what you’re trying to accomplish with this, myself and others might be able to provide better suggestions.
    CS Student at UT Dallas
    Alex.Kempen@utdallas.edu
    Check out my FeatureScripts here:



  • NAENAE Member Posts: 7 ✭✭
    I am literally trying to accomplish lines  :D

    This is more art than engineering, here's a recent piece:


  • NAENAE Member Posts: 7 ✭✭
    Through a search, I found that Rhino has a tool called "TweenCurves"
    http://docs.mcneel.com/rhino/5/help/en-us/commands/tweencurves.htm

    I'm an engineer at heart, so my first tools are CAD tools. I think I'll jump the shark and try something like Rhino for this - not everything is a nail, as they say.
  • BenTaylorBenTaylor Member Posts: 44 PRO
    I'm not sure how robust this technique is, but you could:
    • create a sketch with 2 base splines.
    • create another sketch on the same plane.
    • draw vertical construction lines with as many segments as you want between the points of the base splines.
    • constrain all collinear construction lines to be equal.
    • draw a spline with a point on each of those points.
    Here's an example: Spline Averaging

    If you really want this functionality in OnShape, you could write a FeatureScript that allowed you to select the top and bottom curve, set the number of internal curves, and have it generate them for you. I'm not experienced in that area of OnShape yet, though.
    Ben Taylor
    Lead Mechanical Engineer @ Healing Innovations
    Onshape Ambassador
  • NAENAE Member Posts: 7 ✭✭
    @BenTaylor
    I like it! That makes a lot of sense, I don't know FeatureScript either. 

    Can anyone suggest a starting point on this?
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,686
    evEdgeTangentLines() will give you points along a spline, then all you have to do is simple math to get interpolated points and then use opFitSpline() - simples :)
    Senior Director, Technical Services, EMEAI
  • steve_shubinsteve_shubin Member Posts: 1,096 ✭✭✭✭
    @NAE

    Here is a workaround

    Utilizing @Evan_Reese Face Curves featurescript —

    1) take two splines

    2) loft them

    3) use the Face Curves FS to tween

    4) project curves to plane with USE tool



  • steve_shubinsteve_shubin Member Posts: 1,096 ✭✭✭✭
  • NAENAE Member Posts: 7 ✭✭
    @Evan_Reese Nice work on the Face Curves! 
    I very much appreciate you sharing your work with the world. #goodhuman

    Thanks, @steve_shubin for the tutorial as well! 
  • EvanReeseEvanReese Member, Mentor Posts: 2,136 ✭✭✭✭✭
    ☺️
    Evan Reese
Sign In or Register to comment.