RhinoCommand Forms Slider - PointCloud to Mesh C#

Hi,

I would like to ask about RhinoCommand plugins.
I am running Posson Surface Reconstruction after which I get watertight meshes.
Sometimes scanned objects are not watertight (walls, facades and etc), as a result I need to remove unnecessary mesh faces based on mesh vertex weights.

Rhino Version

Grasshopper Version

Question:
In Grasshopper I can do this using slider, by checking if weights are below certain threshold and then display the mesh.

How can I do similarly in RhinoCommand? I think I need to call an additional pop up window with a slider but I do not know how. Is there is a simply way to do this?

I am wondering how mesh smoothing command line gui is working in Rhino?
I am searching how to do that and update mesh accordingly:

s

Why not make it a command option? Each time the user changes a value, you can re-calculate the reconstruction and show them a preview.

That more simple, thanks I ll try to implement that.
Is it somehow possible to overwrite the last mesh?

For now I am baking geomtry like this:

        Rhino.RhinoApp.WriteLine(mesh3D.Vertices.Count.ToString());
        HistoryRecord h = new HistoryRecord(this, 1);

        Rhino.RhinoDoc.ActiveDoc.Objects.AddMesh(mesh3D,null,h,false,false);

How you can you change the last baked mesh?

What I typically do in that case is to make a display conduit to show the result and only put the mesh in the document when the user has finished the command.
But if you keep the Guid of the baked object, which is the return value of the AddMesh function, you can also replace the object using the Replace method https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_DocObjects_Tables_ObjectTable_Replace_28.htm

Thanks replacement worked. Using while loop I change mesh until user press enter and change mesh guid.

1 Like