Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sketch polygon requires a closed list of points #1180

Closed
lorenzncode opened this issue Oct 15, 2022 · 2 comments · Fixed by #1257
Closed

Sketch polygon requires a closed list of points #1180

lorenzncode opened this issue Oct 15, 2022 · 2 comments · Fixed by #1257
Labels
bug Something isn't working enhancement New feature or request sketching

Comments

@lorenzncode
Copy link
Member

A question on Discord came up regarding Sketch.polygon and calling with a list of points that were not closed.

It wasn't clear to the user that there is no option to close and they are responsible for providing a closed list of points.

pts = [
    (0, 0),
    (5, 0),
    (5, 5),
    (0, 5),
    (0, 0),  # user is responsible for closing
]

s = cq.Sketch().polygon(pts)

r = cq.Workplane().placeSketch(s).extrude(1)

I've added enhancement and docs labels. This is either an enhancement (1) or resolved with doc update (2).

  1. At the OCCT level, BRepBuilderAPI_MakePolygon provides an option to close and Close() method.
    Potentially this option could be exposed in CQ in both Wire.makePolygon and Sketch.polygon
  2. or a note might be added to the docs that the user is responsible for providing a closed list of points.
@lorenzncode lorenzncode added enhancement New feature or request docs labels Oct 15, 2022
@jmwright
Copy link
Member

I like option 1.

@adam-urbanczyk
Copy link
Member

+1 for 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request sketching
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants