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

Asymmetric Chamfer Error #786

Open
gumyr opened this issue Jun 9, 2021 · 6 comments · May be fixed by #1579
Open

Asymmetric Chamfer Error #786

gumyr opened this issue Jun 9, 2021 · 6 comments · May be fixed by #1579

Comments

@gumyr
Copy link
Contributor

gumyr commented Jun 9, 2021

Asymmetric chamfer is not applied consistently. The chamfers on the top of this ring look correct; however, the inner chamfer on the bottom is reversed.
chamferBug

Error found on cadquery master.

import cadquery as cq

chamferBody = (
    cq.Workplane("XY")
    .circle(8)
    .circle(4)
    .extrude(4)
    .faces(">Z").chamfer(0.5,1.5)
    .faces("<Z").chamfer(0.5,1.5)
)
if "show_object" in locals():
    show_object(chamferBody,name="chamferBody")
@adam-urbanczyk
Copy link
Member

The order of the asymmetric chamfer is not well defined in general (I think that it depends on the orientation of the underlying wires).

@gumyr
Copy link
Contributor Author

gumyr commented Jun 9, 2021

I wondered if the cause of this issue was due to the difference in direction of the circular wires of the top and bottom of the doughnut hole. Is there anyway to make the result more predictable?

@adam-urbanczyk
Copy link
Member

Not that I know at the moment.

@ksuszka
Copy link

ksuszka commented Mar 25, 2023

I think I encountered the same issue on other simple example.

    cq.Workplane()
    .box(10,10,10)
    .faces("<Z")
    .workplane()
    .rect(20,1)
    .cutThruAll()
    .faces("<Z")
    .chamfer(1.5,0.5)

chamfer_on_splitted_box

@kolod
Copy link

kolod commented Apr 28, 2024

One more example:

from cadquery import Workplane

for i, query in enumerate(["<X", ">X", "<Y", ">Y", "<Z", ">Z"]):
    result = Workplane(origin=(i*15.0,0,0)).box(10,10,10).faces(query).chamfer(2,1)
    show_object(result)

image

@kolod
Copy link

kolod commented Apr 28, 2024

I think the problem in edge normals.

from cadquery import Workplane
from typing import List, cast
from cadquery.occ_impl.shapes import Edge, Face

c1 = Workplane().box(10, 10, 10).faces("<Y")
print(cast(Face, c1.vals()[0]).normalAt())
for x in cast(List[Edge], c1.faces("<Y").edges().vals()):
    print(x.normal())
Vector: (-0.0, -1.0, -0.0) # Face
Vector: (-0.0, 1.0, 0.0)
Vector: (1.0, 0.0, -0.0)
Vector: (-0.0, 1.0, 0.0)
Vector: (1.0, 0.0, -0.0)

And if add wire() nothing changes.

c2 = Workplane().box(10, 10, 10).faces("<Y")
for x in cast(List[Edge], c2.faces("<Y").edges().wire().vals()):
    print(x.normal())

@kolod kolod linked a pull request May 1, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants