Is there something equivalent to "Rhino.AddSrfPtGrid" that can be used in a C++ plugin?

Views: 71

Replies to This Discussion

Use RhinoSrfPtGrid. See rhinoSdkUtilities.h for details.

 -- Dale

Thanks Dale, I'll try that.

Steve

Is there any C++ sample code I could take a look at? I'm having some trouble declaring and giving values to the ON_3dPointArray variable that RhinoSrfPtGrid needs:

int point_count[2] = {4, 4};
int degree[2] = {3, 3};
BOOL is_closed[2] = {false, false};

ON_NurbsSurface* nurbs_surface = NULL;
const ON_3dPointArray& point_array( point_count[0] * point_count[1] );

// how to fill point_array with data?
ON_3dPoint point(0.0, 0.0, 0.0);
point_array[0]=point; ...   (get error C2768)

RhinoSrfPtGrid(
      point_count,
      degree,
      is_closed,
      point_array,
      nurbs_surface
      );

if (nurbs_surface != NULL)
        {
        context.m_doc.AddSurfaceObject(*nurbs_surface);
        context.m_doc.Redraw();
        }

Hi Steve,

Let me know if this sample is helpful.

https://github.com/mcneel/Rhino5Samples_CPP/blob/master/SampleComma...

 -- Dale

Thanks Dale, that sample helps a lot. I wasn't clear about how to declare "nurbs_surface" or "point_array". The sample at

http://wiki.mcneel.com/developer/sdksamples/createsurfaceexample

was also helpful.

RSS

Translate

© 2014   Created by McNeel Admin.

Badges  |  Report an Issue  |  Terms of Service