generative modeling for Rhino
How do I use Preview or Material to show a mesh with flat shading? I saw one other question, but the answer wasn't helpful, or I couldn't figure it out.
thanks
Tags:
Permalink Reply by Eric Mims on November 10, 2011 at 4:03pm Is it just a slow day on the forum or is this not possible?

I don't think that's possible.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Permalink Reply by Eric Mims on November 11, 2011 at 9:22am I just figured it out. I Decomposed the mesh, then created a new mesh using the vertices and faces, but graphed the faces input. It displays as a flat shaded object in Rhino.

Oh dear, that means you get an individual mesh for every face in the original mesh. Unwelding would be a better approach, though there is no unweld function available in the Rhino4 SDK.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Permalink Reply by Eric Mims on November 11, 2011 at 10:41am Well, fortunately this is for a very course mesh.. a heavily faceted surface that I wanted to be able to visualize as faceted without having to bake each time.
Permalink Reply by Vicente Soler on November 11, 2011 at 12:00pm You can try using the following code to sort of "unweld" a mesh. Just paste the code inside a vb.net component and connect the mesh to the x input.
Dim m As New mesh
Dim c As Integer = 0
For i As Integer = 0 To x.faces.count - 1
Dim pts(2) As point3f
Dim ptd As New point3f
x.Faces.GetFaceVertices(i, pts(0), pts(1), pts(2), ptd)
m.Vertices.AddVertices(pts)
If x.Faces(i).IsTriangle Then
m.Faces.AddFace(c, c + 1, c + 2)
c += 3
Else
m.Vertices.Add(ptd)
m.Faces.AddFace(c, c + 1, c + 2, c + 3)
c += 4
End If
Next
m.Normals.ComputeNormals
a = m
© 2013 Created by Scott Davidson.
Powered by