Rhinocommon Equivalent of Crease Command?

In Rhino, I have reason to select a mesh edge and then use the command “Crease”. What would be the equivalent for this in Rhinocommon?

Thank you,
Sam

Hi Sam, you might look into using UnweldEdge

_
c.

As Crease is mainly thought for SubD.
the following link might be helpful for people that search for a SubD solution:

Hi Clement,

Thanks for this. I’m trying to use it to crease all edges of a mesh that are within 1mm from a curve. So far my code isn’t working and it is also crazy cumbersome compared to typing ‘Crease’ in the command prompt. Could you provide some assistance perhaps? Code below…

Thank you,
Sam

'get the mesh and the curve
Dim objectRef As Rhino.DocObjects.ObjRef = Nothing
Dim rc = Rhino.Input.RhinoGet.GetOneObject("Select mesh", False, Rhino.DocObjects.ObjectType.Mesh, objectRef)
Dim MeshID = objectRef.ObjectId
Dim MyMesh = TryCast(doc.Objects.Find(MeshID).Geometry, Mesh)
rc = Rhino.Input.RhinoGet.GetOneObject("Select curve", False, Rhino.DocObjects.ObjectType.Curve, objectRef)
Dim CurveID = objectRef.ObjectId
Dim MyCurve = TryCast(doc.Objects.Find(CurveID).Geometry, Curve)

'get lists of start and end indices for the edge vertices
Dim edges = MyMesh.TopologyEdges
Dim i As New List(Of Integer)()
Dim j As New List(Of Integer)()
For c As Integer = 0 To edges.Count - 1
	Dim pa As IndexPair = edges.GetTopologyVertices(c)
	i.AddRange(MyMesh.TopologyVertices.MeshVertexIndices(pa.I))
	j.AddRange(MyMesh.TopologyVertices.MeshVertexIndices(pa.J))
Next

'compile a list of edge indices that need to be creased (unwelded) by checking if within 1mm from the curve
Dim EdgeIndices As New List(Of Integer)
For k = 0 To i.Count - 1
	If SC.GetDistanceToCurveFromPoint(MyCurve, MyMesh.Vertices(i(k))) < 1 And SC.GetDistanceToCurveFromPoint(MyCurve, MyMesh.Vertices(j(k))) < 1 Then
		EdgeIndices.Add(MyMesh.TopologyEdges.GetEdgeIndex(i(k), j(k)))
	End If
Next

'crease (unweld)
MyMesh.UnweldEdge(EdgeIndices, False)

Hi Sam, below is a small example written in python, it should be easy to convert:

UnweldMeshEdgesWithCurve.py (869 Bytes)
UnweldMeshEdgesWithCurve.3dm (266.6 KB)

_
c.

Very nice, clement! Worked great.

One other quick related question. Do you know if there is a way in rhinocommon to set SurfaceFaceMode=Smart or some equivalent when using the QuadRemesh function?

Thank you,
Sam

https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.quadremeshparameters/preservemesharrayedgesmode#

Thank you both @dale and @clement, all works great.

I’ve marked this as resolved, though I’m still having a bit of a hard time getting clean quad meshes, but I’ll continue that discussion on this other thread I started: QuadRemesh subd crease detection not working - #24 by samlochner

Thanks again,
Sam