昵称:烦夫子
类别:界面/平面设计师
年龄:38
现所在地:北京
主页浏览总数:24255
总积分:89
文章数:88
作品数:70
// 联接两条曲线段,首尾相联
CRhinoCommand::result CCommandmyjoincur::RunCommand( const CRhinoCommandContext& context )
{
for(;;) {
CRhinoDoc *doc = RhinoApp().ActiveDoc();
CRhinoGetObject get;
get.SetCommandPrompt(prompt_msg_0006); //select join object
if (get.GetObjects(1,0) != CRhinoGetObject::object)
{
return CRhinoCommand::cancel;
}
CRhinoObjRef obj0 = get.Object(0);
const ON_Curve* crv = ON_Curve::Cast(obj0.Geometry());
ON_NurbsCurve crv1;
crv->GetNurbForm(crv1);
CRhinoObjRef obj1 = get.Object(1);
const ON_Curve* curve = ON_Curve::Cast(obj1.Geometry());
ON_NurbsCurve crv2;
curve->GetNurbForm(crv2);
crv1.Append(crv2);
CRhinoCurveObject* mycurve = new CRhinoCurveObject();
mycurve->SetCurve(crv1);
doc->ReplaceObject(obj0,mycurve,TRUE);
doc->Redraw();
break;
}
return CRhinoCommand::success;
}
//
// END myjoincur command