Transform the current path so that its OBB is axis aligned
        and OBB center is at the origin.
338762
def apply_obb(self):
        
        if len(self.root) == 1:
            matrix, bounds = polygons.polygon_obb(
                self.polygons_closed[self.root[0]])
            self.apply_transform(matrix)
            return matrix
        else:
            raise ValueError('Not implemented for multibody geometry')
622062
function setPath(obj, path, value) {
	var cur = obj;
	var parts = path.split('.');
	var i;
	for (i = 0; i < parts.length; i++) {
		if (i === parts.length - 1) {
			cur[parts[i]] = value;
		} else {
			if (isScalar(cur[parts[i]])) cur[parts[i]] = {};
			cur = cur[parts[i]];
		}
	}
	return obj;
}
1131746
def center(self):
        '''
        
        '''
        return Point(self.midX, self.midY, self.origin.z)
1106871
def _start_path(self, sp):
        
        path = sp.add_path(w=self._dx, h=self._dy)
        path.add_moveTo(
            *self._local_to_shape(
                self._start_x, self._start_y
            )
        )
        return path
777515
function (shape, curve, path3D, shapePaths, scale, rotation, scaleFunction, rotateFunction, cap, custom) {
                var tangents = path3D.getTangents();
                var normals = path3D.getNormals();
                var binormals = path3D.getBinormals();
                var distances = path3D.getDistances();
                var angle = 0;
                var returnScale = function () { return scale; };
                var returnRotation = function () { return rotation; };
                var rotate = custom ? rotateFunction : returnRotation;
                var scl = custom ? scaleFunction : returnScale;
                var index = (cap === BABYLON.Mesh.NO_CAP || cap === BABYLON.Mesh.CAP_END) ? 0 : 2;
                var rotationMatrix = BABYLON.Tmp.Matrix[0];
                for (var i = 0; i < curve.length; i++) {
                    var shapePath = new Array();
                    var angleStep = rotate(i, distances[i]);
                    var scaleRatio = scl(i, distances[i]);
                    for (var p = 0; p < shape.length; p++) {
                        BABYLON.Matrix.RotationAxisToRef(tangents[i], angle, rotationMatrix);
                        var planed = ((tangents[i].scale(shape[p].z)).add(normals[i].scale(shape[p].x)).add(binormals[i].scale(shape[p].y)));
                        var rotated = shapePath[p] ? shapePath[p] : BABYLON.Vector3.Zero();
                        BABYLON.Vector3.TransformCoordinatesToRef(planed, rotationMatrix, rotated);
                        rotated.scaleInPlace(scaleRatio).addInPlace(curve[i]);
                        shapePath[p] = rotated;
                    }
                    shapePaths[index] = shapePath;
                    angle += angleStep;
                    index++;
                }
                // cap
                var capPath = function (shapePath) {
                    var pointCap = Array();
                    var barycenter = BABYLON.Vector3.Zero();
                    var i;
                    for (i = 0; i < shapePath.length; i++) {
                        barycenter.addInPlace(shapePath[i]);
                    }
                    barycenter.scaleInPlace(1.0 / shapePath.length);
                    for (i = 0; i < shapePath.length; i++) {
                        pointCap.push(barycenter);
                    }
                    return pointCap;
                };
                switch (cap) {
                    case BABYLON.Mesh.NO_CAP:
                        break;
                    case BABYLON.Mesh.CAP_START:
                        shapePaths[0] = capPath(shapePaths[2]);
                        shapePaths[1] = shapePaths[2];
                        break;
                    case BABYLON.Mesh.CAP_END:
                        shapePaths[index] = shapePaths[index - 1];
                        shapePaths[index + 1] = capPath(shapePaths[index - 1]);
                        break;
                    case BABYLON.Mesh.CAP_ALL:
                        shapePaths[0] = capPath(shapePaths[2]);
                        shapePaths[1] = shapePaths[2];
                        shapePaths[index] = shapePaths[index - 1];
                        shapePaths[index + 1] = capPath(shapePaths[index - 1]);
                        break;
                    default:
                        break;
                }
                return shapePaths;
            }
923804
private Path  makePathAndBoundingBox(Line obj)
   {
      float x1 = (obj.x1 == null) ? 0 : obj.x1.floatValueX(this);
      float y1 = (obj.y1 == null) ? 0 : obj.y1.floatValueY(this);
      float x2 = (obj.x2 == null) ? 0 : obj.x2.floatValueX(this);
      float y2 = (obj.y2 == null) ? 0 : obj.y2.floatValueY(this);

      if (obj.boundingBox == null) {
         obj.boundingBox = new Box(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1), Math.abs(y2-y1));
      }

      Path  p = new Path();
      p.moveTo(x1, y1);
      p.lineTo(x2, y2);
      return p;
   }
27738
def _fixpath(root, base):
    """"""
    return os.path.abspath(os.path.normpath(os.path.join(root, base)))
1006802
function setAxis(axis, axisModel) {
    axis.type = axisModel.get('type');
    axis.scale = createScaleByModel(axisModel);
    axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category';
    axis.inverse = axisModel.get('inverse');

    if (axisModel.mainType === 'angleAxis') {
        axis.inverse ^= axisModel.get('clockwise');
        var startAngle = axisModel.get('startAngle');
        axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360));
    }

    // Inject axis instance
    axisModel.axis = axis;
    axis.model = axisModel;
}
79928
def rotateY(self, angle, axis_point=(0, 0, 0), rad=False):
        """"""
        if rad:
            angle *= 57.29578
        self.RotateY(angle)
        if self.trail:
            self.updateTrail()
        return self
860212
static double axisAdjustedDistanceSq(EllipseRotated_F64 a , EllipseRotated_F64 b ) {
		double dx = b.center.x - a.center.x;
		double dy = b.center.y - a.center.y;

		double c = Math.cos(a.phi);
		double s = Math.sin(a.phi);

		// rotate into ellipse's coordinate frame
		// scale by ratio of major/minor axis
		double x = (dx*c + dy*s);
		double y = (-dx*s + dy*c)*a.a/a.b;

		return x*x + y*y;
	}
341611
public static AxisAlignedBB rotate(AxisAlignedBB aabb, EnumFacing dir)
	{
		if (dir == EnumFacing.SOUTH)
			return aabb;

		int angle = dir.getAxis() == Axis.Y ? dir.getAxisDirection().getOffset() : EnumFacingUtils.getRotationCount(dir);
		Axis axis = dir.getAxis() == Axis.Y ? Axis.X : Axis.Y;

		return rotate(aabb, angle, axis);
	}
753696
def center(self, reference=None):
        
        return self.from_center(x=0.0, y=0.0, z=0.0, reference=reference)
1163572
def _make_annulus_path(patch_inner, patch_outer):
        

        import matplotlib.path as mpath

        path_inner = patch_inner.get_path()
        transform_inner = patch_inner.get_transform()
        path_inner = transform_inner.transform_path(path_inner)

        path_outer = patch_outer.get_path()
        transform_outer = patch_outer.get_transform()
        path_outer = transform_outer.transform_path(path_outer)

        verts_inner = path_inner.vertices[:-1][::-1]
        verts_inner = np.concatenate((verts_inner, [verts_inner[-1]]))

        verts = np.vstack((path_outer.vertices, verts_inner))
        codes = np.hstack((path_outer.codes, path_inner.codes))

        return mpath.Path(verts, codes)
1165464
function(x, y) {
        // clear cached center location
        this.centerLonLat = null;

        if ((this.left == null) || (x < this.left)) {
            this.left = x;
        }
        if ((this.bottom == null) || (y < this.bottom)) {
            this.bottom = y;
        }
        if ((this.right == null) || (x > this.right)) {
            this.right = x;
        }
        if ((this.top == null) || (y > this.top)) {
            this.top = y;
        }
    }
238649
function reShape(object, radius, orientation, options, slicer) {
  options = options || {};
  var b = object.getBounds();
  // var s = util.size(b);
  var ar = Math.abs(radius);
  var si = util.sliceParams(orientation, radius, b);

  if (si.axis !== "z")
    throw new Error(
      'util.reShape error: CAG._toPlanePolytons only uses the "z" axis.  You must use the "z" axis for now.'
    );

  var cutplane = CSG$1.OrthoNormalBasis.GetCartesian(
    si.orthoNormalCartesian[0],
    si.orthoNormalCartesian[1]
  ).translate(si.cutDelta);

  var slice = object.sectionCut(cutplane);

  var first = util.axisApply(si.axis, function() {
    return si.positive ? 0 : ar;
  });

  var last = util.axisApply(si.axis, function() {
    return si.positive ? ar : 0;
  });

  var plane = si.positive ? cutplane.plane : cutplane.plane.flipped();

  var slices = slicer(first, last, slice);

  var delta = util
    .slices2poly(
      slices,
      Object.assign(options, {
        si: si
      }),
      si.axis
    )
    .color(options.color);

  var remainder = object.cutByPlane(plane);
  return union([
    options.unionOriginal ? object : remainder,
    delta.translate(si.moveDelta)
  ]);
}
126218
function makeOffsetPath(ancestor, node) {
  const ancestors = listAncestor(node, func.eq(ancestor));
  return ancestors.map(position).reverse();
}
455903
def setOverlayTransformAbsolute(self, ulOverlayHandle, eTrackingOrigin):
        """"""

        fn = self.function_table.setOverlayTransformAbsolute
        pmatTrackingOriginToOverlayTransform = HmdMatrix34_t()
        result = fn(ulOverlayHandle, eTrackingOrigin, byref(pmatTrackingOriginToOverlayTransform))
        return result, pmatTrackingOriginToOverlayTransform