Transform SubD Smooth/Surface Points

Hi,

Is there a way to transform the smooth points of a subd, using grasshopper? I see it’s simple enough to get the underlying mesh vertices, but don’t see a way to be able to move the surface points (rather than control net points).

Try this:

Ah, perfect, so we need to use rhinocommon. Thanks Ricardo.

Hi Riccardo,

I didn’t manage to recreate it unfortunately. Have I got something the wrong way around?

I have a subd where the control net vertices are coincident with points on a curve, but I wish for the smoothed edge to have their points meeting the curve instead.

import rhinoscriptsyntax as rs
import Rhino
import System

pts = [ ]
pt = x.Vertices.First
srfpt = pt.SurfacePoint()
pts.append(srfpt)

count = x.Vertices.Count
print pts
print count

for i in range(0, count-1):
    pt = pt.Next
    pts.append(pt.SurfacePoint())

array = System.Array[Rhino.Geometry.Point3d](pts)
newsubd = x.InterpolateSurfacePoints( array )

Aha, I got it.I had to set the object to a new variable to generate.

newsubd = x.InterpolateSurfacePoints( array )
s = x
2 Likes

@piac , I wondered if you could maybe help me with explaining the use of this particular array datatype in python. Why does the InterpolateSurfacePoints, and some similar methods, not just return a python list? Requiring to then hunt on discourse for how to get this other data type, which I think I’d be right in saying isn’t very ‘pythonic’ ?

Thankfully the below topic helped me out, but I was just curious if there’s a reason for these specific cases not just returning a list.

Riccardo, I’m having an issue with InterpolateSurfacePointsMethod.

How does the method work, in respect to how it respects the ORDER that points are fed to it in the beginning and end?

is the order of the vertices data (controlnetpoint) the order that needs to be retained?

I am trying to do a more advanced operation, to move only a selected edge of points and keep the rest the same. But, at points I am wanting to use a dictionary but then concerned that I’m losing the order. Since I am using the Id property regularly to get at and change items.

The method SubD.InterpolateSurfacePoints() needs a list of points that are the same amount of the surface points of the SubD you are editing, and the order must be correct, indeed.

Editing only a sub-set of points from the whole list is trivial, use dispatch and then weave.
(you can trick it and make a polyline out of the whole list and then use point deform…)
Maybe attach something here so we can talk about the same situation…