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

Feature Request: Adding Python binding for BRepOffsetAPI_DraftAngle #807

Open
javimixet opened this issue Dec 4, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@javimixet
Copy link

The BRepOffsetAPI_DraftAngle class is part of OCCT and is already accessible. However, it is not currently implemented or adapted in build123d.

Working example:

from build123d import *
from ocp_vscode import *
from OCP import *
from math import pi

show_clear()
set_defaults(reset_camera=Camera.KEEP)

with BuildPart() as p:
    Box(20, 20, 20, align=(Align.MIN))

plane_DF = gp.gp_Pln(gp.gp_Pnt(0, 0, 0), gp.gp_Dir(0, 0, 1))
faces_DF = p.faces().sort_by(Axis.Z)[1:-1]
dir_DF = gp.gp_Dir(0, 0, 1)
angle_DF = 7 * pi / 180.0

draft_angle_builder = BRepOffsetAPI.BRepOffsetAPI_DraftAngle(p.part.wrapped)
for face in faces_DF:
    draft_angle_builder.Add(face.wrapped, dir_DF, angle_DF, plane_DF, Flag=True)
draft_angle_builder.Build()

p1 = draft_angle_builder.Shape()

show(p1)
@gumyr gumyr added the enhancement New feature or request label Dec 5, 2024
@gumyr gumyr added this to the Not Gating Release 1.0.0 milestone Dec 5, 2024
@gumyr
Copy link
Owner

gumyr commented Dec 5, 2024

Thank you!

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