Skip to content

Center Does Not Work as Expected with 2D Objects #1960

@jmwright

Description

@jmwright

Consider the following:

el = cq.Edge.makeEllipse(x_radius = 1.0, y_radius = 10.0)
print(el.Center())

You would expect the center to be (0, 0, 0) because the ellipse is centered around the origin.

Image

However, the result is:

Vector: (-1.0993893973079381e-16, -0.1653496405078786, 0.0)

I created a branch here which added the tolerance parameter in an effort to correct this. It did not work.

Per @adam-urbanczyk it seems like the class BRepGProp_Cinert does the actual work, and does not have a tolerance attribute. So we need to figure out the proper way to handle the fact that Center() works fine with 3D objects but not with 2D ones.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions