MCPcopy
hub / github.com/CadQuery/cadquery / assembleEdges

Method assembleEdges

cadquery/occ_impl/shapes.py:2951–2982  ·  view source on GitHub ↗

Attempts to build a wire that consists of the edges in the provided list :param cls: :param listOfEdges: a list of Edge objects. The edges are not to be consecutive. :return: a wire with the edges assembled BRepBuilderAPI_MakeWire::Error() values:

(cls, listOfEdges: Iterable[Edge])

Source from the content-addressed store, hash-verified

2949
2950 @classmethod
2951 def assembleEdges(cls, listOfEdges: Iterable[Edge]) -> Wire:
2952 """
2953 Attempts to build a wire that consists of the edges in the provided list
2954
2955 :param cls:
2956 :param listOfEdges: a list of Edge objects. The edges are not to be consecutive.
2957 :return: a wire with the edges assembled
2958
2959 BRepBuilderAPI_MakeWire::Error() values:
2960
2961 * BRepBuilderAPI_WireDone = 0
2962 * BRepBuilderAPI_EmptyWire = 1
2963 * BRepBuilderAPI_DisconnectedWire = 2
2964 * BRepBuilderAPI_NonManifoldWire = 3
2965 """
2966 wire_builder = BRepBuilderAPI_MakeWire()
2967
2968 occ_edges_list = TopTools_ListOfShape()
2969 for e in listOfEdges:
2970 occ_edges_list.Append(e.wrapped)
2971 wire_builder.Add(occ_edges_list)
2972
2973 wire_builder.Build()
2974
2975 if not wire_builder.IsDone():
2976 w = (
2977 "BRepBuilderAPI_MakeWire::Error(): returns the construction status. BRepBuilderAPI_WireDone if the wire is built, or another value of the BRepBuilderAPI_WireError enumeration indicating why the construction failed = "
2978 + str(wire_builder.Error())
2979 )
2980 warnings.warn(w)
2981
2982 return cls(wire_builder.Wire())
2983
2984 @classmethod
2985 def makeCircle(cls, radius: float, center: VectorLike, normal: VectorLike) -> Wire:

Callers 15

finalize_hullFunction · 0.80
slotMethod · 0.80
bezierMethod · 0.80
slot2DMethod · 0.80
splineMethod · 0.80
splineApproxMethod · 0.80
parametricCurveMethod · 0.80
ellipseArcMethod · 0.80
wireMethod · 0.80
closeMethod · 0.80
makeCircleMethod · 0.80
makeEllipseMethod · 0.80

Calls

no outgoing calls

Tested by 8

testEdgeWrapperRadiusMethod · 0.64
testSplineMethod · 0.64
test_assembleEdgesMethod · 0.64
testLocationAtMethod · 0.64
testPositionAtMethod · 0.64