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

Function convert_and_validate

cadquery/hull.py:88–112  ·  view source on GitHub ↗
(edges: Iterable[Edge])

Source from the content-addressed store, hash-verified

86
87
88def convert_and_validate(edges: Iterable[Edge]) -> Tuple[List[Arc], List[Point]]:
89
90 arcs: Set[Arc] = set()
91 points: Set[Point] = set()
92
93 for e in edges:
94 gt = e.geomType()
95
96 if gt == "LINE":
97 p1 = e.startPoint()
98 p2 = e.endPoint()
99
100 points.update((Point(p1.x, p1.y), Point(p2.x, p2.y)))
101
102 elif gt == "CIRCLE":
103 c = e.arcCenter()
104 r = e.radius()
105 a1, a2 = e._bounds()
106
107 arcs.add(Arc(Point(c.x, c.y), r, a1, a2))
108
109 else:
110 raise ValueError("Unsupported geometry {gt}")
111
112 return list(arcs), list(points)
113
114
115def select_lowest_point(points: Points) -> Tuple[Point, int]:

Callers 1

find_hullFunction · 0.85

Calls 9

PointClass · 0.85
ArcClass · 0.85
startPointMethod · 0.80
endPointMethod · 0.80
arcCenterMethod · 0.80
_boundsMethod · 0.80
geomTypeMethod · 0.45
radiusMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected