Grasshopper

algorithmic modeling for Rhino

Hi everyone-

 

I've recently been turned on to a Rhino plug-in called Techdraw, which allows for a sort of hardline drawing of objects: edges, hidden lines, etc.  One thing it does is identify creases in an object...so for example, if I have a mesh with loads of faces, it only draws edges that can be seen as a crease in the mesh.  What I'd like to do is be able to replicate this process such that I have a series of polylines in GH that I can perform operations on...clearly there's a way to do it - this plug-in does it - I just wonder how, if anyone has any suggestions for how to start.  The way I imagine it's done is by analyzing the mesh topology and testing for mesh face normal variances across shared edges...but I don't really know how to go about starting that process...I haven't done too much with mesh operations to know if there's any sort of shortcut in this process.  Any ideas?

 

thanks!

 

Dave

Views: 4094

Attachments:

Replies to This Discussion

You can either choose to find all unwelded edges, basically where two vertices are coincident but not connected. Or you can choose to iterate over all edges, finding the maximum angle between the adjacent faces and build your crease-list that way. Which method do you prefer?

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

 

ps. Rule #1 when making friends on the internet: post images as jpeg or png, never bmp, pdf or doc.

Yeah...I'm gonna have to go ahead and go with the first option, mkay?  Thanks!

 

oops...sorry about the bmp...

Darnit, we haven't ported sufficient Topology and Edge methods yet into the RhinoCommon Mesh class. You'll either have to use the old OnMesh class in the legacy components or write an edge finder from scratch.

 

I attached a first attempt. Note that it will return duplicate lines for every crease. If you want to filter these you'll have to add additional smarts.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

 

Attachments:

You can also use our naked edge component which is included in our meshedit addon

http://www.grasshopper3d.com/group/geco

Thanks for the responses...I definitely appreciate it.

 

to], I've taken a look with these (your mesh edit tools are tremendous, have been very useful, for sure)...and it's super close.  But what's odd about the project I'm working on is that these meshes are derived from polysurfaces, which have a lot of seams (I inherited these polysurfaces)...after I've meshed them, when I run the naked edge analysis, they pick up all of these seams that define the brep edges, rather than the creases where there's a significant angular difference (when I say "crease", I mean it in the sense it's used in that techdraw plug-in).

 

If you take a look at the attached files, you'll better be able to see the issue.  From an eyeball perspective, it's pretty straightforward what the "creases" are (and like I said, techdraw does a great job of identifying them, so it has a solver in it that figures it out somehow, and quickly).  It wouldn't be so much of an issue, except that I'm dealing with about 1100 unique elements (they're dry-pack concrete cast-stone panels).  I'm working around without this solver, but it would be extremely helpful both for visualization and for doing the detailing work I'm set to do with it to have the creases defined clearly as curves.  You can see from the "compare" image that the mesh in techdraw also more clearly captures the defining edges.  Also, I'd just really like to know how to do it, because I'm curious and am trying to get into a fuller understanding of mesh modeling.

Attachments:

Hi David,

really thanks for your compliment!!!!

the fastest way would be to use the weld command inside rhino to weld the meshes with a specified angle, let's say in your case 70°.

So this means all faces which have a difference between 0 and 70 ° according to their Vertexnormals get welded. All others will stay with there open edge status. After that you would have the mesh you expected.

You could also write a script which will do this job, but i think rhino command is ok. 

 

hope this helps,

cheers,

to]

Fantastic, this works perfectly!  I had no idea.  This will be massively helpful.  Thank you so much!

Hi David,

 

Having more mesh topology methods in RhinoCommon would be super cool and I would find it really nice for lots of stuff.

Ideally it would be something that could do everything a half-edge structure can.

 

ie to be able to return:

 

- ordered vertices around a face

- ordered edges around a vertex

- the face adjacent to a directed half-edge

- the pair of each half-edge

- the ends of each half-edge

 

Is this something that might happen any time soon ?

I'd been working on something along these lines recently, but if the McNeel team already have something lined up that would be awesome :)

 

and btw - the Kangaroo RemoveDuplicateLines component will filter those extra lines in that definition  out.

 

Your Kangaroo RemoveDuplicateLines component and its sibling RemoveDuplicatePoints both definitely work overtime for me.

Hi Dani

 

steve has been working on the meshtopology routines. 

hope he will improve further on and also implement ngons in the future

ConnectedFaces

- ConnectedTopologyVertices

- TopologyVertexIndex

- M.Faces.GetFaceVertices

 

 

 

We're not typing on a half-edge mesh type. OpenNurbs doesn't define meshes in this way so we'd have to write it from scratch. 

 

However, things like:

  • Which faces use this vertex?
  • Which edges use this vertex?
  • Which faces border this edge?
  • Which edges border this face?
  • Which faces are adjacent to this face?

 

Are supposedly solved by the opennurbs MeshTopology class. And, according to flipcode; "[a half-edge representation] however ... is only capable of representing manifold surfaces, which in some cases can prove prohibitive."  This is indeed a problem as the Rhino mesh format supports non-manifold meshes. I realize that they are rarely used, but it is nevertheless important to think long and hard about adding a feature that could only work on a subset of cases.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

BTW, Techdraw is now a standard viewport display option in Rhino 5.

It called Technical and it's super cool...

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service