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

Function select_lowest

cadquery/hull.py:150–167  ·  view source on GitHub ↗
(arcs: Arcs, points: Points)

Source from the content-addressed store, hash-verified

148
149
150def select_lowest(arcs: Arcs, points: Points) -> Entity:
151
152 rv: Entity
153
154 p_lowest = select_lowest_point(points) if points else None
155 a_lowest = select_lowest_arc(arcs) if arcs else None
156
157 if p_lowest is None and a_lowest:
158 rv = a_lowest[1]
159 elif p_lowest is not None and a_lowest is None:
160 rv = p_lowest[0]
161 elif p_lowest and a_lowest:
162 _, ix = select_lowest_point([p_lowest[0], a_lowest[0]])
163 rv = p_lowest[0] if ix == 0 else a_lowest[1]
164 else:
165 raise ValueError("No entities specified")
166
167 return rv
168
169
170def pt_pt(p1: Point, p2: Point) -> Tuple[float, Segment]:

Callers 1

find_hullFunction · 0.85

Calls 2

select_lowest_pointFunction · 0.85
select_lowest_arcFunction · 0.85

Tested by

no test coverage detected