Grasshopper

algorithmic modeling for Rhino

I'm new in Rhino and just trying to figure out the basic philosophy of how things are actually put together.  Today's lesson: meshes.

In Max they have smoothing groups to indicate which faces should "flow" into which adjacent faces (as opposed to having abrupt angles displayed between the two faces).  In Maya, if I recall, they do a similar thing with "flags".  I've been trying to figure out the corresponding mechanism in Rhino meshes and I'm beginning to believe that you just have to repeat vertices to make "creases" between faces.  So the Rhino box has 24 "vertices" which, is apparently because each vertex is repeated for each face it belongs on - 6 faces times four vertices per face is 24 vertices.  Is that really the case?  It seems wasteful.  I'm assuming that if you only had 8 vertices that the display would be attempting to make the edges "blend together".  This means that the cube is really just six conveniently placed squares.  Does Rhino even know that these six squares form a closed mesh?  I know there is an "IsClosed" property on meshes. I assume it's returning false for boxes?

Aha!  I was going to ask how Rhino still "knew" that the three vertices were actually one so when you dragged it you would drag "that single" vertex instead of one of three but now that I actually construct a box and drag, I see that Rhino in fact, doesn't know that and you do in fact drag one of three so that seems to back up my assumptions here.

Is this really the only way to make "creases" in 3D meshes?  I just want to make sure before I spend a lot of time making my meshes based on this assumption.

I'll attach my (apparently incorrect) code FYI.  It's a grasshopper plugin.  Just trying to learn how to code in this system.

Thanks!

Darrell Plank

Views: 1273

Attachments:

Replies to This Discussion

Duplicating vertices may seem wasteful, on the whole, but it's 92bits you're talking about. Enough to describe 3 pixels in a bitmap. It's an index pointing to a list of vertices. For each vertex with unique properties (color, UV map, vertex normal) the vertex is duplicated. So if you weld a mesh using the weld command with an angle tolerance of more than 90 degrees you're left with a box with 6 faces and 8 vertices.

It's quite a common way to describe meshes, Also the way your graphics card consumes meshes, so there's little CPU processing needed to process the meshes and feed them to the graphics card. If it's hard drive space you're worried about, there may be some compression possible. Apart from primitives, I don't know a geometry that do not represent a box by having four faces (including maya's polygons).

A mesh is considered closed when there are no naked edges. So for boxes this does not return false. I assume that internally spatial queries are used (or perhaps a check if the vertices are exactly the same)
(see https://github.com/mcneel/rhinocommon/blob/master/dotnet/opennurbs/... )

Conclusion: If you want faces to show as having a (semi) creased edge, you'll have a vertex direction for each vertex.

However, if your goal is to make gears, I'd skip the whole part of creating meshes, and leverage Breps and extrusions to create the geometry, or using Extrusion (the geometry) might be a solution to create lightweight geometry, and forget about creating meshes yourself.

My main goal is to learn about grasshopper plugin development.  Usually when I'm doing 3D plugins or scripts, a gear is the first thing I do - it's relatively simple but not trivial and the result can be occasionally useful.  Yes, you're right - this is handled at the lowest levels by vertex normals.  I'm just a little surprised that it's not handled differently at higher levels.  In max, if you produce a box, then at the UI level you are given one vertex at each corner.  Grab a vertex and move it and three sides of the box deform to follow the vertex.  You don't have to select three separate vertices to get it to move and this is the way people intuitively understand a box to work.  Ditto in Maya and Blender so it just surprises me a little.

Built the gear using repeated vertices and everything's dandy.  Thanks!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service