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.

Is there a featurescript to evenly space points along a (2D) spline.

Cobalt_EchoCobalt_Echo Member Posts: 27
I'm working on a large project (personally hobby for 3D printing) which has a TON of splines.  I'm trying to make points along the spline that are evenly spaced.  Is there a way to do this more effeciently then creating points and then having to dimention on each one?  Hard to explain, so pic attached.



Comments

  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 547
    It would be easy to make a FeatureScript which outputs 3D points evenly spaced along a spline, or a FeatureScript which creates a spline from many 3D points (input manually, or from a CSV file...). Neither of those happen live in a sketch though.

    So, what's the purpose of putting the points along the spline? Do you need the points to define the spline? Or the spline to define the points?
  • Cobalt_EchoCobalt_Echo Member Posts: 27
    I need the spline to define the points.

    Basically, I'm trying to make a wireframe of a ships hull based off old 2D sketches.  I've tried using it with less "wires" but there are to many anomolies, so I'm having to go back and add a ton more.  Evetually to be surface lofted and/or filled.

    The red lines are the planes for each deck of the ship.
    https://cad.onshape.com/documents/bd55d146aca05eabb86ca6b4/w/11afcdc66103aab94bb119e3/e/47f36138be3f0f94f4cbedb3
  • _anton_anton Member, Onshape Employees Posts: 64
    If you just need points equally spaced along an axis, this is doable enough: https://cad.onshape.com/documents/d3ef599b7b90e7ea8624e06a/v/9c164b5945917bf38263750e/e/fc3c694cc505021d082e3a44
  • S1monS1mon Member Posts: 632 PRO
    I don't have the full context of how accurately the rebuilt surface needs to follow the old data, or how it will be used, but be careful in general of making a very "heavy" surface.

    Very early in my career I did the surfacing on a computer mouse based on some probe scans of a hand sculpted ID model. The Pro/E model was 20MB just for the surface because I made cross-sections every few mm, through tons of scan points. For the next generation of the mouse, which was basically  the same shape, I got help from an Alias modeler, and they did a surface which was 17KB, and smoother. Now I could do this surfacing myself in just about any decent CAD tool, but back then it was helpful.

    Each spline through point is an opportunity to make the surface more wobbly because of the small rounding/approximation errors.

    This guideline from Autodesk Alias is just as true for any tool which uses splines:
    https://knowledge.autodesk.com/support/alias-products/learn-explore/caas/CloudHelp/cloudhelp/2019/ENU/Alias-Tutorials/files/GUID-F13D7596-D7AD-45DC-84A6-1065EAE07953-htm.html

  • Cobalt_EchoCobalt_Echo Member Posts: 27
    _anton said:
    If you just need points equally spaced along an axis, this is doable enough: https://cad.onshape.com/documents/d3ef599b7b90e7ea8624e06a/v/9c164b5945917bf38263750e/e/fc3c694cc505021d082e3a44
    _anton, you are my hero!  That is exactly what I was looking for.  Thanks a ton!
  • bruce_williamsbruce_williams Member, Developers Posts: 834 PRO
    @S1mon

    The Alias tutorial link is a really helpful 'primer' on surfacing.  Thanks for sharing your experience and resources!  Big help in knowing best practices and principles.
    www.accuratepattern.com
  • S1monS1mon Member Posts: 632 PRO
    edited January 10
    @bruce_williams
    I've found it to be one of the more useful nuggets of surfacing I've learned. Things to keep in mind when interpreting the Alias advice for Onshape: 
    1. Sketched splines in Onshape are all degree 3. If you sketch a spline with through points, you're creating what Alias calls a multi-span curve (AKA a B-spline which is degree 3). Each point adds another span.
    2. Bridge curve is the only native way to get a spline with higher than degree 3. They go up to degree 5.
    3. Lofts and fill surfaces degree in U and V are determined internally, but the degree and arrangement of the driving curves and tangent influences  has an influence on surface complexity.
    4. Onshape does do what Alias calls a periodic curve (basically a full loop) but they have to be multi-span degree 3 curves.
    Under the hood, Onshape has the ability to do weighted control points, or higher degree curves, or all kinds of stuff, but it needs to be added either to the built in tools, or to custom FeatureScript.
Sign In or Register to comment.