Grasshopper

algorithmic modeling for Rhino

I am trying to implement the ShrinkSurface command from within the VB component but am getting an error. 

The component is set up like this:

I get the same error when the component type is set to "surface". I have no idea how to make this seemingly simple problem go away. I suspect the trimmed surfaces are creating issues for me with the unroll command later down the line, I would like each panel to be a discrete surface so I am able to reference the center of each panel to nest and number them. 

Any insight?

-dallas

Views: 941

Replies to This Discussion

where you've seen this method? The brepFacelist class has ShrinkFaces() method, perhaps this?

Dim x As New brep
x.Faces.ShrinkFaces()

You can look at the sdk to find all methods of rhino classes.

http://www.rhino3d.com/download/rhino-sdk/5.0/release

I got the bits I tried from this thread:  http://www.grasshopper3d.com/forum/topics/shrink-trimed-surface-to-...

I'm not knowledgeable with code , how does the bit you reference there go into the script?

This is what I tried:

This thread is of 2009. Ok, you have:

Private Sub RunScript(ByVal x as Brep, ByRef A as object)

End sub

You are saying, set me an input with item access, of type brep and named "x". The data plugged in that input, inside your code will be accesed with "x". Then, "x" is your brep (a reference of it). If you write "x." (x and dot) and you will see the methods and properties of the brep class. So:

A = x.Faces.Shr...

ok! I've got the error sorted, but now I am getting a boolean value out from A.

How do I get the shrunk surfaces?

thank you so much for your time!

additionally, when I add a second output per the above referenced thread, I still get trimmed surfaces out.

Sorry, my fault. Is:

x.Faces.ShrinkFaces()

A = x

the ShrinkFaces return booleans, true when the method was successful. The x (the brep) is different in the next line of code.

ok, so the parenthesis designates a non-boolean output?

I'm still getting trimmed surfaces as a result:

the trim lines should be isolines from the original surface so the trims should be parallel, I don't understand why it's still returning trimmed surfaces.

oh wait... there are holes in the surfaces...

<facepalm>

Lol

I'm sorry but I'm talking about writing the code. I've never used that method so I dont know what it does, and I do not know what you're trying to do.

Search on the SDK, or better, ask in the mcneel forum to help.

The () only means that this method not contains/needs arguments. Arguments are the "parameters" like: Private Sub RunScript(ByVal x as brep, ByRef A as object). 

The process is:

-Gh reads VB Script.

- the reading reaches the method RunScript, which is set with an argument x as input (and as brep) and A as output (and as object).

- Read next line:  x.Faces.ShrinkFaces(). This produce a boolean as result, but in this case we not collect the result. However make some change in "x".

- Read next line: A = x. The modified brep is returned in A.

- ...

If the 'holes' are the only trimmings, then ShrinkFaces method is of no use here.
Also note that the method is supposed to result in trimmed surfaces. (maybe you mistakenly expected untrimmed surfaces??).

they are not the only trims.

there are rings that need to be subdivided every 8' to allow for fitting on a sheet of steel.  each piece has some holes in it. The original pieces are the full ring, I then subdivide based on a length domain to create cut-able pieces.

I see. I created a simple definition to mimic your situation. I hope it clears things up for you. I guess you're going to unroll the pieces and wanted to shrink the surfaces for that purpose, right?

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service