Grasshopper

algorithmic modeling for Rhino

Maybe I'm missing it in the SDK but is there a way to create a planar surface from a closed polyline Curve in Rhino Common? I know I can create a surface from 3 or 4 curves but I need to be able to create a surface from any where between 3 sides and 100 sides depending on the outline and the outline will always be drawn by a polyline.

Any guidance would be appreciated,

Thanks,

Zach

Views: 20309

Replies to This Discussion

Have a look at Rhino.Geometry.Brep.CreatePlanarBreps(). It does what you want I think.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Awesome, thanks David, that is what I needed.

Thanks for the fast reply,

Zach

Ok now the problem that I am running into is that since it is a brep now, I can't divide it because it is a brep and not a surface. When I try to select a face of the brep so I can divide it, it just returns a plane at one corner of the face. Can someone explain the proper way of getting a face of a brep? Below is an example of the syntax that I have used that isn't working in python.

import Rhino
x=[100,100,1,1]
y=[1,100,100,1]
z=[0,0,0,0]
ptlist=[]
for r in range(len(x)):
ptlist.insert(r,Rhino.Geometry.Point3d(x[r],y[r],z[r]))
if r==len(x)-1:
ptlist.insert(r+1,Rhino.Geometry.Point3d(x[0],y[0],z[0]))
Crv=Rhino.Geometry.PolylineCurve(ptlist)
Srf=(Rhino.Geometry.Brep.CreatePlanarBreps(Crv)[0]).Faces[0]

Thank you,

Zach

Hi Zach,

python isn't my forte, but if you use CreatePlanarBreps() the odds are you will end up with a trimmed surface, even if the boundary curves could have resulted in an untrimmed surface. Only in case of perfectly aligned rectangles will you get an untrimmed result.

So the question now is, what sort of division are you looking for? If your input is well defined (say, a parallelogram), where do you expect the division points to be?

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Hi David,

Essentially I am calling property line corner points from a database and need this to work with all 100,000 records. Most of the time, If I look at the grasshopper output I end up with a trimmed surface, But When I try to work with it in python, it says it is a brep array. If I use the brep.Faces property, It appears to select the face that I want to work with but in reality only returns a plane. When I try to divide this into points it only seems to use the plane as a new origin not as a surface. To answer your question above, All I want is to divide the surface into points like the surface divide component performs in grasshopper. The division points should lie inside the surface based on the surface size but could be outside the trimmed surface. The overlying problem though is that each property is a different shape. Some are perfect rectangles, others have 9 sides. Some have 4 corner points others have 400. The points will only be used to call elevations from google, construct a mesh from those points, then trim that mesh with the property outline. I've attached an example of what I am getting from python.

Thanks for the help,

Zach

Attachments:

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