# Add circle on mesh

**URL:** <https://discourse.mcneel.com/t/add-circle-on-mesh/8732>\
**Category:** Rhino Developer\
**Created:** [May 28, 2014, 2:23pm UTC](https://discourse.mcneel.com/t/add-circle-on-mesh/8732 "2014-05-28T14:23:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mostafa](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/mostafa/32/410700_2.png) [@mostafa](https://discourse.mcneel.com/u/mostafa)\
**Post date:** [May 28, 2014, 2:23pm UTC](https://discourse.mcneel.com/t/add-circle-on-mesh/8732/1 "2014-05-28T14:23:32Z")

</div>

**I want to add circle on a mesh in c# that is tangent to the mesh like these pictures:**  
note that I want to add this circle when I move the cursor and also pay attention to line width of the circles in the images.

[![](http://i61.tinypic.com/qqf.jpg)](http://tinypic.com?ref=qqf)  
[![](http://i62.tinypic.com/n6chmf.jpg)](http://tinypic.com?ref=n6chmf)  
[![](http://i61.tinypic.com/seamwx.jpg)](http://tinypic.com?ref=seamwx)

---

<div class="post-metadata">

**Author:** ![djordje](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/djordje/32/747634_2.png) [@djordje](https://discourse.mcneel.com/u/djordje)\
**Post date:** [May 28, 2014, 3:51pm UTC](https://discourse.mcneel.com/t/add-circle-on-mesh/8732/2 "2014-05-28T15:51:52Z")

</div>

Hi,

I do not know how this could be done in C# syntax, but these are the methods you will need:  
Dale already [showed](https://github.com/dalefugier/SampleCsCommands/blob/master/SampleCsPointOnMesh.cs) you how to get a point constrained to a mesh. Now use that point as a sample for mesh.[ClosestMeshPoint](http://4.rhino3d.com/5/rhinocommon/html/M_Rhino_Geometry_Mesh_ClosestMeshPoint.htm)() method. This one will give you faceindex and barycentric coordinates, which you will then feed into the mesh.[NormalAt](http://4.rhino3d.com/5/rhinocommon/html/M_Rhino_Geometry_Mesh_NormalAt.htm)() method. Once you find the normal at desired point, just construct a [plane](http://4.rhino3d.com/5/rhinocommon/html/Overload_Rhino_Geometry_Plane__ctor.htm), and draw a [circle](http://4.rhino3d.com/5/rhinocommon/html/M_Rhino_Geometry_Circle__ctor_2.htm) in that plane.

What was the issue with line width?

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/685184_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [May 28, 2014, 9:02pm UTC](https://discourse.mcneel.com/t/add-circle-on-mesh/8732/3 "2014-05-28T21:02:19Z")

</div>

Mesh faces “should” have face normals. If not, they can be calculated using `Mesh.FaceNormals.ComputeFaceNormals()`.
