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

Method toWorldCoords

cadquery/occ_impl/geom.py:732–745  ·  view source on GitHub ↗

Convert a point in local coordinates to global coordinates :param tuplePoint: point in local coordinates to convert. :type tuplePoint: a 2 or three tuple of float. The third value is taken to be zero if not supplied. :return: a Vector in global coordinates

(self, tuplePoint)

Source from the content-addressed store, hash-verified

730 )
731
732 def toWorldCoords(self, tuplePoint) -> Vector:
733 """Convert a point in local coordinates to global coordinates
734
735 :param tuplePoint: point in local coordinates to convert.
736 :type tuplePoint: a 2 or three tuple of float. The third value is taken to be zero if not supplied.
737 :return: a Vector in global coordinates
738 """
739 if isinstance(tuplePoint, Vector):
740 v = tuplePoint
741 elif len(tuplePoint) == 2:
742 v = Vector(tuplePoint[0], tuplePoint[1], 0)
743 else:
744 v = Vector(tuplePoint)
745 return v.transform(self.rG)
746
747 def rotated(self, rotate=(0, 0, 0)):
748 """Returns a copy of this plane, rotated about the specified axes

Callers 15

setOrigin2dMethod · 0.95
testYZPlaneOriginsMethod · 0.95
testXYPlaneOriginsMethod · 0.95
testXZPlaneOriginsMethod · 0.95
transformedMethod · 0.80
pushPointsMethod · 0.80
centerMethod · 0.80
lineToMethod · 0.80
moveToMethod · 0.80
moveMethod · 0.80
_toVectorsMethod · 0.80
splineMethod · 0.80

Calls 2

transformMethod · 0.95
VectorClass · 0.85

Tested by 5

testYZPlaneOriginsMethod · 0.76
testXYPlaneOriginsMethod · 0.76
testXZPlaneOriginsMethod · 0.76
testPlaneBasicsMethod · 0.64
testOffsetPlanesMethod · 0.64