dist/index.js
function bisect(
  object,
  axis,
  offset,
  angle,
  rotateaxis,
  rotateoffset,
  options
) {
  options = util.defaults(options, {
    addRotationCenter: false
  });
  angle = angle || 0;
  var info = util.normalVector(axis);
  var bounds = object.getBounds();
  var size = util.size(object);

  rotateaxis =
    rotateaxis ||
    {
      x: "y",
      y: "x",
      z: "x"
    }[axis];

  // function getDelta(axis, offset) {
  //     // if the offset is negative, then it's an offset from
  //     // the positive side of the axis
  //     var dist = util.isNegative(offset) ? offset = size[axis] + offset : offset;
  //     return util.axisApply(axis, function (i, a) {
  //         return bounds[0][a] + (util.isEmpty(dist) ? size[axis] / 2 : dist);
  //     });
  // }

  var cutDelta = options.cutDelta || util.getDelta(size, bounds, axis, offset);
  var rotateOffsetAxis = {
    xy: "z",
    yz: "x",
    xz: "y"
  }[[axis, rotateaxis].sort().join("")];
  var centroid = object.centroid();
  var rotateDelta = util.getDelta(size, bounds, rotateOffsetAxis, rotateoffset);

  var rotationCenter =
    options.rotationCenter ||
    new CSG$1.Vector3D(
      util.axisApply("xyz", function(i, a) {
        if (a == axis) return cutDelta[i];
        if (a == rotateOffsetAxis) return rotateDelta[i];
        return centroid[a];
      })
    );
  var rotationAxis = util.rotationAxes[rotateaxis];

  var cutplane = CSG$1.OrthoNormalBasis.GetCartesian(
    info.orthoNormalCartesian[0],
    info.orthoNormalCartesian[1]
  )
    .translate(cutDelta)
    .rotate(rotationCenter, rotationAxis, angle);

  var g = util.group("negative,positive", [
    object.cutByPlane(cutplane.plane).color("red"),
    object.cutByPlane(cutplane.plane.flipped()).color("blue")
  ]);

  if (options.addRotationCenter)
    g.add(
      util.unitAxis(size.length() + 10, 0.5, rotationCenter),
      "rotationCenter"
    );

  return g;
}
function bisect(
  object,
  axis,
  offset,
  angle,
  rotateaxis,
  rotateoffset,
  options
) {
  options = util.defaults(options, {
    addRotationCenter: false
  });
  angle = angle || 0;
  var info = util.normalVector(axis);
  var bounds = object.getBounds();
  var size = util.size(object);

  rotateaxis =
    rotateaxis ||
    {
      x: "y",
      y: "x",
      z: "x"
    }[axis];

  // function getDelta(axis, offset) {
  //     // if the offset is negative, then it's an offset from
  //     // the positive side of the axis
  //     var dist = util.isNegative(offset) ? offset = size[axis] + offset : offset;
  //     return util.axisApply(axis, function (i, a) {
  //         return bounds[0][a] + (util.isEmpty(dist) ? size[axis] / 2 : dist);
  //     });
  // }

  var cutDelta = options.cutDelta || util.getDelta(size, bounds, axis, offset);
  var rotateOffsetAxis = {
    xy: "z",
    yz: "x",
    xz: "y"
  }[[axis, rotateaxis].sort().join("")];
  var centroid = object.centroid();
  var rotateDelta = util.getDelta(size, bounds, rotateOffsetAxis, rotateoffset);

  var rotationCenter =
    options.rotationCenter ||
    new CSG$1.Vector3D(
      util.axisApply("xyz", function(i, a) {
        if (a == axis) return cutDelta[i];
        if (a == rotateOffsetAxis) return rotateDelta[i];
        return centroid[a];
      })
    );
  var rotationAxis = util.rotationAxes[rotateaxis];

  var cutplane = CSG$1.OrthoNormalBasis.GetCartesian(
    info.orthoNormalCartesian[0],
    info.orthoNormalCartesian[1]
  )
    .translate(cutDelta)
    .rotate(rotationCenter, rotationAxis, angle);

  var g = util.group("negative,positive", [
    object.cutByPlane(cutplane.plane).color("red"),
    object.cutByPlane(cutplane.plane.flipped()).color("blue")
  ]);

  if (options.addRotationCenter)
    g.add(
      util.unitAxis(size.length() + 10, 0.5, rotationCenter),
      "rotationCenter"
    );

  return g;
}
function bisect ( object , axis , offset , angle , rotateaxis , rotateoffset , options ) { options = util . defaults ( options , { addRotationCenter : false } ) ; angle = angle || 0 ; var info = util . normalVector ( axis ) ; var bounds = object . getBounds ( ) ; var size = util . size ( object ) ; rotateaxis = rotateaxis || { x : "y" , y : "x" , z : "x" } [ axis ] ; // function getDelta(axis, offset) { //     // if the offset is negative, then it's an offset from //     // the positive side of the axis //     var dist = util.isNegative(offset) ? offset = size[axis] + offset : offset; //     return util.axisApply(axis, function (i, a) { //         return bounds[0][a] + (util.isEmpty(dist) ? size[axis] / 2 : dist); //     }); // } var cutDelta = options . cutDelta || util . getDelta ( size , bounds , axis , offset ) ; var rotateOffsetAxis = { xy : "z" , yz : "x" , xz : "y" } [ [ axis , rotateaxis ] . sort ( ) . join ( "" ) ] ; var centroid = object . centroid ( ) ; var rotateDelta = util . getDelta ( size , bounds , rotateOffsetAxis , rotateoffset ) ; var rotationCenter = options . rotationCenter || new CSG$1 . Vector3D ( util . axisApply ( "xyz" , function ( i , a ) { if ( a == axis ) return cutDelta [ i ] ; if ( a == rotateOffsetAxis ) return rotateDelta [ i ] ; return centroid [ a ] ; } ) ) ; var rotationAxis = util . rotationAxes [ rotateaxis ] ; var cutplane = CSG$1 . OrthoNormalBasis . GetCartesian ( info . orthoNormalCartesian [ 0 ] , info . orthoNormalCartesian [ 1 ] ) . translate ( cutDelta ) . rotate ( rotationCenter , rotationAxis , angle ) ; var g = util . group ( "negative,positive" , [ object . cutByPlane ( cutplane . plane ) . color ( "red" ) , object . cutByPlane ( cutplane . plane . flipped ( ) ) . color ( "blue" ) ] ) ; if ( options . addRotationCenter ) g . add ( util . unitAxis ( size . length ( ) + 10 , 0.5 , rotationCenter ) , "rotationCenter" ) ; return g ; }
Cut an object into two pieces, along a given axis. The offset
allows you to move the cut plane along the cut axis.  For example,
a 10mm cube with an offset of 2, will create a 2mm side and an 8mm side.

Negative offsets operate off of the larger side of the axes.  In the previous example, an offset of -2 creates a 8mm side and a 2mm side.

You can angle the cut plane and poistion the rotation point.

![bisect example](jsdoc2md/bisect.png)
@param  {CSG} object object to bisect
@param  {string} axis   axis to cut along
@param  {number} offset offset to cut at
@param  {number} angle angle to rotate the cut plane to
@return {object}  Returns a group object with a parts object.
Cut an object into two pieces along a given axis . The offset allows you to move the cut plane along the cut axis . For example a 10mm cube with an offset of 2 will create a 2mm side and an 8mm side .