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

Consider using dprism for extrude_taper instead of loft #746

Open
gumyr opened this issue Oct 21, 2024 · 1 comment
Open

Consider using dprism for extrude_taper instead of loft #746

gumyr opened this issue Oct 21, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@gumyr
Copy link
Owner

gumyr commented Oct 21, 2024

The surface of the sphere is this example is not correct; however, using a Cone does work.

from build123d import *
from ocp_vscode import show_all

ball_dia = 100
base_dia = 90
base_thickness = 10
base_fillet = 5
base_chamfer = 5
hole_dia = 20
hole_taper = 2

with BuildPart() as ball:
    Sphere(ball_dia / 2)
    with Locations((0, 0, -ball_dia / 2)):
        Cylinder(
            base_dia / 2, base_thickness, align=(Align.CENTER, Align.CENTER, Align.MIN)
        )
    top_surface_coord = -ball_dia / 2 + base_thickness
    fillet_edge, chamfer_edge = (
        ball.edges(Select.LAST)
        .filter_by_position(Axis.Z, top_surface_coord, top_surface_coord)
        .sort_by(SortBy.RADIUS)
    )
    fillet(fillet_edge, base_fillet)
    chamfer(chamfer_edge, base_chamfer)
    # with Locations(Plane.XZ.offset(ball_dia / 2)):
    #     Cone(
    #         hole_dia * 0.5,
    #         hole_dia * 0.4,
    #         ball_dia,
    #         mode=Mode.SUBTRACT,
    #         align=(Align.CENTER, Align.CENTER, Align.MAX),
    #     )
    with BuildSketch(Plane.XZ) as hole_sketch:
        Circle(hole_dia / 2)
    extrude(
        hole_sketch.sketch,
        # until=Until.LAST,
        amount=ball_dia,
        # both=True,
        mode=Mode.SUBTRACT,
        # mode=Mode.INTERSECT,
        taper=hole_taper,
    )
    extrude(
        hole_sketch.sketch,
        amount=-ball_dia,
        mode=Mode.SUBTRACT,
        taper=-hole_taper,
    )

image

The dprism method might be a good alternative to the loft currently used in extrude_taper.

@gumyr gumyr added the enhancement New feature or request label Oct 21, 2024
@gumyr gumyr added this to the Not Gating Release 1.0.0 milestone Oct 21, 2024
@jdegenstein
Copy link
Collaborator

jdegenstein commented Oct 25, 2024

Here is a comparison @jrmobley made a long time ago when we were discussing something related. The differences in behavior are not intuitively obvious between the two methods.

image

EDIT: give proper credit to jrmobley

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

No branches or pull requests

2 participants