Grasshopper

algorithmic modeling for Rhino

hi, 

I make a vb script that change Triangle surfaces to brep.

this is input Triangle surfaces

but, Output Surfaces(brep) is rectangle surfaces.

why ToBrep method make triangle surfaces to rectangle?

I want to make Triangle Surfaces to Triangle Brep... 

on the contrary to this, how to make Brep to surfaces?

 

 

here is my method

Private Sub RunScript(ByVal Trisurfaces As List(Of Surface), ByRef A As Object)

Dim BrepTris As New List(Of brep)

For Each Trisurface As surface In Trisurfaces
Dim brepfromsrf As Brep
brepfromsrf = rhino.geometry.Brep.CreateFromSurface(Trisurface)
BrepTris.Add(brepfromsrf)
Next

a = BrepTris

thanks

Views: 11943

Replies to This Discussion

Hi Kim,

Are the surfaces trimmed surfaces? Seems "create Brep from surface" untrim the surfaces. If this is the case, then you should first build trimmed surfaces and then use create Brep from surfaces to convert them to Breps.

Regards,

Mostapha

input surfaces are trimmed surfaces and output surfaces(brep) are untrimmed surfaces...

Rhino.Geometry.Surface cannot be trimmed. You need a BrepFace class in order to associate trimming information with a surface. What I think is happening is that Kim is confused by the different usage of "surface" in the Rhino SDK and Grasshopper. 

In Grasshopper, there is no data-type specifically for Rhino.Geometry.Surface. What is called a "surface" in Grasshopper, is always a Brep with only a single face. I made this choice because I wanted to have surfaces with trimming data.

So what happens here (I think anyway) is that Kim has a list of Grasshopper surfaces which are in fact trimmed breps with a single face each. When he feeds them into the Script component he uses the Surface typehint, which effectively strips all trimming information from the triangles, resulting in the rectangles. Then the Brep.CreateFromSurface method is no longer able to recover the trimming information, it's too late.

Kim: Use a Brep typehint instead, see if that helps. 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thank you David for clarification.

Kim! Vincet's code is what I meant by "you should first build trimmed surfaces".

always thanks for your reply. 

You can also construct a triangular surface out of an untrimmed surface by having one of the surface parameters collapse into a singularity.

The code to achieve this would be something like:


Private Sub RunScript(ByVal x As Brep, ByRef A As Object)
Dim p() As point3d = x.DuplicateVertices
Dim srf As brep = brep.CreateFromCornerPoints(p(0), p(1), p(2), p(2), doc.ModelAbsoluteTolerance)
a = srf.Faces(0).tonurbssurface
End Sub

thanks for reply~ 

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service