Apply 2D chamfer to a face
(self, d: float, vertices: Iterable[Vertex])
| 3732 | return self.__class__(fillet_builder.Shape()) |
| 3733 | |
| 3734 | def chamfer2D(self, d: float, vertices: Iterable[Vertex]) -> Face: |
| 3735 | """ |
| 3736 | Apply 2D chamfer to a face |
| 3737 | """ |
| 3738 | |
| 3739 | chamfer_builder = BRepFilletAPI_MakeFillet2d(self.wrapped) |
| 3740 | edge_map = self._entitiesFrom("Vertex", "Edge") |
| 3741 | |
| 3742 | for v in vertices: |
| 3743 | edges = edge_map[v] |
| 3744 | if len(edges) < 2: |
| 3745 | raise ValueError("Cannot chamfer at this location") |
| 3746 | |
| 3747 | e1, e2 = edges |
| 3748 | |
| 3749 | chamfer_builder.AddChamfer( |
| 3750 | tcast(TopoDS_Edge, e1.wrapped), tcast(TopoDS_Edge, e2.wrapped), d, d |
| 3751 | ) |
| 3752 | |
| 3753 | chamfer_builder.Build() |
| 3754 | |
| 3755 | return self.__class__(chamfer_builder.Shape()).fix() |
| 3756 | |
| 3757 | def toPln(self) -> gp_Pln: |
| 3758 | """ |
nothing calls this directly
no test coverage detected