Fix extra vertex added during OASIS loading

This commit is contained in:
Jan Petykiewicz 2023-01-24 13:43:22 -08:00
parent 1b04fb7ed0
commit 060f6978cd

View File

@ -280,7 +280,10 @@ def read(
# Switch based on element type:
if isinstance(element, fatrec.Polygon):
vertices = numpy.cumsum(numpy.vstack(((0, 0), element.get_point_list())), axis=0)
# Drop last point (`fatamorgana` returns explicity closed list; we use implicit close)
# also need `cumsum` to convert from deltas to locations
vertices = numpy.cumsum(numpy.vstack(((0, 0), element.get_point_list()[:-1])), axis=0)
annotations = properties_to_annotations(element.properties, lib.propnames, lib.propstrings)
poly = Polygon(
vertices=vertices,