Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to tell if a spline is straight? / Optimize problems with straight splines
#1
Question 
Dear members of curvy spline community.

Is there a quick wat to evaluate if a spline is straight? 

Currently, I am traversing the spline and evaluating the tangent at each control point. If the traversal detects a different normal , I consider the spline "not straight".   Not sure if this is the best or most efficient way of doing it.  I wonder If curvy have a built-in function for it .

I also want to take advantage of this post and report a weird behaviour when using "Optimize" on a straight spline.  
If a curvy generator has the shape extrusion path "Optimize" parameter enabled, some things could go wrong.

For example:
  • Split: Optimize seems to ignore the "split" parameter (which subdivides the generated extruded geometry). However, if the spline has curvature,   the "split" functionality kicks in as expected.
  • Custom spline profile: We have a code that modifies the profile shape spline based on a provided height value. If optimized is enabled, and the path is straight, curvy ignores our spline profile changes and generates a "flat" mesh (with no height) .  If we disable "optimize" or have it on a "non-straight" spline, curvy works as expected.
  • Shadows casting:  In some instances, we are using curvy spline to generate tunnel geometry. If "Optimize" is enabled on a straight path to generate the tunnel, the geometry can fail to block the light and it does not cast shadows.  once again, if "Optimize" is disabled or we use a "non-straight" spline, curvy works as expected. 

I am using Curvy spline v7.1.6 but I do not think is a problem introduced in this version. I've been using curvy since couple of years and I noticed the problem before. However it is only now that I've managed to understand that "optimize" on a "straight" spline, might cause problems. 


We have a possible work around:

  1. Evaluate if the spline is straight.
  2. If spline is straight, disable "Optimize" 

Thanks for your time and I apologize for the long post. 
Reply


Messages In This Thread
How to tell if a spline is straight? / Optimize problems with straight splines - by MarioBag - 12-24-2021, 11:46 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Information New free asset: Converter For Unity Splines _Aka_ 0 1 04-20-2024, 08:34 PM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 3 11 04-02-2024, 02:24 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_

Forum Jump: