Display surface control polygon/points in a conduit? (C++)

Hello,

Is it possible to somehow access the control polygon and control points of a surface to display them in a conduit?

I know there’s the command ExtractControlPolygon of a surface: how can I access it through the C++ SDK (as ON_Mesh I guess)?

Thanks,
Pablo

Hi @pagarcia,

To get the control polygon of a surface, use ON_ControlPolygonMesh. See opennurbs_mesh.h for details.

– Dale

Many thanks Dale!

Pablo

Hi @dale,

i’m trying to draw the lines of a nurbs surface controlpolygon in a conduit as dotten lines. To do this i create a mesh and then get all edges, which is kinda slow since the user can change the control point locations dynamically.

Is there an equivalent of ON_ControlPolygonMesh in RhinoCommon ?

thanks,
c.

Hi @clement,

ON_ControlPolygonMesh isn’t used much, which is why we didn’t expose it.

See of this conduit sample is helpful (or not).

test_control_polygon.py (2.5 KB)

– Dale

1 Like

Thank you @dale for the helpful example code.

I would indeed be useful to have direct access to ON_ControlPolygonMesh as function to avoid the nested loops in the conduit. Or even better something predefinded for display with surfaces and curves eg.:

Rhino.Display.DisplayConduit.DrawControlPolygon(nurbs_surface, 0x00001111, color)

_
c.

https://mcneel.myjetbrains.com/youtrack/issue/RH-67893

– Dale

2 Likes

I have used this approach to create mesh from control points and display its wires in conduit:

but anyway I would also benefit from having direct access to it in RhinoCommon.

Łukasz