A series of connected, ordered Edges, that typically bounds a Face
| 2881 | |
| 2882 | |
| 2883 | class Wire(Shape, Mixin1D): |
| 2884 | """ |
| 2885 | A series of connected, ordered Edges, that typically bounds a Face |
| 2886 | """ |
| 2887 | |
| 2888 | wrapped: TopoDS_Wire |
| 2889 | |
| 2890 | def _nbEdges(self) -> int: |
| 2891 | """ |
| 2892 | Number of edges. |
| 2893 | """ |
| 2894 | |
| 2895 | sa = ShapeAnalysis_Wire() |
| 2896 | sa.Load(self.wrapped) |
| 2897 | |
| 2898 | return sa.NbEdges() |
| 2899 | |
| 2900 | def _geomAdaptor(self) -> BRepAdaptor_Curve | BRepAdaptor_CompCurve: |
| 2901 | """ |
| 2902 | Return the underlying geometry. |
| 2903 | """ |
| 2904 | |
| 2905 | rv: BRepAdaptor_Curve | BRepAdaptor_CompCurve |
| 2906 | |
| 2907 | if self._nbEdges() == 1: |
| 2908 | rv = self.Edges()[-1]._geomAdaptor() |
| 2909 | else: |
| 2910 | rv = BRepAdaptor_CompCurve(self.wrapped) |
| 2911 | |
| 2912 | return rv |
| 2913 | |
| 2914 | def close(self) -> Wire: |
| 2915 | """ |
| 2916 | Close a Wire |
| 2917 | """ |
| 2918 | |
| 2919 | if not self.IsClosed(): |
| 2920 | e = Edge.makeLine(self.endPoint(), self.startPoint()) |
| 2921 | rv = Wire.combine((self, e))[0] |
| 2922 | else: |
| 2923 | rv = self |
| 2924 | |
| 2925 | return rv |
| 2926 | |
| 2927 | @classmethod |
| 2928 | def combine( |
| 2929 | cls, listOfWires: Iterable[Wire | Edge], tol: float = 1e-9 |
| 2930 | ) -> list[Wire]: |
| 2931 | """ |
| 2932 | Attempt to combine a list of wires and edges into a new wire. |
| 2933 | |
| 2934 | :param cls: |
| 2935 | :param listOfWires: |
| 2936 | :param tol: default 1e-9 |
| 2937 | :return: list[Wire] |
| 2938 | """ |
| 2939 | |
| 2940 | edges_in = TopTools_HSequenceOfShape() |
no outgoing calls
no test coverage detected