diff --git a/python/geom.py b/python/geom.py index 0f676e3dc..4ab6f8b02 100755 --- a/python/geom.py +++ b/python/geom.py @@ -1310,9 +1310,13 @@ def __init__( centroid = sum(vertices, Vector3(0)) * ( 1.0 / len(vertices) ) # centroid of floor polygon - original_center = ( - centroid + (0.5 * height) * axis - ) # center as computed from vertices, height, axis + if height == mp.inf: + original_center = centroid # center as computed only from vertices if height is infinite (2d case) + else: + original_center = ( + centroid + (0.5 * height) * axis + ) # center as computed from vertices, height, axis + if center is not None and len(vertices): center = Vector3(*center) # translate vertices to center prism at requested center