When the operation finishs, the shape looks weird. But if I manually move other parts of the subd, it gets fixed automatically. I guess I am missing some clean up steps in the code. Can someone point me to the right direction?
What version of Rhino are you running? In recent versions of Rhino 8 (I think starting from the first commercial release of 8.0), the SubDVertex.ControlNetPoint setter should take care of cleanup for you.
In older versions, you will need to call subdgeo.ClearEvaluationCache() before you add or replace the modified SubD into the document.
If that doesn’t work, or if you are using a recent Rhino 8 version, please share a full example including the 3dm file and the script you are using so I can take a deeper look.
Hi @pierrec, I’m having trouble finding the option to Transform or move a SubdFace in Grasshopper. It seems that SubdFace.Transform(xf) is disabled. Any suggestions?
private void RunScript(
SubD subd,
int indexf,
double m,
ref object a)
{
var vf = subd.Faces.Find(indexf);
var v=vf.ControlNetCenterNormal;
var xf=Transform.Translation(v*m);
vf.Transform(xf);?????????????disabled
subd.ClearEvaluationCache();
}
Can you please assist me?
now i use this method for vertex only =
private void RunScript(
SubD subd,
List<Point3d> pt,
List<int> index,
ref object a)
{
foreach (var i in index)
{foreach(var p in pt)
{var vt = subd.Vertices.Find(i);
vt.ControlNetPoint=p;
}
}
subd.ClearEvaluationCache();
a=subd;
}
}