question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mesh.delete_face(fkey) raises KeyError when used on triangulated Rhinocommon meshes.

See original GitHub issue

Describe the bug Mesh.delete_face(fkey) raises KeyError when used on triangulated Rhinocommon meshes.

Mesh.is_quadmesh() returns True for some reason, and return from Mesh.insert_vertex(fkey) contains an extra face consisting of vertex keys [x, x, y] instead of expected [x, y, z].

To Reproduce Steps to reproduce the behavior:

  1. Grasshopper
  2. Sample script
from compas_rhino.geometry import RhinoMesh
from compas_ghpython.artists import MeshArtist

mesh = RhinoMesh.from_geometry(mesh).to_compas()

assert mesh.is_quadmesh()

key = mesh.get_any_face()
mesh.delete_face(key)

artist = MeshArtist(mesh)
rhino_mesh = artist.draw_mesh()

Canvas at 15;14;51 4. See error

Runtime error (KeyNotFoundException): KeyError

Traceback:
  line 737, in delete_face, "C:\Users\a\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\compas\datastructures\mesh\core\halfedge.py"
  line 10, in script

Desktop (please complete the following information):

  • OS: Windows 10
  • Rhino 6 SR4 2.7.8 (IronPython 2.7.8 (2.7.8.0) on .NET 4.0.30319.42000 (64-bit))
  • compas==0.15.5 installed using conda.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
brgcodecommented, Apr 24, 2020

the fix has been pushed and is building. please check if it fixes your problem…

0reactions
tetovcommented, Apr 25, 2020

Fixed in 857a29e0

Read more comments on GitHub >

github_iconTop Results From Across the Web

MeshFaceList Methods - Rhino Developer Documentation
Merges two triangular mesh faces that share an edge into one quadrangular face. Removes a face from the mesh. Removes a face from...
Read more >
Mesh Class - Rhino Developer Documentation
Represents a geometry type that is defined by vertices and faces. This is often called a face-vertex mesh.
Read more >
MeshFaceList.DeleteFaces Method (IEnumerable(Int32))
Removes a collection of faces from the mesh without affecting the remaining geometry.
Read more >
Mesh.CreatePatch Method - Rhino Developer Documentation
Construct a mesh patch from a variety of input geometry. Namespace: Rhino.Geometry Assembly: RhinoCommon (in RhinoCommon.dll). Since: 6.0. Syntax.
Read more >
Add Mesh - Rhino Developer Documentation
Rhinoceros 3D: Demonstrates how to construct a mesh from a list of vertices and faces.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found