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

Setting simple of ThreadedHole to false does not work #34

Open
XCYRKDSDA opened this issue Oct 5, 2024 · 3 comments
Open

Setting simple of ThreadedHole to false does not work #34

XCYRKDSDA opened this issue Oct 5, 2024 · 3 comments

Comments

@XCYRKDSDA
Copy link

This is the pillow block example from the docs. I changed the ClearanceHole to ThreadedHole, and set simple to False.

# Create the pillow block
with BuildPart() as pillow_block:
    with BuildSketch():
        RectangleRounded(width, height, fillet_radius)
    extrude(amount=thickness)
    with Locations((0, 0, thickness)):  # On the top
        PressFitHole(bearing=skate_bearing, interference=0.025 * MM)
        with GridLocations(width - padding, height - padding, 2, 2):
            ThreadedHole(fastener=cap_screw, simple=False)

But in the ocp_vscode window there were no threads in the result model.

截图 2024-10-05 20-56-57

I exported the pillow block into a .step file and opened it with freecad, still no threads, only simple holes.

截图 2024-10-05 20-56-47

@gumyr
Copy link
Owner

gumyr commented Oct 6, 2024

Thanks for raising the issue. This is actually a limitation of build123d as this ThreadedHole object does two things:
1- makes a hole by creating the hole object and combining it with the ongoing object with mode=Mode.SUBTRACT
2- make the thread which needs to be added to the ongoing object with mode=Mode.ADD (this operation will commonly result in invalid geometry generated by the OCCT CAD kernel)
but, build123d doesn't currently support chained operations like this.

Thread is very difficult for the OCCT CAD kernel to work with so I've found that the best way to work around this limitation is to create an assembly, in this case of the pillow block and the thread, which isn't something ThreadedHole can do by itself. Unfortunately there is no easy fix for this.

@XCYRKDSDA
Copy link
Author

I'm not very familiar with mechanical design, but is it ok to make a threaded hole by subtracting a threaded screw? I find it produces an threaded hole that at least looks good.

@XCYRKDSDA
Copy link
Author

Manually making a hole and adding IsoThread works. I'll just take it as a temporary solution.

Cylinder(2 / 2, 3, mode=Mode.SUBTRACT,
         align=(Align.CENTER, Align.CENTER, Align.MAX))
with Locations((0, 0, -3)):
    IsoThread(major_diameter=2, pitch=0.4, length=3, external=False,
              end_finishes=("fade", "fade"))

截图 2024-10-09 00-24-30

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

No branches or pull requests

2 participants