Add a draft angle to the specified faces.
(
ctx: Shape,
base: Shape,
faces: Shape,
angle: Real,
history: History | None = None,
name: str | None = None,
)
| 7792 | |
| 7793 | @multidispatch |
| 7794 | def draft( |
| 7795 | ctx: Shape, |
| 7796 | base: Shape, |
| 7797 | faces: Shape, |
| 7798 | angle: Real, |
| 7799 | history: History | None = None, |
| 7800 | name: str | None = None, |
| 7801 | ) -> Shape: |
| 7802 | """ |
| 7803 | Add a draft angle to the specified faces. |
| 7804 | """ |
| 7805 | |
| 7806 | base_face = base.face() |
| 7807 | n_dir = base_face.normalAt().toDir() |
| 7808 | base_pln = base_face.toPln() |
| 7809 | |
| 7810 | bldr = BRepOffsetAPI_DraftAngle(ctx.wrapped) |
| 7811 | |
| 7812 | for f in _get_faces(faces): |
| 7813 | bldr.Add(f.wrapped, n_dir, radians(angle), base_pln) |
| 7814 | |
| 7815 | if not bldr.AddDone(): |
| 7816 | raise ValueError(f"Face {f} cannot be used in a draft operation.") |
| 7817 | |
| 7818 | bldr.Build() |
| 7819 | |
| 7820 | _update_history(history, name, [ctx], bldr) |
| 7821 | |
| 7822 | return _compound_or_shape(bldr.Shape()) |
| 7823 | |
| 7824 | |
| 7825 | @multidispatch |