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

Method projectToLine

cadquery/occ_impl/geom.py:194–205  ·  view source on GitHub ↗

Returns a new vector equal to the projection of this Vector onto the line represented by Vector :param args: Vector Returns the projected vector.

(self, line: "Vector")

Source from the content-addressed store, hash-verified

192 raise NotImplementedError("Have not needed this yet, but OCCT supports it!")
193
194 def projectToLine(self, line: "Vector") -> "Vector":
195 """
196 Returns a new vector equal to the projection of this Vector onto the line
197 represented by Vector <line>
198
199 :param args: Vector
200
201 Returns the projected vector.
202 """
203 lineLength = line.Length
204
205 return line * (self.dot(line) / (lineLength * lineLength))
206
207 def distanceToPlane(self):
208 raise NotImplementedError("Have not needed this yet, but OCCT supports it!")

Callers 2

testVectorProjectMethod · 0.95
test_Plane_from_LocationFunction · 0.95

Calls 1

dotMethod · 0.95

Tested by 2

testVectorProjectMethod · 0.76
test_Plane_from_LocationFunction · 0.76