MCPcopy Index your code
hub / github.com/CadQuery/cadquery / radius

Method radius

cadquery/occ_impl/shapes.py:2321–2335  ·  view source on GitHub ↗

Calculate the radius. Note that when applied to a Wire, the radius is simply the radius of the first edge. :return: radius :raises ValueError: if kernel can not reduce the shape to a circular edge

(self: Mixin1DProtocol)

Source from the content-addressed store, hash-verified

2319 return GCPnts_AbscissaPoint.Length_s(self._geomAdaptor())
2320
2321 def radius(self: Mixin1DProtocol) -> float:
2322 """
2323 Calculate the radius.
2324
2325 Note that when applied to a Wire, the radius is simply the radius of the first edge.
2326
2327 :return: radius
2328 :raises ValueError: if kernel can not reduce the shape to a circular edge
2329 """
2330 geom = self._geomAdaptor()
2331 try:
2332 circ = geom.Circle()
2333 except (Standard_NoSuchObject, Standard_Failure) as e:
2334 raise ValueError("Shape could not be reduced to a circle") from e
2335 return circ.Radius()
2336
2337 def IsClosed(self: Mixin1DProtocol) -> bool:
2338

Callers 7

convert_and_validateFunction · 0.45
keyMethod · 0.45
solveMethod · 0.45
testEdgeWrapperRadiusMethod · 0.45
test_constraint_solverFunction · 0.45
testCenterNthSelectorMethod · 0.45
testRadiusNthSelectorMethod · 0.45

Calls 1

_geomAdaptorMethod · 0.45

Tested by 4

testEdgeWrapperRadiusMethod · 0.36
test_constraint_solverFunction · 0.36
testCenterNthSelectorMethod · 0.36
testRadiusNthSelectorMethod · 0.36