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

3D polylines with featurescript?

albjerrealbjerre Member Posts: 23 ✭✭✭
Hi. I want to make featurescript where I can make a 3D polyline with featurescript. When the polyline is created I also want to be able to make sketch fillets on the corners afterwards. How should I approach this?

One of the featurescript samples is "Featurescript 3D spline". Can I use this as a basis?
https://cad.onshape.com/documents/573f7b36e4b02e83c71782fc/w/7b1a7d7098a0e39517ade066/e/5718da06c22e7b08a5fb58b3

Best Answer

Answers

  • Options
    albjerrealbjerre Member Posts: 23 ✭✭✭
    edited February 2018
    Thanks @ilya_baran
    For some reason, I did not see your reply before know. Yes, that custom feature was exactly what I needed.
  • Options
    angelo_scozzarellaangelo_scozzarella Member Posts: 58 EDU
    Making a number of 3D line segments is relatively simple -- and yes, the 3D spline can be used as an example.  Filleting corners would not be (you'd have to create the right sketch plane, "use" the lines and fillet the corner and then trim them).  Here's a script that creates the lines and arcs given 3D points and a radius: https://cad.onshape.com/documents/453c51c8807f37082c1247f3/v/9dac4678249816079b401245/e/8b9b8d950f11fd8c3015a878
    Currently, to turn it into one wire body (as opposed to the mixture of 3D lines and sketch arcs that it is currently), you'd have to convert it into something opCreateBSplineCurve could take.  In the near future, you'll be able to combine the results into one curve more easily.
    I’d like to know how making a number of 3d line segment. Or if there is a custom future for polylines 3d. Thank you in advance.
  • Options
    Jonathan_HutchinsonJonathan_Hutchinson Member Posts: 65 PRO
    Hi @ilya_baran. On this subject, do you think it would be possible to discretize a spline curve into a polyline with max deviation input? I come from using Rhino, and there was a tool for instance called FitCurve where you enter an amount for max deviation.

    My thought is that you maybe do this by converting a spline into a series of arcs and thenyou use the chords to achieve the desired deviation, instead of just dividing up until you achieve the target (which would mean you get a high concentration of point divisions where they aren't needed).
  • Options
    MichaelPascoeMichaelPascoe Member Posts: 1,735 PRO
    edited July 2023

    Late response to @angelo_scozzarella

    Freeform spline can do this by @Evan_Reese. The 3D Lines (which is already in your toolbar if you search; because it is an official custom feature), can do it as well, but it only does orthogonal lines to the world xyz. 3D Lines can also do fillet corners which is cool.


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   cadsharp.com/featurescripts 💎
  • Options
    Evan_ReeseEvan_Reese Member Posts: 2,068 PRO

    Late response to @angelo_scozzarella

    Freeform spline can do this by @Evan_Reese. The 3D Lines (which is already in your toolbar if you search; because it is an official custom feature), can do it as well, but it only does orthogonal lines to the world xyz. 3D Lines can also do fillet corners which is cool.

    It's been on my list to shamelessly borrow the fillet code from 3D lines for Freeform Spline, but it's not as straightforward as I'd hoped. I still think I will do it at some point.
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • Options
    MichaelPascoeMichaelPascoe Member Posts: 1,735 PRO
    edited July 2023

    Edit:
    @Jonathan_Hutchinson, I was not intending to skip your question. Since it was directed toward Ilya, I was going to let him answer that since I'm not sure about that topic. 


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   cadsharp.com/featurescripts 💎
  • Options
    eric_pestyeric_pesty Member Posts: 1,547 PRO
    There's also the routing path FS which is an "improved" version of the 3D lines allowing specifying a direction other xyz for a segment. 
  • Options
    Evan_ReeseEvan_Reese Member Posts: 2,068 PRO

    Oi, who voted me down? Show yourself! 

    @Jonathan_Hutchinson, if it was you, forgive me; I was not intending to skip your question. Since it was directed toward Ilya, I was going to let him answer that since I'm not sure about that topic. 

    :# Oops I mis-clicked haha!
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • Options
    MichaelPascoeMichaelPascoe Member Posts: 1,735 PRO
    edited July 2023

    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   cadsharp.com/featurescripts 💎
Sign In or Register to comment.