Click or drag to resize

MeshingParametersMinimal Property

Gets minimal meshing parameters.

Namespace:  Rhino.Geometry
Assembly:  RhinoCommon (in RhinoCommon.dll)
Since: 5.0
Syntax
public static MeshingParameters Minimal { get; }

Property Value

Type: MeshingParameters
Examples
using Rhino;
using Rhino.Commands;
using Rhino.Input;
using Rhino.Geometry;
using Rhino.DocObjects;

namespace examples_cs
{
  public class CreateMeshFromBrepCommand : Command
  {
    public override string EnglishName { get { return "csCreateMeshFromBrep"; } }

    protected override Result RunCommand(RhinoDoc doc, RunMode mode)
    {
      ObjRef obj_ref;
      var rc = RhinoGet.GetOneObject("Select surface or polysurface to mesh", true, ObjectType.Surface | ObjectType.PolysrfFilter, out obj_ref);
      if (rc != Result.Success)
        return rc;
      var brep = obj_ref.Brep();
      if (null == brep)
        return Result.Failure;

      // you could choose anyone of these for example
      var jagged_and_faster = MeshingParameters.Coarse;
      var smooth_and_slower = MeshingParameters.Smooth;
      var default_mesh_params = MeshingParameters.Default;
      var minimal = MeshingParameters.Minimal;

      var meshes = Mesh.CreateFromBrep(brep, smooth_and_slower);
      if (meshes == null || meshes.Length == 0)
        return Result.Failure;

      var brep_mesh = new Mesh();
      foreach (var mesh in meshes)
        brep_mesh.Append(mesh);
      doc.Objects.AddMesh(brep_mesh);
      doc.Views.Redraw();

      return Result.Success;
    }
  }
}
Python
import Rhino
from Rhino.Geometry import *
from Rhino.Input import RhinoGet
from Rhino.Commands import Result
from Rhino.DocObjects import ObjectType
import rhinoscriptsyntax as rs
from scriptcontext import doc

def RunCommand():
  rc, objRef = RhinoGet.GetOneObject("Select surface or polysurface to mesh", True, 
                                     ObjectType.Surface | ObjectType.PolysrfFilter)
  if rc <> Result.Success:
    return rc
  brep = objRef.Brep()
  if None == brep:
    return Result.Failure

  jaggedAndFaster = MeshingParameters.Coarse
  smoothAndSlower = MeshingParameters.Smooth
  defaultMeshParams = MeshingParameters.Default
  minimal = MeshingParameters.Minimal

  meshes = Mesh.CreateFromBrep(brep, smoothAndSlower)
  if meshes == None or meshes.Length == 0:
    return Result.Failure

  brepMesh = Mesh()
  for mesh in meshes:
    brepMesh.Append(mesh)
  doc.Objects.AddMesh(brepMesh)
  doc.Views.Redraw()

if __name__ == "__main__":
  RunCommand()
See Also