private Term[] GetConcreteAnnotationTerm(OnSphere onSphere) { var center = onSphere.SphereOwned.Center; var radius = onSphere.SphereOwned.Radius; var touchingPoint = onSphere.CenterTouchesSphere.Center; var touchingNormal = onSphere.CenterTouchesSphere.Normal; var radiusConstraint = (center - touchingPoint).NormSquared - TermBuilder.Power(radius, 2); var normalConstraint = VectorParallelism(center - touchingPoint, touchingNormal); return(normalConstraint.Append(radiusConstraint).ToArray()); }
///<summary> This gets called when when the user runs this command.</summary> public override IRhinoCommand.result RunCommand(IRhinoCommandContext context) { On3dPoint center = new On3dPoint(OnUtil.On_origin); OnSphere sphere = new OnSphere(center, 5.0); OnMesh mesh = RhUtil.RhinoMeshSphere(sphere, 10, 10); MRhinoMeshObject mesh_obj = context.m_doc.AddMeshObject(mesh); context.m_doc.Redraw(); MRhinoGetString gs = new MRhinoGetString(); gs.SetCommandPrompt("Press <Enter> to continue"); gs.AcceptNothing(); gs.GetString(); context.m_doc.DeleteObject(new MRhinoObjRef(mesh_obj)); context.m_doc.Redraw(); return IRhinoCommand.result.success; }
///<summary> This gets called when when the user runs this command.</summary> public override IRhinoCommand.result RunCommand(IRhinoCommandContext context) { On3dPoint center = new On3dPoint(OnUtil.On_origin); OnSphere sphere = new OnSphere(center, 5.0); OnMesh mesh = RhUtil.RhinoMeshSphere(sphere, 10, 10); MRhinoMeshObject mesh_obj = context.m_doc.AddMeshObject(mesh); context.m_doc.Redraw(); MRhinoGetString gs = new MRhinoGetString(); gs.SetCommandPrompt("Press <Enter> to continue"); gs.AcceptNothing(); gs.GetString(); context.m_doc.DeleteObject(new MRhinoObjRef(mesh_obj)); context.m_doc.Redraw(); return(IRhinoCommand.result.success); }