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

Method fromEdge

cadquery/occ_impl/nurbs.py:167–180  ·  view source on GitHub ↗
(cls, e: Edge)

Source from the content-addressed store, hash-verified

165
166 @classmethod
167 def fromEdge(cls, e: Edge):
168
169 assert (
170 e.geomType() == "BSPLINE"
171 ), "B-spline geometry required, try converting first."
172
173 g = e._geomAdaptor().BSpline()
174
175 knots = np.repeat(list(g.Knots()), list(g.Multiplicities()))
176 pts = np.array([(p.X(), p.Y(), p.Z()) for p in g.Poles()])
177 order = g.Degree()
178 periodic = g.IsPeriodic()
179
180 return cls(pts, knots, order, periodic)
181
182 def __call__(self, us: Array) -> Array:
183

Callers 6

circlesFunction · 0.80
trimmed_circlesFunction · 0.80
test_curveFunction · 0.80
test_curve_positionFunction · 0.80
test_curve_tangentsFunction · 0.80
test_show_nurbsFunction · 0.80

Calls 2

geomTypeMethod · 0.45
_geomAdaptorMethod · 0.45

Tested by 6

circlesFunction · 0.64
trimmed_circlesFunction · 0.64
test_curveFunction · 0.64
test_curve_positionFunction · 0.64
test_curve_tangentsFunction · 0.64
test_show_nurbsFunction · 0.64