Jun
09

Polyline Network Surface

poly network surface

This is a handy script for those that use NetworkSrf extensively. NetworkSrf is probably one of the coolest things that Rhino offers for nurbs modelling. Just make some polylines in a way that has U/V organization and hit the script.

Option Explicit
‘Script written by Howard Jiho Kim
‘Script version Monday, March 10, 2008 12:46:21 PM

Call Main()
Sub Main()

Dim strObject, strObject2, arrObjects
Dim netCrv(100)
Dim i
Dim arrNew
i=0

arrObjects = Rhino.GetObjects(“Pick some curves”, 4)

If IsArray(arrObjects) Then

For Each strObject In arrObjects

If Rhino.IsPolyline(strObject) Then
netCrv(i) = SubDividePolyline(strObject)
Print netCrv(i)
Rhino.SelectObject netCrv(i)
i=i+1
End If

Next

End If

Rhino.Command(“NetworkSrf”)

End Sub

Function SubDividePolyline(strObject)
Dim arrV
arrV = Rhino.PolylineVertices(strObject)
Dim arrSubD() : ReDim arrSubD(2 * UBound(arrV))
Dim i

For i=0 To UBound(arrV)-1

arrSubD(i*2) = arrV(i)
arrSubD(i*2+1) = Array( (arrV(i)(0) + arrV(i+1)(0))/ 2.0, _
(arrV(i)(1) + arrV(i+1)(1))/ 2.0, _
(arrV(i)(2) + arrV(i+1)(2))/ 2.0)
Next

arrSubD(UBound(arrSubD)) = arrV(UBound(arrV))
SubDividePolyline = Rhino.AddCurve(arrSubD)

End Function

Add your comment

11 responses for this post

  1. davide del giudice Says:

    Hi, i’ m italian architect…i love studio MAD, your design is the best…it’s like Zaha but more interesting, more cool…i follow your blog since you’ ve created it, compliments for all. If you want to visit my blog ;)
    http://madeincalifornia.blogspot.com/

    Maybe your studio are looking for young architect for job?
    bye bye keep in touch
    _davide////madeincalifornia

  2. Yihang Says:

    Hi Howard, hows it going. I tried that script but it gave me an error code. are there anyother plugin i need to have? like Subd?

  3. crtl-i Says:

    Yihang.

    This is a rhinoscript, sub-division from Maya is not related to this at all. You only need Rhino. You may need to re-type the single and double quotes (’ and “) if you’re copying the script directly from the website, the character encoding may not be correct. When you get an error, check and see which line it’s coming from. Also, make sure that the polylines that you’re making have a clear UV organization.

  4. Yihang Says:

    Thanks mate. will give that a shot. goodluck with your house hunting, it looks like an awsome area to live in.

  5. davide del giudice Says:

    Hi Howard Kim,

    Thank you for visiting my blog, your is one of the most interesting that there are. Thanks also for information on work by MAD. Yansog MA will be in Turin, my city to make a lecture, I will surely see him and know him in person.
    I will try to send my portfolio in your studio, you never know in life. Thanks again for everything and to share your research network.

    kepp in touch

    _davide

  6. Yihang Says:

    Thanks Howard. That worked like a charm. Say hi to flora and shiyang for me if you see them.

    Yihang

  7. Alex Says:

    Your blog is interesting!

    Keep up the good work!

  8. Mark Says:

    Appreciate you information. My buddy advice to visit you. It’s very interesting. Subscribed! Will advice to my friends!

  9. Alex Says:

    Hey Howard,
    what is u.v organization? and also after you have run the script , which curves do you select?

  10. crtl-i Says:

    Alex.

    UV is like a coordinate system for a surface >> http://en.wikipedia.org/wiki/UV_mapping
    If your curves are organized correctly with clear UV organization, the script will automatically select the curves and create the surface.

  11. Tekwelpisee Says:

    Hi!
    My name is Jessika!

Leave a Reply