No announcement yet.

Mesh intersections 2

  • Filter
  • Time
  • Show
Clear All
new posts

  • Mesh intersections 2

    This is a follow-up from a previous post (Mesh intersections). I originally posted these questions as a reply to the original post, but haven't gotten any response so I'm trying again by starting a new thread.

    In my original post, I was concerned with eliminating triangle intersections that occur when leaves or branches collide or that occur at branch intersections because the meshes composing the adjoining objects don't share common vertices. Using the Cage generator seems to work well with the latter issue. However I'm not doing as well at resolving leaf and branch collisions.

    Under the Placement property I'm clicking "Edit leaf collision" and checking "Enabled." I'm choosing "Spread then cull," setting the spread factor and cull tolerance to 1, and choosing "Favor accuracy." It seems to be reducing collisions, but not eliminating them. Some of the leaf meshes still intersect each other, and the algorithm doesn't seem to consider leaf/branch intersections at all (if I do a node edit on the branch with leaves, moving it so that the leaves clearly intersect another branch, the leaf collision algorithm doesn't make any adjustment to the leaf positions).

    My test case is a very simple tree consisting of a trunk, a single level 1 branch, a single level 2 branch, and some leaves on the level 2 branch with a plane mesh (I'm using the eval version of Speedtree Cinema 7.0.4). I'm exporting the mesh to an OBJ, then using my own algorithm to render the triangles in the OBJ output file and test for intersections.

    Increasing the spread factor seems to just spread out all the leaves, regardless if they intersect or not. This obviously reduces intersections, but it isn't clear that the algorithm is actually testing for intersections and resolving those that are found. Changing the cull tolerance doesn't seem to have any impact on this very simple structure.

    What else can I do?

    I'm also a little confused by a statement in the response to my original post that the leaf intersections are calculated using spheres. I haven't done my own calculations, but just looking at my leaf structures, it seems that the bounding spheres of just about all of them would intersect.

    On a different note, can SpeedTree export triangle meshes of the leaves themselves, rather than just the mesh "cards"? I'd like to have triangle meshes of each of the actual leaves, rather than a mesh of a foil or plane with a leaf texture attached to it.

    Thanks for your help,

  • #2
    Sorry for the delay in replying.

    Unfortunately, the leaf collision tool is more for thinning out colliding meshes rather then totally eliminating them. You can increase the cull to large numbers and keep adding more leaves to fill in the empty spots, but it will not be intersecting free. Adding more levels and editing the position/alignment controls also decreases the chances of leaves intersecting as often.

    As for the the spheres comment, the spheres scale can change in size. For example, it can just cover the center of the mesh to cover the whole mesh.

    Also, the mesh cards is the default setting for leaf meshes. you can also create triangle or quad meshes in a outside program, save it as a .OBJ file, and import it as a mesh into the modeler and in the property bar, set the leaf generator node being used a the mesh with it's corresponding material.

    I hope this helps!


    • #3
      Thanks Sonia, that helps!