Grasshopper

algorithmic modeling for Rhino

Hello,

I am new to python.

My task is to split a surfaces with curves. To check surface inside a defined space and extract only those surface.

I try couple of ways to split. But finally using  Giulio Piacentino (http://www.grasshopper3d.com/forum/topics/splitting-surfaces-in-gra...)

1. How to extract which surface centroid inside. ( i started to use IsPointInSurface )

2. How to extract only surface inside given space.

can someone help me on this please.

regards

Views: 497

Attachments:

Replies to This Discussion

Parameter must be a Guid or string representing a Guid

How do I get centroid of a split surface. 
I even try SurfaceAreaCentroid or SurfaceVolumeCentroid. I get same error

can someone help me...

Hi,

i think splits is your collection (list or array) and you pick one surface called newSurface from your collection. Could be that you should write SurfaceAreaCentroid(newSurface)?

I try SurfaceAreaCentroid(newSurface) . After splitting a surface python is reading as Brep instead of Planar surface. I am not able to use Surface area command in this.

I get error as,

<Rhino.Geometry.Brep object at 0x0000000000000099 [Rhino.Geometry.Brep]>
Runtime error (TypeErrorException): Parameter must be a Guid or string representing a Guid
Traceback:
line 495, in coerceguid, "C:\Users\16741\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\utility.py"
line 601, in coercerhinoobject, "C:\Users\16741\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\utility.py"
line 178, in Area, "C:\Users\16741\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\geometry.py"
line 35, in script

in attached script I used RhinoCommon script ( I got from Internet user) to get centroid / center point.

But still I need area to calculate at each time. how to calculate area in split geometry?

How can I change Brep object to Surface? 

Attachments:

Hi,

for the areas of brep faces i can show you how it works in C#

Attachments:

a better version with centroids. check "faceBrep" it has a IspointInside property.

sorry all in c#...

Attachments:

Hello Raul,

I used ghpythonlib.components and loaded to script. This simplified my process

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service