I’m deforming surfaces using morph. I need the same number of points in each deformation, so I use preserveStructure param and it works fine when the morph points has been shortly moved. However, when I do more complex deformations, the structure surface changes. Is it normal?
I have simplified the problem all I can. Actually I’m morphing iteratively and randomly a simple nurbs sphere, until the surface suddenly turns into a polysurface changing it internal structure. Of course, the preserve structure flag is true.
Thanks for this. But what I really need is some code I can run and a model I can run the code against. Otherwise, I’m going to spend a lot of time trying to type up something that may or may not repeat the problem you are reporting.
I have created a simple project and video to show you my problem.
I create a simple nurbs sphere and, after some random deformations it usually changes it structure. Sometimes it becomes a polysurface, and sometimes it continues to be a surface but duplicates the control points of the joint. Anyway, we end with a hole in the sphere, and more control points than we started with. All of this, of course, with the Preserve structure flag as true.
This seems to be a problem related to closed surfaces.
For this specific example, NURBS surface created by defining a sphere and then getting its NURB form will have fully multiple knots. Full multiplicity knot in the middle of the knot list means there is a place on the NURBS surface that can be bent into a sharp kink. When you add surfaces to Rhino that have kinks, they are automatically split. This is why your spherical surface is turning into a polysurface.
To get around this particular problem, you can rebuild the NURBS surface. Rebuilding will remove the fully multiple knots.
I understand now that the morph function can receive the same control points more than one time, so I have to apply exactly the same deformation to each of them, if I want to mantain it structure.
In my algortihm (not the example I passed before), I move the morph points depending on its location, I mean, two control points with the same coordinates, have the same weight, and apply the same movement to them, so I should never have this problem, but sometimes the geometry turns into a polysurface.
With this value I can force surfaces with kinks to not split into polysurfaces, that is exactly what I want.
The problem is I have not found anyway in the api to modify this parameter. Is there any option available or I have to manually change this in the registry? If not, could this be added in the future?
Thanks, I’ve solved my problem with splitKinkySurfaces parameter. But I was working with “replace” after having morph objects, and I had to change all “replace” to “addBep” method (doing this, the Guid of my Brep changes). May be you would have to consider introduce splitKinkySurfaces parameter to “replace” method.