MCPcopy Create free account
hub / github.com/CadQuery/cadquery / length_cost

Function length_cost

cadquery/occ_impl/sketch_solver.py:157–168  ·  view source on GitHub ↗
(x, t, x0, val)

Source from the content-addressed store, hash-verified

155
156
157def length_cost(x, t, x0, val):
158
159 rv = 0
160
161 if t == "LINE":
162 rv = norm(x[2:] - x[:2]) - val
163 elif t == "CIRCLE":
164 rv = norm(x[2] * x[4]) - val
165 else:
166 raise invalid_args(t)
167
168 return rv
169
170
171def distance_cost(x1, t1, x10, x2, t2, x20, val):

Callers

nothing calls this directly

Calls 1

invalid_argsFunction · 0.85

Tested by

no test coverage detected