Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

More information on cutting planes can be found in the docs.

Code Block
languagejs
//Create cutting plane
const bounding = await hwv.model.getModelBounding(true, true);
const axis = Communicator.Axis.X;
const position = bounding.min;
const referenceGeometry = hwv.cuttingManager.createReferenceGeometryFromAxis(axis, bounding);
const plane = Communicator.Plane.createFromPointAndNormal(position, new Communicator.Point3(1, 0, 0));
const cuttingSection = hwv.cuttingManager.getCuttingSection(0);
cuttingSection.addPlane(plane, referenceGeometry);
await cuttingSection.activate();


//Invert normal and d values of plane
var myPlane = cuttingSection.getPlane(0);
myPlane.normal.negate();
myPlane.d *= -1;


//Update plane
cuttingSection.updatePlane(0, myPlane);

...