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

Method setOrigin2d

cadquery/occ_impl/geom.py:680–702  ·  view source on GitHub ↗

Set a new origin in the plane itself Set a new origin in the plane itself. The plane's orientation and xDrection are unaffected. :param float x: offset in the x direction :param float y: offset in the y direction :return: void The new coord

(self, x, y)

Source from the content-addressed store, hash-verified

678 self._calcTransforms()
679
680 def setOrigin2d(self, x, y):
681 """
682 Set a new origin in the plane itself
683
684 Set a new origin in the plane itself. The plane's orientation and
685 xDrection are unaffected.
686
687 :param float x: offset in the x direction
688 :param float y: offset in the y direction
689 :return: void
690
691 The new coordinates are specified in terms of the current 2D system.
692 As an example:
693
694 p = Plane.XY()
695 p.setOrigin2d(2, 2)
696 p.setOrigin2d(2, 2)
697
698 results in a plane with its origin at (x, y) = (4, 4) in global
699 coordinates. Both operations were relative to local coordinates of the
700 plane.
701 """
702 self.origin = self.toWorldCoords((x, y))
703
704 def toLocalCoords(self, obj):
705 """Project the provided coordinates onto this plane

Callers 1

centerMethod · 0.80

Calls 1

toWorldCoordsMethod · 0.95

Tested by

no test coverage detected