MeshOutline failure

MeshNoOutline.3dm (2.7 MB)

The file above has a mesh object which looks good, closed and valid, but MeshOutline from the Top view fails. It succeeds if run from Front or Right views.

It also fails using RhinoCommon mesh.GetOutlines() which I assume calls the same function under the hood.

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino

mesh_id=rs.GetObject("Select mesh",32,preselect=True)
if mesh_id:
    mesh=rs.coercemesh(mesh_id)
    plane=rs.ViewCPlane()
    bb=mesh.GetBoundingBox(True)
    plane.Origin=bb.Min
    out_crvs=mesh.GetOutlines(plane)
    print(out_crvs)
    if out_crvs:
        for crv in out_crvs:
            outline_crv=Rhino.Geometry.PolylineCurve(crv)
            sc.doc.Objects.AddCurve(outline_crv)
        sc.doc.Views.Redraw()
    else:
        print("Outline failed!")

i had few minutes and had a brief look, though i can not say for certain but it looks like that these parts are causing it.

if you hide them meshoutline generates properly, maybe it is because their edges are not lining up with the entire edge of the other mesh though that should not be an issue otherwise

Thanks for looking. It still should work. Silhouette does, but it makes outlines of all the various mesh parts, which then have to be flattened and CurveBoolean’ed to get just the outline.

Intersecting the bottom of the object with a plane succeeds as well and gets the footprint, however if the object had overhangs that would not be the true outline.

yes i also tried silhouette and the base mesh, i thought you have tried that for sure and since its more about reporting the issue and not a quick fix i did not even mention it.

i actually tried to subsequently eliminate parts that work (in groups or not) to get to the parts that cause the problem. these meshes are usually utter crap, here in vienna at least one can barely use them, they are like a bunch rags thrown together to make a quick tent for the night rather than being reliably usable.

maybe these edges not lining up and leaving one edge in the middle causes some sort of selfintersecting edge loop that pops the generation. i wonder if anybody ever looks at these special cases,

it at least should throw up an error message and not leave you in the dark.

Actually this is a Rhino-made mesh of a polysurface…

NoMeshOutline-2.3dm (3.8 MB)

1 Like

:smile: ups… it looked like gis data… sorry.

Except that one works - it’s a copy.

Looks like moving to a certain spot makes it fail… works in other spots. Totally weird.

NoMeshOutline-2a.3dm (3.8 MB)