Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing range affects generated mesh
#1
Hi _Aka_,

I noticed that changing the range of the Shape Extrusion node causes the cross shape of the generated mesh to change as well. The change is very subtle, but it does affect my use case. I am generated multiple meshes with different ranges overlayed on top of each other using the same spline path. Here's a video of it in action:

Video: https://imgur.com/GD4a3fZ
Chehttps://imgur.com/GD4a3fZ
Check this part of the video:
[Image: 4XaXRke.png]

Thanks as always!
Reply
#2
Hi
The extruded polygonal shape is only an approximation of the perfect geometrical shape that represents the extrusion. The less polygons, the worst the approximation is. In the video you send, the shape of the last couple of polygons (the last quad) matchs more or less the perfect shape depending on its length, and that's normal. The important thing is that when an extrusion is made of multiple parts, those parts match with each other. This is illustrated in the scene I attached to this post. It contains 3 generators, one that make generates a full mesh, and the two others that generate the same mesh but in two parts. Both shapes are coherent.
If you increase the resolution of the extrusion and/or disable the Optimize option and/or reduce the optimization's Angle Threshold, the generated mesh will have more polygons making what you described less pronounced.
Did I answer your question?
Have a nice day


Attached Files
.unity   GameJazz Change of shape.unity (Size: 94.84 KB / Downloads: 1)
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
(08-12-2022, 05:03 PM)_Aka_ Wrote: Hi
The extruded polygonal shape is only an approximation of the perfect geometrical shape that represents the extrusion. The less polygons, the worst the approximation is. In the video you send, the shape of the last couple of polygons (the last quad) matchs more or less the perfect shape depending on its length, and that's normal. The important thing is that when an extrusion is made of multiple parts, those parts match with each other. This is illustrated in the scene I attached to this post. It contains 3 generators, one that make generates a full mesh, and the two others that generate the same mesh but in two parts. Both shapes are coherent.
If you increase the resolution of the extrusion and/or disable the Optimize option and/or reduce the optimization's Angle Threshold, the generated mesh will have more polygons making what you described less pronounced.
Did I answer your question?
Have a nice day

Thank you for providing the example. 

"The important thing is that when an extrusion is made of multiple parts, those parts match with each other."
This only happens when the start/end of the range falls perfectly on the start/end of a new polygon. If the range is changed, you can see that the extrusion shapes don't match. This is problematic for the use case where gaps are needed in overlapping extrusions. I attached a screenshot to elaborate. Thanks again for your help!

[Image: uNnxQDK.png]
Reply
#4
I see. Can you please send me that scene?
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#5
(08-12-2022, 07:03 PM)_Aka_ Wrote: I see. Can you please send me that scene?

Sure. It's the same scene you sent me. I only changed the range parameter


Attached Files
.unity   GameJazz Change of shape.unity (Size: 127 KB / Downloads: 1)
Reply
#6
Hi



Here is an basic drawing explaining the phenomena you are highlighting:

   

In black is a spline

In blue annotations, showing 4 points, each one corresponding to a range value.

In red and green two extrusions with minimal polygon count. This is an exaggerated case, but it is perfect to show the phenomenon.

As you can see, when you change the range of the extrusion (red vs green), the extruded shapes will diverge and not overlap each other. This issue is less present when you increase the polygon count. Besides increasing the polygon count, the other solution is to make the full extrusion made of several smaller ones, to match the shape of the partial extrusions you already have. This is what I done in the attached scene. Now Total is made of 3 parts, 2 of which matching your partial extrusions, and one matching the gap. That way, everything overlaps.

Did this help?
Have a nice day


Attached Files
.unity   GameJazz Change of shape 3.unity (Size: 147.39 KB / Downloads: 2)
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#7
(08-16-2022, 12:16 PM)_Aka_ Wrote: Hi



Here is an basic drawing explaining the phenomena you are highlighting:



In black is a spline

In blue annotations, showing 4 points, each one corresponding to a range value.

In red and green two extrusions with minimal polygon count. This is an exaggerated case, but it is perfect to show the phenomenon.

As you can see, when you change the range of the extrusion (red vs green), the extruded shapes will diverge and not overlap each other. This issue is less present when you increase the polygon count. Besides increasing the polygon count, the other solution is to make the full extrusion made of several smaller ones, to match the shape of the partial extrusions you already have. This is what I done in the attached scene. Now Total is made of 3 parts, 2 of which matching your partial extrusions, and one matching the gap. That way, everything overlaps.

Did this help?
Have a nice day

Thank you for the explanation. This workaround should work for my current use case. In the future, are there any plans to generate the partial extrusion based on the shape of the full extrusion?
Reply
#8
Hi
No plans to do so, because doing so will go against other constraints. For example, imagine someone sets a constant mesh resolution of one polygons row every meter, then sets the length of the partial extrusion to 1.5 meters (out of a 2 meters spline). The 2nd row will be only half meter long. If the extrusion is on the full spline, the second row will be 1m long, and will not match the shape of the 0.5m long row. If we apply what you suggested, the shapes will match, but the total extrusion will have 3 rows, the first one of 1m length, and the two other of 0.5m length each, breaking the constraint of having 1m long rows.
I hope my explanation was clear.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#9
(08-19-2022, 08:08 PM)_Aka_ Wrote: Hi
No plans to do so, because doing so will go against other constraints. For example, imagine someone sets a constant mesh resolution of one polygons row every meter, then sets the length of the partial extrusion to 1.5 meters (out of a 2 meters spline). The 2nd row will be only half meter long. If the extrusion is on the full spline, the second row will be 1m long, and will not match the shape of the 0.5m long row. If we apply what you suggested, the shapes will match, but the total extrusion will have 3 rows, the first one of 1m length, and the two other of 0.5m length each, breaking the constraint of having 1m long rows.
I hope my explanation was clear.

Correctly me if I am wrong, but I don't think it would violate the other constraints? If my understanding is correct, instead of basing the full extrusion on the partial extrusion, we can base the partial extrusion on the full extrusion. For example, in this image, black is the full extrusion, blue is the current implementation of a partial extrusion, and red is what I am hoping to get for the partial extrusion. It is based on the full extrusion.

[Image: R1VBVGz.png]
Reply
#10
Hi

The behaviour you described could be another behaviour, an optional one, that can be implemented in Curvy. I am adding it to the backlog, and will look into implementing it in a future update.

That behaviour would be useful for some cases, like yours, but I still believe that the current behaviour should remain available, and even be the default one.

If you disagree with my last sentence, allow me to explain:
I added to your illustration in green what could be the spline used for such an example. The current behaviour being one that always centers the sections around the spline, I simply drawn a spline that goes through all the sections' centers of the current behaviour (black and blue). As you can see, your suggested behaviour (red) has a section that is not centered on the spline. This makes sense for your use case and other people's use cases, but I believe most people will see it as an issue if their partial shape extrusion deviates from the spline.
   
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


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_
  Not seeing mesh extended after following YT PaulM 1 3 02-02-2024, 12:01 PM
Last Post: _Aka_
  Trigger Zones along Spline Mesh dlees9191 1 5 01-05-2024, 10:18 AM
Last Post: _Aka_

Forum Jump: