Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gap between spline mesh segments
#7
Hi
  1. I have a more precise tangent computing code that in my tests removed the gap between meshes in some cases, but other cases still have the gap, but less visible it seems. Give it a try:
    Go to the following method in CurvySplineSegment
    Code:
    public Vector3 GetTangent(float localF, Vector3 position, Space space = Space.Self)
    and add the following at its start
    Code:
    if (Spline.Interpolation == CurvyInterpolation.Bezier)
                    return CurvySpline.BezierTangent(threadSafeLocalPosition.Addition(HandleOut),
                        threadSafeLocalPosition,
                        threadSafeNextCpLocalPosition,
                        threadSafeNextCpLocalPosition.Addition(cachedNextControlPoint.HandleIn),
                        localF).normalized;
    As you can see if you check the code, the current implementation is computing the tangent by computing the delta between two very close points. The code above uses a specific implementation for Bezier splines.
  2. The handles you compute seem weird to me. It seems that, at least in some cases, the spline's first CP has a zero length handle, while the second one has a non zero length handle. This leads to a stretched spline, which you can notice from the UVs being stretched at the end of the mesh. Maybe solving this will solve the gap in mesh.
  3. This is not a solution, but as long as you are trying to fight the issue, it might be wise to set to false the Optimize parameter in the Shape Extrusion module, under the Path tab. Once the problem solved, you might then set Optimize back to true, and see if there are any regressions
  4. FYI, the tangents are computed when the mesh is rasterized in the Input Spline Path module. The equivalent class is InputSplinePath. The rasterization happens in its base class, SplineInputModuleBase, in its GetSplineData method. Look for the calls to InterpolateAndGetTangent in that method, that's where things happen.
    Those tangents are then used by the Shape Extrusion module to make the mesh volume. Look for BuildShapeExtrusion.Refersh(), and specifically its usage of path.Directions (the list of tangents of each rasterized point).
  5. To go back to the unique mesh solution: you know your use case better than me, so you are probably right when you say that this solution is not fit for your use case. But please allow me to add some points that might make that solution viable in your eyes. If these points are invalid, you don't need to take the time to explain to me why:
    You can use the Split parameter in the Volume Mesh module to split that single mesh into different meshes. The split meshes will not have the issue. The issue seems to come from using different extrusions with different splines. Single spline -> Single mesh extrusion -> Split Volume -> Different meshes with no gaps
    About joining track, you can concatenate your different track splines into one spline, then generate a single extrusion out of it.

I hope this helped
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Messages In This Thread
Gap between spline mesh segments - by Beaver_Boy - 07-27-2022, 11:08 AM
RE: Gap between spline mesh segments - by _Aka_ - 07-27-2022, 02:00 PM
RE: Gap between spline mesh segments - by _Aka_ - 07-27-2022, 10:49 PM
RE: Gap between spline mesh segments - by _Aka_ - 07-29-2022, 03:01 PM
RE: Gap between spline mesh segments - by _Aka_ - 07-31-2022, 08:22 PM
RE: Gap between spline mesh segments - by dromo - 10-18-2022, 06:47 PM
RE: Gap between spline mesh segments - by _Aka_ - 10-19-2022, 08:47 PM
RE: Gap between spline mesh segments - by dromo - 10-20-2022, 09:19 AM
RE: Gap between spline mesh segments - by _Aka_ - 08-06-2022, 12:11 PM
RE: Gap between spline mesh segments - by _Aka_ - 10-21-2022, 07:29 AM
RE: Gap between spline mesh segments - by dromo - 10-24-2022, 09:37 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Adjust radius of generated mesh via script? Shackman 1 3 03-26-2024, 01:12 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
  GO can't fit end of the spline GameDeveloperek4123 3 13 03-04-2024, 11:06 AM
Last Post: _Aka_
  Keeping a fixed spline length jh092 3 16 02-21-2024, 06:25 AM
Last Post: Primrose44

Forum Jump: