Hi every one, I am a new developer of Rhino-Plugin programing, and now I have a question,
I need to move my control points of Brep, so I use the GetGrips function to move them…
but the result is very strange, it just only move control points of base surface. How to completely move all control points including curves3D
Function Move_brep_control_point(ByRef robj As Rhino.DocObjects.ObjRef, ByVal dx As Double, ByVal dy As Double, ByVal dz As Double)
Dim i, j, k, cur_num, pt_num As Integer
Dim testTransform As Rhino.Geometry.Transform
Dim ro() As Rhino.DocObjects.GripObject
'
Dim kk As Rhino.Geometry.Brep
kk = robj.Brep
'
robj.Object().GripsOn = True
ro = robj.Object.GetGrips
'base surface-control point
For j = 0 To ro.Length - 1
testTransform = Rhino.Geometry.Transform.Translation(dx, dy, dz)
ro(j).Move(testTransform)
Next j
'3d curve
cur_num = robj.Brep.Curves3D.Count
For j = 0 To cur_num - 1
pt_num = robj.Brep.Curves3D.Item(j).GetLength()
For k = 0 To pt_num - 1
'robj.Brep.Curves3D.Item(j).PointAtLength()
Next k
Next j
End Function
First, what are you trying to do (specifically) and why?
Are you trying to manipulate the control points of a surface, or a Brep with a single face? Or are you trying to manipulate the vertices of a Brep? There is a big difference…
Thanks for your reply. In the past, I ever use the algorithm of "Three-Dimensional Distance Field Metamorphosis " to grade the base size of shoe sole to other size in locking some geometry characteristic (like airbag…), and my mainly method is to manipulate the control points of surface to the appropriate positions.
Now I try to use the above algorithm to the rhino, but I confused about the relation of Brep and surface, it seems correct only move the control points of “robj.Object.GetGrips” for neglecting 3D trim curves. In fact, my main purpose is to guarantee smooth surface after deform the surface. Whether you can suggest using vertices of Brep or control points of surface?
The other question…how to develop the vb code to manipulate the deform function of Rhino? (use the editing control box and the deform surface (Like FFD algorithm))…do you have the sample?
Modifying the vertices of Brep isn’t going to help you. If you want to modify the shape of a surface, then editing the locations of a surface’s control points is one such way.
I see you’ve found the article in setting up a cage edit. Have you used Rhino’s CageEdit feature? Is this what you want to do?
I should add that cage editing is something you cannot do yet in RhinoCommon. But its on the to-do list for Rhino 6.