Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mesh Lines - Horizontal and Vertical Edges
#1
Dear Curvy support,

Using curvy in a production visualization project that requires rendering meshes as lines.  Is there a way to get a struct of horizontal and vertical lines that make up the generated mesh?

Cheers    
Reply
#2
Hi,
When generating meshes, Curvy Splines produces instances of Mesh. Using Unity's API, you can get the list of vertices and triangles of that mesh. From that, you can produce the list of lines making your mesh. Via dot product (or other means), you can deduce what lines are horizontal or vertical.
I hope this helped. If and when you feel like it, please leave a review for the asset, that helps a lot.
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
#3
(09-19-2020, 04:59 PM)_Aka_ Wrote: Hi,
When generating meshes, Curvy Splines produces instances of Mesh. Using Unity's API, you can get the list of vertices and triangles of that mesh. From that, you can produce the list of lines making your mesh. Via dot product (or other means), you can deduce what lines are horizontal or vertical.
I hope this helped. If and when you feel like it, please leave a review for the asset, that helps a lot.
Have a nice day

Are you creating the mesh with your own code or with unity?
Reply
#4
Curvy Splines uses Unity's API to create meshes. That way the produced meshes are compatible with all existing code and tools made for Unity's meshes.
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
(09-19-2020, 05:03 PM)Krypton Wrote: Are you creating the mesh with your own code or with unity?

So in other words: with both my code and Unity
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#6
Great, can you show where I can extract this information directly from your code because we don't want generate the entire mesh with UV and triangles.  Just the edges.
Reply
#7
When generating a mesh through shape extrusion in the Curvy Generator, and if you don't want to work with the Unity mesh the Create Mesh module creates, you can get the relevant data from the Volume Mesh module. It has an output called V Mesh, an instance of the CGVMesh class. In it you can find the list of vertices and triangles.
The relevant work happens in BuildVolumeMesh.Refresh().
Each CG module has a On Before Refresh and an On Refresh events.
You can create your own custom CG module if needed: https://curvyeditor.com/documentation/ex..._generator
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#8
Can you suggest how to get the Horizontal and Vertical data from the Volume Mesh module.
I needed to integrate another asset called Procedural primitive with Linefy and he helped with getting the structs for Horizontal and Vertical edges.
Would you be able to give pointers of how this can be done also with Curvy's mesh generation code.

Thanks in advance.
Will also leave an awesome review for your help.
Reply
#9
Same as here:
(09-19-2020, 04:59 PM)_Aka_ Wrote: Using Unity's API, you can get the list of vertices and triangles of that mesh. From that, you can produce the list of lines making your mesh. Via dot product (or other means), you can deduce what lines are horizontal or vertical.
To get vertices : CGVMesh.Vertex.To get triangles CGVMesh.SubMeshes.Triangles
Examples of "other means": check the value of Vector3.Angle(Vector3.up, yourVector)
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#10
"Extending the Curvy Generator is the most sophisticated way to extend Curvy, but the most fun part, too! Though not rocket science, you'll need a good understanding of the Generator internals to successfully write quality modules."

Do you have more detailed documentation of how the Generators internals work?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Generate Mesh Spline from GameObject processor 4 128 10-01-2020, 11:00 AM
Last Post: _Aka_
  Generated mesh using bezier spline is not following the path accurately processor 3 238 08-25-2020, 04:39 PM
Last Post: _Aka_
  How to make dashed lines? Econt 3 304 08-13-2020, 01:47 PM
Last Post: _Aka_
  Allow higher amount of mesh-faces on extrusion King_of_Limbs 3 414 07-11-2020, 09:02 PM
Last Post: _Aka_

Forum Jump: