Skip to content

Polyhedron Constructor silently fails with non existing file locations #49

Description

@metric-space

Hello hello

Thank you for open sourcing this work

I believe I have stumbled upon a bug

Constructor silently fails if non existing file/file locations are given in with valid file suffixes (with the right count i.e 2).

What I mean by by silently fails (please see code below) is eros_polyhedron.vertices pops out an empty list

from polyhedral_gravity import Polyhedron, evaluate, PolyhedronIntegrity, NormalOrientation, GravityEvaluable, MetricUnit


eros_vertices_path = "./absolutely_made_up_data/Eros.node"
eros_faces_path = "./ata/Eros.face"
density = 2670.0

eros_polyhedron = Polyhedron(
    polyhedral_source=[eros_vertices_path, eros_faces_path],
    density=density,
    normal_orientation=NormalOrientation.OUTWARDS,
    integrity_check=PolyhedronIntegrity.VERIFY,
    metric_unit=MetricUnit.UNITLESS,
)

I think if you trace it all the way, you end up here: https://github.com/libigl/tetgen/blob/master/tetgen.cxx#L367
(from here: https://github.com/esa/polyhedral-gravity-model/blob/main/src/polyhedralGravity/input/TetgenAdapter.cpp#L40)

I can write a fix if you folks don't have the time

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions