I’m trying to use a picked object to move and rotate the CPlane in Rhino, and then create a new geometry (e.g. a surface) based on the new construction plane coordinates. I successfully move the CPlane to the desired location, but when I try to add a new object (inside the plugin) to the Rhino document, it takes the World coordinate system. However, if I try to interactively add, let’s say, a point to my document, it uses the construction plane coordinate system!
So, I’m doing something like this:
I ask the user to pick a circle object.
then I get the origin and the plane of this circle from OpenNURBS.
I get the current construction plane:
CRhinoView* view = ::RhinoApp().ActiveView();
ON_3dmConstructionPlane cplane = view->Viewport().ConstructionPlane();
I modify the m_plane of the construction plane
I set the new construction plane and redraw:
at this point, I can see in the debug-mode that the construction plane has moved successfully.
Then I send the radius of the circle to a function where I define a NURBS surface based on that.
ON_NurbsSurface Base_Surface = CreateTheBaseSurface(Radius);
(I take the origin for this surface to be (0,0,0))
Finally, I add the surface object to the document and redraw:
But, the surface pops in the World’s coordinate system.
I have tried many things, but couldn’t figure out what the problem is. Am I missing something here?
I know that I can transform my object to the place that I want, but it would be easier if the construction plane thing were working.
Any help regarding this is greatly appreciated.
P.S.: I’m writing the plug-in in C++ and Rhino 6.
view->Viewport().PushConstructionPlane(cplane) also doesn’t work