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

reverse a curve's direction?

billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,015 PRO
Is there a simple way to reverse the direction of a curve?

evEdgeTangentLine(context, { "edge" : curve, "parameter" : i }).origin;

such that i=0 moves to the opposite end of the curve.

Comments

  • Options
    ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,178
    We don't have a way to do that currently.  What is your use-case?
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • Options
    billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,015 PRO
    edited December 2016
    fit spline, I was hoping I wouldn't have to deal with this, but it won't fix itself.

    Below are dis-jointed arcs, it'd be nice to change the direction for arc on left.

    I think I'll have to pass through my curve selection list and check the direction for each curve.



    Here's another example, the direction isn't correct.

    Highlighted spline's direction is different from 2nd spline. 2nd spline is mirrored from 1st so the geometry was created correctly.



    I think I have to sort the list and get the curve directions to all line up.

    Do you know a special algorithm like 'dirty man in the middle' that will fix this in one line of code?




  • Options
    billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,015 PRO
    I have the closed option working:


  • Options
    billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,015 PRO
    It was more than 1 line of code


Sign In or Register to comment.